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, slice, slicingBatch, withBatch, withBatches, withBatches, withNode, withNodeKeys, withNodeKeys, withNodeKeys, withNodeKeys, withNodes, withNodes
protected 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()
NodeSequence
width
in class NodeSequence
public long getRowCount()
NodeSequence
getRowCount
in class NodeSequence
public boolean isEmpty()
NodeSequence
isEmpty
in class NodeSequence
public NodeSequence.Batch nextBatch()
NodeSequence
NodeKey
instances.nextBatch
in class NodeSequence
public void restart()
restart
in interface NodeSequence.Restartable
protected void restartBatches()
public void close()
NodeSequence
close
in class NodeSequence
protected 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–2016 JBoss, a division of Red Hat. All rights reserved.