public class CountableSequence extends NodeSequence
PartialMemoryCountableSequenceNodeSequence.AlternateSizeBatch, NodeSequence.Batch, NodeSequence.LimitBatch, NodeSequence.MultiWidthBatch, NodeSequence.Restartable, NodeSequence.RowAccessor, NodeSequence.RowFilter, NodeSequence.SingleWidthBatch| Modifier and Type | Field and Description |
|---|---|
protected AtomicLong |
remainingRowCount |
protected int |
width |
protected String |
workspaceName |
LOGGER, NO_PASS_ROW_FILTER, PASS_ROW_FILTER| Constructor and Description |
|---|
CountableSequence(String workspaceName,
NodeSequence original,
BufferManager bufferMgr,
CachedNodeSupplier nodeCache,
boolean useHeap) |
| Modifier and Type | Method and Description |
|---|---|
protected NodeSequence.Batch |
batchFrom(Iterator<BufferedRows.BufferedRow> rows,
long maxBatchSize) |
void |
close()
Signal that this node sequence is no longer needed.
|
protected BufferedRows.BufferedRow |
createRow(NodeSequence.Batch currentRow) |
protected void |
doInitialize() |
protected NodeSequence.Batch |
doNextBatch() |
long |
getRowCount()
Get the number of rows in this sequence.
|
void |
initialize() |
boolean |
isEmpty()
Determine whether this results is known to be empty.
|
protected long |
loadAll(NodeSequence sequence,
BufferManager.QueueBuffer<BufferedRows.BufferedRow> buffer,
AtomicLong batchSize)
Load all of the rows from the supplied sequence into the buffer.
|
protected long |
loadAll(NodeSequence sequence,
BufferManager.QueueBuffer<BufferedRows.BufferedRow> buffer,
AtomicLong batchSize,
Queue<NodeSequence.Batch> inMemoryBatches,
int numRowsInMemory)
Load all of the rows from the supplied sequence into the buffer.
|
NodeSequence.Batch |
nextBatch()
Get the next batch of
NodeKey instances. |
int |
width()
Get the number of nodes in each row.
|
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, withNodesprotected final AtomicLong remainingRowCount
protected final String workspaceName
protected final int width
public CountableSequence(String workspaceName, NodeSequence original, BufferManager bufferMgr, CachedNodeSupplier nodeCache, boolean useHeap)
public int width()
NodeSequencewidth in class NodeSequencepublic boolean isEmpty()
NodeSequenceisEmpty in class NodeSequencepublic long getRowCount()
NodeSequencegetRowCount in class NodeSequencepublic final NodeSequence.Batch nextBatch()
NodeSequenceNodeKey instances.nextBatch in class NodeSequenceprotected NodeSequence.Batch doNextBatch()
public void close()
NodeSequenceclose in class NodeSequencepublic final void initialize()
protected void doInitialize()
protected long loadAll(NodeSequence sequence, BufferManager.QueueBuffer<BufferedRows.BufferedRow> buffer, AtomicLong batchSize)
sequence - the node sequence; may not be nullbuffer - the buffer into which all rows should be loaded; may not be nullbatchSize - the atomic that should be set with the size of the first batchprotected long loadAll(NodeSequence sequence, BufferManager.QueueBuffer<BufferedRows.BufferedRow> buffer, AtomicLong batchSize, Queue<NodeSequence.Batch> inMemoryBatches, int numRowsInMemory)
sequence - the node sequence; may not be nullbuffer - the buffer into which all rows should be loaded; may not be nullbatchSize - the atomic that should be set with the size of the first batchinMemoryBatches - the queue into which batches that are kept in-memory; may be null, in which case all batches are
placed into the buffernumRowsInMemory - the approximate number of rows that should be kept in-memory; may be non-positive if all batches are
to be placed into the bufferprotected BufferedRows.BufferedRow createRow(NodeSequence.Batch currentRow)
protected NodeSequence.Batch batchFrom(Iterator<BufferedRows.BufferedRow> rows, long maxBatchSize)
Copyright © 2008–2016 JBoss, a division of Red Hat. All rights reserved.