net.sf.farrago.runtime
Class FarragoTransformImpl
java.lang.Object
net.sf.farrago.runtime.FarragoTransformImpl
- All Implemented Interfaces:
- FarragoTransform
- Direct Known Subclasses:
- FarragoGeneratedCodeExamples.ExampleGeneratedFarragoTransform
public abstract class FarragoTransformImpl
- extends Object
- implements FarragoTransform
FarragoTransformImpl provides a base class for generated implementations of
FarragoTransform
.
- Version:
- $Id: //open/dev/farrago/src/net/sf/farrago/runtime/FarragoTransformImpl.java#13 $
- Author:
- Julian Hyde, Stephan Zuercher
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
tupleIter
private TupleIter tupleIter
tupleWriter
private FennelTupleWriter tupleWriter
next
private Object next
FarragoTransformImpl
public FarragoTransformImpl()
init
protected void init(FennelTupleWriter tupleWriter,
TupleIter tupleIter)
- Initialze this FarragoTransformImpl. Generated FarragoTransform
implementations should pass their generated FennelTupleWriter and
TupleIter implementations here. A subclass (not an anonymous subclass)
may pass
null
for tupleWriter
or
tupleIter
iff it has a different way to read or write its data and
iff it overrides execute(java.nio.ByteBuffer, long)
and restart()
as appropriate.
- Parameters:
tupleWriter
- FennelTupleWriter that can marshal this transform's
output tuple format.tupleIter
- TupleIter that performs this transform's work
getTupleIter
protected TupleIter getTupleIter()
- for named subclasses, not for generated transforms
setInputFetchTimeout
public void setInputFetchTimeout(long msec)
- Description copied from interface:
FarragoTransform
- Sets a timeout for fetching an input row. 0 means poll, infinity (ie
Long.MAX_VALUE) means block. The default is to block;
- Specified by:
setInputFetchTimeout
in interface FarragoTransform
execute
public int execute(ByteBuffer outputBuffer,
long quantum)
- Execute this transform. Execution continues until the underlying
tupleIter
returns END_OF_DATA or UNDERFLOW or until the underlying
tupleWriter
can no longer marshal tuples into the output buffer.
- Specified by:
execute
in interface FarragoTransform
- Parameters:
outputBuffer
- output ByteBuffer, written to via tupleWriter
quantum
- the maximum number of tuples to process before returning
- Returns:
- number of bytes marshaled into outputBuffer; 0 on END_OF_DATA; -1
on UNDERFLOW
restart
public void restart()
- Restart the underlying
tupleIter
.
- Specified by:
restart
in interface FarragoTransform