public class BinaryHashTable extends BaseHybridHashTable
The design of this class follows in many parts the design presented in "Hash joins and hash teams in Microsoft SQL Server", by Goetz Graefe et al. In its current state, the implementation lacks features like dynamic role reversal, partition tuning, or histogram guided partitioning.
buildRowCount, buildSpillRetBufferNumbers, buildSpillReturnBuffers, closed, compressionBlockSize, compressionCodecFactory, compressionEnabled, currentEnumerator, currentRecursionDepth, currentSpilledBuildSide, currentSpilledProbeSide, initPartitionFanOut, internalPool, ioManager, LOG, MAX_NUM_PARTITIONS, MAX_RECURSION_DEPTH, numSpillFiles, segmentSize, segmentSizeBits, segmentSizeMask, spillInBytes, totalNumBuffers, tryDistinctBuildRow| Constructor and Description |
|---|
BinaryHashTable(Object owner,
boolean compressionEnabled,
int compressionBlockSize,
AbstractRowDataSerializer buildSideSerializer,
AbstractRowDataSerializer probeSideSerializer,
Projection<org.apache.flink.table.data.RowData,org.apache.flink.table.data.binary.BinaryRowData> buildSideProjection,
Projection<org.apache.flink.table.data.RowData,org.apache.flink.table.data.binary.BinaryRowData> probeSideProjection,
org.apache.flink.runtime.memory.MemoryManager memManager,
long reservedMemorySize,
org.apache.flink.runtime.io.disk.iomanager.IOManager ioManager,
int avgRecordLen,
long buildRowCount,
boolean useBloomFilters,
HashJoinType type,
JoinCondition condFunc,
boolean reverseJoin,
boolean[] filterNulls,
boolean tryDistinctBuildRow) |
| Modifier and Type | Method and Description |
|---|---|
void |
clearPartitions()
This method clears all partitions currently residing (partially) in memory.
|
void |
endBuild()
End build phase.
|
RowIterator<org.apache.flink.table.data.binary.BinaryRowData> |
getBuildSideIterator() |
org.apache.flink.table.data.RowData |
getCurrentProbeRow() |
List<BinaryHashPartition> |
getPartitionsPendingForSMJ() |
RowIterator |
getSpilledPartitionBuildSideIter(BinaryHashPartition p) |
ProbeIterator |
getSpilledPartitionProbeSideIter(BinaryHashPartition p) |
boolean |
nextMatching()
Next record from rebuilt spilled partition or build side outer partition.
|
void |
putBuildRow(org.apache.flink.table.data.RowData row)
Put a build side row to hash table.
|
protected int |
spillPartition()
Selects a partition and spills it.
|
boolean |
tryProbe(org.apache.flink.table.data.RowData record)
Find matched build side rows for a probe row.
|
close, createInputView, ensureNumBuffersReturned, free, freeCurrent, freePages, getNextBuffer, getNextBuffers, getNotNullNextBuffer, getNumSpillFiles, getSpillInBytes, getUsedMemoryInBytes, hash, maxInitBufferOfBucketArea, maxNumPartition, nextSegment, pageSize, readAllBuffers, releaseMemoryCacheForSMJ, remainBuffers, returnAll, returnPagepublic BinaryHashTable(Object owner, boolean compressionEnabled, int compressionBlockSize, AbstractRowDataSerializer buildSideSerializer, AbstractRowDataSerializer probeSideSerializer, Projection<org.apache.flink.table.data.RowData,org.apache.flink.table.data.binary.BinaryRowData> buildSideProjection, Projection<org.apache.flink.table.data.RowData,org.apache.flink.table.data.binary.BinaryRowData> probeSideProjection, org.apache.flink.runtime.memory.MemoryManager memManager, long reservedMemorySize, org.apache.flink.runtime.io.disk.iomanager.IOManager ioManager, int avgRecordLen, long buildRowCount, boolean useBloomFilters, HashJoinType type, JoinCondition condFunc, boolean reverseJoin, boolean[] filterNulls, boolean tryDistinctBuildRow)
public void putBuildRow(org.apache.flink.table.data.RowData row)
throws IOException
IOExceptionpublic void endBuild()
throws IOException
IOExceptionpublic boolean tryProbe(org.apache.flink.table.data.RowData record)
throws IOException
IOExceptionpublic boolean nextMatching()
throws IOException
IOExceptionpublic org.apache.flink.table.data.RowData getCurrentProbeRow()
public RowIterator<org.apache.flink.table.data.binary.BinaryRowData> getBuildSideIterator()
public void clearPartitions()
This method is intended for a hard cleanup in the case that the join is aborted.
clearPartitions in class BaseHybridHashTableprotected int spillPartition()
throws IOException
spillPartition in class BaseHybridHashTableIOExceptionpublic List<BinaryHashPartition> getPartitionsPendingForSMJ()
public RowIterator getSpilledPartitionBuildSideIter(BinaryHashPartition p) throws IOException
IOExceptionpublic ProbeIterator getSpilledPartitionProbeSideIter(BinaryHashPartition p) throws IOException
IOExceptionCopyright © 2014–2025 The Apache Software Foundation. All rights reserved.