@NotThreadSafe public abstract class JoinSequence extends BufferingSequence
NodeSequence
implementation that performs a join of two delegate sequences.HashJoinSequence
Modifier and Type | Class and Description |
---|---|
protected static interface |
JoinSequence.BatchFactory
A factory for batches.
|
protected class |
JoinSequence.EmptyBatchFactory
A
JoinSequence.BatchFactory that always returns null. |
protected class |
JoinSequence.LeftOnlyBatch |
protected class |
JoinSequence.LeftOnlyBatchFactory
A
JoinSequence.BatchFactory for batches that return only the left-hand rows. |
static class |
JoinSequence.Range<K> |
static interface |
JoinSequence.RangeProducer<K> |
protected class |
JoinSequence.RightOnlyBatch |
protected class |
JoinSequence.RightOnlyBatchFactory
A
JoinSequence.BatchFactory for batches that return only the right-hand rows. |
NodeSequence.AlternateSizeBatch, NodeSequence.Batch, NodeSequence.LimitBatch, NodeSequence.MultiWidthBatch, NodeSequence.Restartable, NodeSequence.RowAccessor, NodeSequence.RowFilter, NodeSequence.SingleWidthBatch
Modifier and Type | Field and Description |
---|---|
protected int |
batchSize |
protected NodeSequence.Batch |
currentLeft |
protected JoinType |
joinType |
protected NodeSequence |
left |
protected RowExtractors.ExtractFromRow |
leftExtractor |
protected int |
leftWidth |
protected int |
totalWidth |
buffer, cache, extractor, logger, remainingRowCount, rowFactory, rowsLeftInBatch, trace, width, workspaceName
delegate
LOGGER, NO_PASS_ROW_FILTER, PASS_ROW_FILTER
Modifier | Constructor and Description |
---|---|
protected |
JoinSequence(String workspaceName,
NodeSequence left,
NodeSequence right,
RowExtractors.ExtractFromRow leftExtractor,
RowExtractors.ExtractFromRow rightExtractor,
JoinType joinType,
BufferManager bufferMgr,
CachedNodeSupplier nodeCache,
boolean pack,
boolean useHeap,
boolean allowDuplicates) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Signal that this node sequence is no longer needed.
|
protected NodeSequence.Batch |
findNextNonEmptyLeftBatch() |
protected abstract JoinSequence.BatchFactory |
initialize()
Called once when the implementation is to create a
JoinSequence.BatchFactory for all batches returned by this join sequence. |
boolean |
isEmpty()
Determine whether this results is known to be empty.
|
NodeSequence.Batch |
nextBatch()
Get the next batch of
NodeKey instances. |
protected boolean |
useAllLeftRowsWhenNoMatchingRightRows()
Determine whether the algorithm that encounters a left row with no matching right rows should still include such left rows
in the result.
|
protected boolean |
useAllRightRowsWhenNoLeftRows()
Determine whether the algorithm that encounters no left rows should process the right rows.
|
protected boolean |
useNonMatchingRightRows()
Determine whether the algorithm should return rows from the right-side of the join that were no matched to left rows.
|
int |
width()
Get the number of nodes in each row.
|
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 NodeSequence left
protected final RowExtractors.ExtractFromRow leftExtractor
protected final int leftWidth
protected final int totalWidth
protected final JoinType joinType
protected int batchSize
protected NodeSequence.Batch currentLeft
protected JoinSequence(String workspaceName, NodeSequence left, NodeSequence right, RowExtractors.ExtractFromRow leftExtractor, RowExtractors.ExtractFromRow rightExtractor, JoinType joinType, BufferManager bufferMgr, CachedNodeSupplier nodeCache, boolean pack, boolean useHeap, boolean allowDuplicates)
public int width()
NodeSequence
width
in class DelegatingSequence
public boolean isEmpty()
NodeSequence
isEmpty
in class BufferingSequence
public NodeSequence.Batch nextBatch()
NodeSequence
NodeKey
instances.nextBatch
in class DelegatingSequence
protected NodeSequence.Batch findNextNonEmptyLeftBatch()
protected abstract JoinSequence.BatchFactory initialize()
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.protected boolean useAllRightRowsWhenNoLeftRows()
join type
is a right outer join
.
The cross join
(or Cartesian Product) is not included because the number of rows returned will be
Nleft x Nright
, where Nleft
is the number of rows on the
left-hand side, and Nright
is the number of rows on the right-hand side. Therefore, if either is
empty, the result is empty.
protected boolean useAllLeftRowsWhenNoMatchingRightRows()
join type
is a full
outer join
or left outer join
.protected boolean useNonMatchingRightRows()
join type
is a full outer join
or
right outer join
.public void close()
NodeSequence
close
in class BufferingSequence
Copyright © 2008–2016 JBoss, a division of Red Hat. All rights reserved.