Class LongHybridHashTable

  • All Implemented Interfaces:
    org.apache.flink.core.memory.MemorySegmentSource, MemorySegmentPool

    public abstract class LongHybridHashTable
    extends BaseHybridHashTable
    Special optimized hashTable with key long.

    See LongHashPartition. TODO add min max long filter and bloomFilter to spilled partition.

    • Constructor Detail

      • LongHybridHashTable

        public LongHybridHashTable​(Object owner,
                                   boolean compressionEnabled,
                                   int compressionBlockSize,
                                   BinaryRowDataSerializer buildSideSerializer,
                                   BinaryRowDataSerializer probeSideSerializer,
                                   org.apache.flink.runtime.memory.MemoryManager memManager,
                                   long reservedMemorySize,
                                   org.apache.flink.runtime.io.disk.iomanager.IOManager ioManager,
                                   int avgRecordLen,
                                   long buildRowCount)
    • Method Detail

      • putBuildRow

        public void putBuildRow​(org.apache.flink.table.data.binary.BinaryRowData row)
                         throws IOException
        Throws:
        IOException
      • get

        @Nullable
        public final RowIterator<org.apache.flink.table.data.binary.BinaryRowData> get​(long probeKey)
                                                                                throws IOException
        This method is only used for operator fusion codegen to get build row from hash table. If the build partition has spilled to disk, return null directly which requires the join operator also spill probe row to disk.
        Throws:
        IOException
      • insertIntoProbeBuffer

        public final void insertIntoProbeBuffer​(org.apache.flink.table.data.RowData probeRecord)
                                         throws IOException
        If the probe row corresponding partition has been spilled to disk, just call this method spill probe row to disk.

        Note: This must be called only after get(long) method.

        Throws:
        IOException
      • tryProbe

        public boolean tryProbe​(org.apache.flink.table.data.RowData record)
                         throws IOException
        Throws:
        IOException
      • getCurrentProbeRow

        public org.apache.flink.table.data.RowData getCurrentProbeRow()
      • close

        public void close()
        Description copied from class: BaseHybridHashTable
        Closes the hash table. This effectively releases all internal structures and closes all open files and removes them. The call to this method is valid both as a cleanup after the complete inputs were properly processed, and as an cancellation call, which cleans up all resources that are currently held by the hash join.
        Overrides:
        close in class BaseHybridHashTable
      • getBuildLongKey

        public abstract long getBuildLongKey​(org.apache.flink.table.data.RowData row)
        For code gen get build side long key.
      • getProbeLongKey

        public abstract long getProbeLongKey​(org.apache.flink.table.data.RowData row)
        For code gen get probe side long key.
      • probeToBinary

        public abstract org.apache.flink.table.data.binary.BinaryRowData probeToBinary​(org.apache.flink.table.data.RowData row)
        For code gen probe side to BinaryRowData.
      • compressionEnabled

        public boolean compressionEnabled()
      • compressionCodecFactory

        public org.apache.flink.runtime.io.compression.BlockCompressionFactory compressionCodecFactory()
      • compressionBlockSize

        public int compressionBlockSize()