public class RestartableSequence extends NodeSequence implements NodeSequence.Restartable
NodeSequence that captures the buffers as they are used (or all at once) so that the sequence can be restarted.| Modifier and Type | Class and Description |
|---|---|
protected static interface |
RestartableSequence.BatchSequence |
protected class |
RestartableSequence.QueueBufferSupplier |
NodeSequence.AlternateSizeBatch, NodeSequence.Batch, NodeSequence.LimitBatch, NodeSequence.MultiWidthBatch, NodeSequence.Restartable, NodeSequence.RowAccessor, NodeSequence.RowFilter, NodeSequence.SingleWidthBatch| Modifier and Type | Field and Description |
|---|---|
protected int |
actualNumRowsInMemory |
protected AtomicLong |
batchSize |
protected Queue<NodeSequence.Batch> |
inMemoryBatches |
protected boolean |
loadedAll |
protected RestartableSequence.QueueBufferSupplier |
offHeapBatchesSupplier |
protected NodeSequence |
original |
protected AtomicLong |
remainingRowCount |
protected org.mapdb.Serializer<BufferedRows.BufferedRow> |
rowSerializer |
protected long |
totalSize |
protected boolean |
usedOffHeap |
protected int |
width |
protected String |
workspaceName |
LOGGER, NO_PASS_ROW_FILTER, PASS_ROW_FILTER| Constructor and Description |
|---|
RestartableSequence(String workspaceName,
NodeSequence original,
BufferManager bufferMgr,
CachedNodeSupplier nodeCache,
int numRowsInMemory) |
| 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) |
long |
getRowCount()
Get the number of rows in this sequence.
|
boolean |
isEmpty()
Determine whether this results is known to be empty.
|
protected long |
loadBatch(NodeSequence.Batch batch,
boolean loadIntoMemory,
AtomicReference<NodeSequence.Batch> copyOutput) |
protected void |
loadRemaining()
Load all of the remaining rows from the supplied sequence into the buffer.
|
NodeSequence.Batch |
nextBatch()
Get the next batch of
NodeKey instances. |
void |
restart() |
protected void |
restartBatches() |
String |
toString() |
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, withBatch, withBatches, withBatches, withNode, withNodeKeys, withNodeKeys, withNodeKeys, withNodeKeys, withNodes, withNodesprotected final NodeSequence original
protected final org.mapdb.Serializer<BufferedRows.BufferedRow> rowSerializer
protected final Queue<NodeSequence.Batch> inMemoryBatches
protected final RestartableSequence.QueueBufferSupplier offHeapBatchesSupplier
protected final String workspaceName
protected final AtomicLong remainingRowCount
protected final int width
protected final AtomicLong batchSize
protected int actualNumRowsInMemory
protected long totalSize
protected boolean loadedAll
protected boolean usedOffHeap
public RestartableSequence(String workspaceName, NodeSequence original, BufferManager bufferMgr, CachedNodeSupplier nodeCache, int numRowsInMemory)
public int width()
NodeSequencewidth in class NodeSequencepublic long getRowCount()
NodeSequencegetRowCount in class NodeSequencepublic boolean isEmpty()
NodeSequenceisEmpty in class NodeSequencepublic NodeSequence.Batch nextBatch()
NodeSequenceNodeKey instances.nextBatch in class NodeSequencepublic void restart()
restart in interface NodeSequence.Restartableprotected void restartBatches()
public void close()
NodeSequenceclose in class NodeSequenceprotected void loadRemaining()
protected long loadBatch(NodeSequence.Batch batch, boolean loadIntoMemory, AtomicReference<NodeSequence.Batch> copyOutput)
protected BufferedRows.BufferedRow createRow(NodeSequence.Batch currentRow)
protected NodeSequence.Batch batchFrom(Iterator<BufferedRows.BufferedRow> rows, long maxBatchSize)
Copyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.