public class BatchIterator extends AbstractTupleSource
BatchCollector.BatchProducer
.
By setting #setBuffer(TupleBuffer)
,
the iterator can copy on read into a TupleBuffer
for repeated reading.
Note that the saveOnMark buffering only lasts until the next mark is set.batch, currentTuple
Constructor and Description |
---|
BatchIterator(BatchCollector.BatchProducer source) |
Modifier and Type | Method and Description |
---|---|
long |
available() |
void |
closeSource()
Closes the Tuple Source.
|
void |
disableSave() |
boolean |
ensureSave()
non-destructive method to set the mark
|
protected List<?> |
finalRow() |
protected TupleBatch |
getBatch(long row) |
TupleBuffer |
getBuffer() |
protected List<?> |
getCurrentTuple() |
void |
mark()
Save the current position that can be restored with a call to
IndexedTupleSource.reset() |
void |
readAhead(long limit) |
void |
reset()
Restore the previous mark and set the mark back to the first position.
|
void |
setBuffer(TupleBuffer buffer,
boolean saveOnMark) |
void |
setPosition(long position)
Set the tuple source position
|
getCurrentIndex, hasNext, nextTuple
public BatchIterator(BatchCollector.BatchProducer source)
protected TupleBatch getBatch(long row) throws TeiidComponentException, TeiidProcessingException
getBatch
in class AbstractTupleSource
TeiidComponentException
TeiidProcessingException
protected List<?> finalRow() throws TeiidComponentException, TeiidProcessingException
finalRow
in class AbstractTupleSource
TeiidComponentException
TeiidProcessingException
protected List<?> getCurrentTuple() throws TeiidComponentException, BlockedException, TeiidProcessingException
getCurrentTuple
in class AbstractTupleSource
TeiidComponentException
BlockedException
TeiidProcessingException
public long available()
available
in class AbstractTupleSource
public void setBuffer(TupleBuffer buffer, boolean saveOnMark)
public void closeSource()
TupleSource
closeSource
in interface TupleSource
closeSource
in class AbstractTupleSource
public void reset()
IndexedTupleSource
reset
in interface IndexedTupleSource
reset
in class AbstractTupleSource
public void mark() throws TeiidComponentException
IndexedTupleSource
IndexedTupleSource.reset()
mark
in interface IndexedTupleSource
mark
in class AbstractTupleSource
TeiidComponentException
public void setPosition(long position)
IndexedTupleSource
setPosition
in interface IndexedTupleSource
setPosition
in class AbstractTupleSource
public boolean ensureSave()
public void disableSave()
public void readAhead(long limit) throws TeiidComponentException, TeiidProcessingException
public TupleBuffer getBuffer()
Copyright © 2018 JBoss by Red Hat. All rights reserved.