@NotThreadSafe public class HashJoinSequence extends JoinSequence
NodeSequence
implementation that performs an equijoin of two delegate sequences. The hash-join algorithm loads all
values on the right side into a buffer that hashes the right join condition value of each row. Then, it iterates through all
tuples on the left side and finds which of the values on the right have a matching join condition value.Modifier and Type | Class and Description |
---|---|
protected class |
HashJoinSequence.HashCrossJoinBatch
A batch that contains rows that will have no left value and a right value.
|
protected class |
HashJoinSequence.HashCrossJoinBatchFactory |
protected class |
HashJoinSequence.HashJoinBatch
A batch that contains rows that will have a left value and a right value.
|
protected class |
HashJoinSequence.HashJoinBatchFactory |
protected class |
HashJoinSequence.HashJoinRangeBatch
A batch that contains rows that will have a left value and a right value.
|
protected class |
HashJoinSequence.HashJoinRangeBatchFactory |
protected class |
HashJoinSequence.RightRowsBatch
A batch that contains rows that will have no left value and a right value.
|
JoinSequence.BatchFactory, JoinSequence.EmptyBatchFactory, JoinSequence.LeftOnlyBatch, JoinSequence.LeftOnlyBatchFactory, JoinSequence.Range<K>, JoinSequence.RangeProducer<K>, JoinSequence.RightOnlyBatch, JoinSequence.RightOnlyBatchFactory
NodeSequence.AlternateSizeBatch, NodeSequence.Batch, NodeSequence.LimitBatch, NodeSequence.MultiWidthBatch, NodeSequence.Restartable, NodeSequence.RowAccessor, NodeSequence.RowFilter, NodeSequence.SingleWidthBatch
Modifier and Type | Field and Description |
---|---|
protected JoinSequence.RangeProducer<Object> |
rangeProducer |
protected BufferManager.DistinctBuffer<Object> |
rightMatchedRowKeys |
protected BufferManager.DistinctBuffer<BufferedRows.BufferedRow> |
rightRowsWithNullKey |
batchSize, currentLeft, joinType, left, leftExtractor, leftWidth, totalWidth
buffer, cache, extractor, logger, remainingRowCount, rowFactory, rowsLeftInBatch, trace, width, workspaceName
delegate
LOGGER, NO_PASS_ROW_FILTER, PASS_ROW_FILTER
Constructor and Description |
---|
HashJoinSequence(String workspaceName,
NodeSequence left,
NodeSequence right,
RowExtractors.ExtractFromRow leftExtractor,
RowExtractors.ExtractFromRow rightExtractor,
JoinType joinType,
BufferManager bufferMgr,
CachedNodeSupplier nodeCache,
JoinSequence.RangeProducer<?> rangeProducer,
boolean pack,
boolean useHeap) |
Modifier and Type | Method and Description |
---|---|
protected Iterator<BufferedRows.BufferedRow> |
allRightRows() |
void |
close()
Signal that this node sequence is no longer needed.
|
protected JoinSequence.BatchFactory |
initialize()
Called once when the implementation is to create a
JoinSequence.BatchFactory for all batches returned by this join sequence. |
String |
toString() |
findNextNonEmptyLeftBatch, isEmpty, nextBatch, useAllLeftRowsWhenNoMatchingRightRows, useAllRightRowsWhenNoLeftRows, useNonMatchingRightRows, width
batchFrom, createRow, loadAll, rowCount
getRowCount
append, batchFilteredWith, batchOf, batchOf, batchOf, batchOfKeys, batchOfKeys, batchOfKeys, batchOfKeys, batchWithCount, copy, emptyBatch, emptySequence, filter, keyFor, limit, limit, merging, requireBoth, requireEither, skip, slice, slicingBatch, withBatch, withBatches, withBatches, withNode, withNodeKeys, withNodeKeys, withNodeKeys, withNodeKeys, withNodes, withNodes
protected final BufferManager.DistinctBuffer<Object> rightMatchedRowKeys
protected final BufferManager.DistinctBuffer<BufferedRows.BufferedRow> rightRowsWithNullKey
protected final JoinSequence.RangeProducer<Object> rangeProducer
public HashJoinSequence(String workspaceName, NodeSequence left, NodeSequence right, RowExtractors.ExtractFromRow leftExtractor, RowExtractors.ExtractFromRow rightExtractor, JoinType joinType, BufferManager bufferMgr, CachedNodeSupplier nodeCache, JoinSequence.RangeProducer<?> rangeProducer, boolean pack, boolean useHeap)
protected JoinSequence.BatchFactory initialize()
JoinSequence
JoinSequence.BatchFactory
for all batches returned by this join sequence.
This is called only when we know that there are at least some rows on the left side.initialize
in class JoinSequence
protected Iterator<BufferedRows.BufferedRow> allRightRows()
public void close()
NodeSequence
close
in class JoinSequence
Copyright © 2008–2016 JBoss, a division of Red Hat. All rights reserved.