Class BytesMap<K,​V>

    • Field Detail

      • numBucketsPerSegment

        protected final int numBucketsPerSegment
      • numBucketsPerSegmentBits

        protected final int numBucketsPerSegmentBits
      • numBucketsPerSegmentMask

        protected final int numBucketsPerSegmentMask
      • lastBucketPosition

        protected final int lastBucketPosition
      • segmentSize

        protected final int segmentSize
      • reservedNumBuffers

        protected final int reservedNumBuffers
      • numElements

        protected long numElements
      • numBucketsMask

        protected int numBucketsMask
      • log2NumBuckets

        protected int log2NumBuckets
      • numBucketsMask2

        protected int numBucketsMask2
      • INIT_BUCKET_MEMORY_IN_BYTES

        protected static final long INIT_BUCKET_MEMORY_IN_BYTES
        See Also:
        Constant Field Values
      • growthThreshold

        protected int growthThreshold
        The map will be expanded once the number of elements exceeds this threshold.
      • recordArea

        protected org.apache.flink.table.runtime.util.collections.binary.BytesMap.RecordArea<K,​V> recordArea
        The segments where the actual data is stored.
      • reusedKey

        protected K reusedKey
        Used as a reused object when lookup and iteration.
      • reusedValue

        protected V reusedValue
        Used as a reused object when retrieve the map's value by key and iteration.
      • numSpillFiles

        protected long numSpillFiles
      • spillInBytes

        protected long spillInBytes
    • Method Detail

      • getNumKeys

        public abstract long getNumKeys()
        Returns the number of keys in this map.
      • initBucketSegments

        protected void initBucketSegments​(int numBucketSegments)
      • resetBucketSegments

        protected void resetBucketSegments​(List<MemorySegment> resetBucketSegs)
      • getNumSpillFiles

        public long getNumSpillFiles()
      • getSpillInBytes

        public long getSpillInBytes()
      • getNumElements

        public long getNumElements()
      • free

        public void free​(boolean reservedRecordMemory)
        Parameters:
        reservedRecordMemory - reserved fixed memory or not.
      • reset

        public void reset()
        reset the map's record and bucket area's memory segments for reusing.
      • lookup

        public BytesMap.LookupInfo<K,​V> lookup​(K key)
        Parameters:
        key - by which looking up the value in the hash map. Only support the key in the BinaryRowData form who has only one MemorySegment.
        Returns:
        BytesMap.LookupInfo
      • growAndRehash

        protected void growAndRehash()
                              throws EOFException
        Throws:
        EOFException - if the map can't allocate much more memory.
      • calcSecondHashCode

        protected int calcSecondHashCode​(int firstHashCode)