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, nextTuplepublic BatchIterator(BatchCollector.BatchProducer source)
protected TupleBatch getBatch(long row) throws TeiidComponentException, TeiidProcessingException
getBatch in class AbstractTupleSourceTeiidComponentExceptionTeiidProcessingExceptionprotected List<?> finalRow() throws TeiidComponentException, TeiidProcessingException
finalRow in class AbstractTupleSourceTeiidComponentExceptionTeiidProcessingExceptionprotected List<?> getCurrentTuple() throws TeiidComponentException, BlockedException, TeiidProcessingException
getCurrentTuple in class AbstractTupleSourceTeiidComponentExceptionBlockedExceptionTeiidProcessingExceptionpublic long available()
available in class AbstractTupleSourcepublic void setBuffer(TupleBuffer buffer, boolean saveOnMark)
public void closeSource()
TupleSourcecloseSource in interface TupleSourcecloseSource in class AbstractTupleSourcepublic void reset()
IndexedTupleSourcereset in interface IndexedTupleSourcereset in class AbstractTupleSourcepublic void mark()
throws TeiidComponentException
IndexedTupleSourceIndexedTupleSource.reset()mark in interface IndexedTupleSourcemark in class AbstractTupleSourceTeiidComponentExceptionpublic void setPosition(long position)
IndexedTupleSourcesetPosition in interface IndexedTupleSourcesetPosition in class AbstractTupleSourcepublic 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.