org.eigenbase.runtime
Class CalcTupleIter

java.lang.Object
  extended by org.eigenbase.runtime.CalcTupleIter
All Implemented Interfaces:
TupleIter, ClosableAllocation
Direct Known Subclasses:
NestedLoopCalcTupleIter

public abstract class CalcTupleIter
extends Object
implements TupleIter

CalcTupleIter is an abstract base for iterator implementations generated by IterCalcRel .


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.eigenbase.runtime.TupleIter
TupleIter.NoDataReason, TupleIter.TimeoutException
 
Field Summary
protected  TupleIter inputIterator
           
 
Fields inherited from interface org.eigenbase.runtime.TupleIter
EMPTY_ITERATOR
 
Constructor Summary
protected CalcTupleIter(TupleIter inputIterator)
          Constructor.
 
Method Summary
 void closeAllocation()
          Closes this object.
 void restart()
          Restarts this iterator, so that a subsequent call to TupleIter.fetchNext() returns the first element in the collection being iterated.
 boolean setTimeout(long timeout, boolean asUnderflow)
          Sets a timeout for TupleIter.fetchNext(); (optional operation).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eigenbase.runtime.TupleIter
fetchNext
 

Field Detail

inputIterator

protected TupleIter inputIterator
Constructor Detail

CalcTupleIter

protected CalcTupleIter(TupleIter inputIterator)
Constructor.

Parameters:
inputIterator - iterator producing results to be transformed
Method Detail

setTimeout

public boolean setTimeout(long timeout,
                          boolean asUnderflow)
Description copied from interface: TupleIter
Sets a timeout for TupleIter.fetchNext(); (optional operation). Not all implementing classes support a timeout. For those that do, this method provides a common interface, For those that do not, the adapter TimeoutQueueTupleIter puts a timeout queue on top.

Specified by:
setTimeout in interface TupleIter
Parameters:
timeout - in milliseconds. 0 means poll, infinity means block.
asUnderflow - true means indicate timeout by returning TupleIter.NoDataReason.UNDERFLOW; false means throw TupleIter.TimeoutException on a timeout.
Returns:
true if the timeout was set, false if the implementing class does not support a timeout.

restart

public void restart()
Description copied from interface: TupleIter
Restarts this iterator, so that a subsequent call to TupleIter.fetchNext() returns the first element in the collection being iterated.

Specified by:
restart in interface TupleIter

closeAllocation

public void closeAllocation()
Description copied from interface: ClosableAllocation
Closes this object.

Specified by:
closeAllocation in interface ClosableAllocation