Package org.teiid.common.buffer
Class TupleBatch
- java.lang.Object
-
- org.teiid.common.buffer.TupleBatch
-
public class TupleBatch extends Object
Represents a set of indexed tuples. Thebeginning row
is the first row contained in this batch; if it equals "1" then it is the first row of the tuple source, otherwise this is a batch of intermediate tuples. Theending row
is the last row contained in this tuple batch; it is equal to the beginning row plus thenumber of rows
contained in this batch, minus one.
-
-
Field Summary
Fields Modifier and Type Field Description static byte
ITERATION_TERMINATED
static byte
NOT_TERMINATED
static byte
TERMINATED
protected List<List<?>>
tuples
-
Constructor Summary
Constructors Constructor Description TupleBatch()
Required to honor Externalizable contractTupleBatch(long beginRow, List<?>[] tuples)
ConstructorTupleBatch(long beginRow, List<? extends List<?>> listOfTupleLists)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
containsRow(long row)
List<?>[]
getAllTuples()
Get all tupleslong
getBeginRow()
Return the number of the first row of the tuple source that is contained in this batch (one-based).long
getEndRow()
Return number of the last row of the tuple source that is contained in this batch (one-based).int
getRowCount()
Return the number of rows contained in this tuple batchbyte
getTermination()
boolean
getTerminationFlag()
Check whether this batch is the last in a series of batches.List<?>
getTuple(long rowIndex)
Return the tuple at the given index (one-based).List<List<?>>
getTuples()
void
setRowOffset(long rowOffset)
void
setTermination(byte val)
void
setTerminationFlag(boolean terminationFlag)
Set whether this batch is the last in a series of batches.String
toString()
Return a String describing this object
-
-
-
Field Detail
-
NOT_TERMINATED
public static final byte NOT_TERMINATED
- See Also:
- Constant Field Values
-
TERMINATED
public static final byte TERMINATED
- See Also:
- Constant Field Values
-
ITERATION_TERMINATED
public static final byte ITERATION_TERMINATED
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
TupleBatch
public TupleBatch()
Required to honor Externalizable contract
-
TupleBatch
public TupleBatch(long beginRow, List<?>[] tuples)
Constructor- Parameters:
beginRow
- indicates the row of the tuple source which is the first row contained in this batchtuples
- array of List objects, each of which is a single tuple
-
-
Method Detail
-
getBeginRow
public long getBeginRow()
Return the number of the first row of the tuple source that is contained in this batch (one-based).- Returns:
- the first row contained in this tuple batch
-
getEndRow
public long getEndRow()
Return number of the last row of the tuple source that is contained in this batch (one-based).- Returns:
- the last row contained in this tuple batch
-
getRowCount
public int getRowCount()
Return the number of rows contained in this tuple batch- Returns:
- the number of rows contained in this tuple batch
-
getTuple
public List<?> getTuple(long rowIndex)
Return the tuple at the given index (one-based).- Returns:
- the tuple at the given index
-
getAllTuples
public List<?>[] getAllTuples()
Get all tuples- Returns:
- All tuples
-
getTerminationFlag
public boolean getTerminationFlag()
Check whether this batch is the last in a series of batches.- Returns:
- True if this batch is last
-
setTerminationFlag
public void setTerminationFlag(boolean terminationFlag)
Set whether this batch is the last in a series of batches.- Parameters:
terminationFlag
- True if last
-
setTermination
public void setTermination(byte val)
-
getTermination
public byte getTermination()
-
containsRow
public boolean containsRow(long row)
-
toString
public String toString()
Return a String describing this object
-
setRowOffset
public void setRowOffset(long rowOffset)
-
-