org.teiid.common.buffer
Class TupleBuffer

java.lang.Object
  extended by org.teiid.common.buffer.TupleBuffer

public class TupleBuffer
extends java.lang.Object


Constructor Summary
TupleBuffer(BatchManager manager, java.lang.String id, java.util.List<?> schema, int[] lobIndexes, int batchSize)
           
 
Method Summary
 void addTuple(java.util.List<?> tuple)
           
 void addTupleBatch(TupleBatch batch, boolean save)
          Adds the given batch preserving row offsets.
 void close()
           
 IndexedTupleSource createIndexedTupleSource()
           
 IndexedTupleSource createIndexedTupleSource(boolean singleUse)
          Create a new iterator for this buffer
 TupleBatch getBatch(int row)
          Get the batch containing the given row.
 int getBatchSize()
           
 java.lang.String getId()
           
 Streamable<?> getLobReference(java.lang.String id)
           
 int getRowCount()
           
 java.util.List<?> getSchema()
           
static java.lang.String[] getTypeNames(java.util.List expressions)
          Gets the data type names for each of the input expressions, in order.
 boolean isFinal()
           
 boolean isForwardOnly()
           
 boolean isLobs()
           
 boolean isPrefersMemory()
           
 boolean isRemoved()
           
 void purge()
           
 void remove()
           
 void saveBatch()
          Force the persistence of any rows held in memory.
 void setBatchSize(int batchSize)
           
 void setFinal(boolean isFinal)
           
 void setForwardOnly(boolean forwardOnly)
           
 void setPrefersMemory(boolean prefersMemory)
           
 void setRowCount(int rowCount)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TupleBuffer

public TupleBuffer(BatchManager manager,
                   java.lang.String id,
                   java.util.List<?> schema,
                   int[] lobIndexes,
                   int batchSize)
Method Detail

getTypeNames

public static java.lang.String[] getTypeNames(java.util.List expressions)
Gets the data type names for each of the input expressions, in order.

Parameters:
expressions - List of Expressions
Returns:
Since:
4.2

getId

public java.lang.String getId()

isLobs

public boolean isLobs()

addTuple

public void addTuple(java.util.List<?> tuple)
              throws TeiidComponentException
Throws:
TeiidComponentException

addTupleBatch

public void addTupleBatch(TupleBatch batch,
                          boolean save)
                   throws TeiidComponentException
Adds the given batch preserving row offsets.

Parameters:
batch -
Throws:
TeiidComponentException

setRowCount

public void setRowCount(int rowCount)
                 throws TeiidComponentException
Throws:
TeiidComponentException

purge

public void purge()

saveBatch

public void saveBatch()
               throws TeiidComponentException
Force the persistence of any rows held in memory.

Throws:
TeiidComponentException

close

public void close()
           throws TeiidComponentException
Throws:
TeiidComponentException

getBatch

public TupleBatch getBatch(int row)
                    throws TeiidComponentException
Get the batch containing the given row. NOTE: the returned batch may be empty or may begin with a row other than the one specified.

Parameters:
row -
Returns:
Throws:
TeiidComponentException

remove

public void remove()

getRowCount

public int getRowCount()

isFinal

public boolean isFinal()

setFinal

public void setFinal(boolean isFinal)

getSchema

public java.util.List<?> getSchema()

getBatchSize

public int getBatchSize()

setBatchSize

public void setBatchSize(int batchSize)

getLobReference

public Streamable<?> getLobReference(java.lang.String id)
                              throws TeiidComponentException
Throws:
TeiidComponentException

setForwardOnly

public void setForwardOnly(boolean forwardOnly)

createIndexedTupleSource

public IndexedTupleSource createIndexedTupleSource()

createIndexedTupleSource

public IndexedTupleSource createIndexedTupleSource(boolean singleUse)
Create a new iterator for this buffer

Returns:

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

isRemoved

public boolean isRemoved()

isForwardOnly

public boolean isForwardOnly()

setPrefersMemory

public void setPrefersMemory(boolean prefersMemory)

isPrefersMemory

public boolean isPrefersMemory()


Copyright © 2010. All Rights Reserved.