org.teiid.common.buffer
Class TupleBuffer

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

public class TupleBuffer
extends Object


Constructor Summary
TupleBuffer(BatchManager manager, String id, List<? extends Expression> schema, LobManager lobManager, int batchSize)
           
 
Method Summary
 void addTuple(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()
           
 String getId()
           
 int getLobCount()
           
 Streamable<?> getLobReference(String id)
           
 int getManagedRowCount()
          Returns the total number of rows contained in managed batches
 int getRowCount()
          Returns the last row number
 List<? extends Expression> getSchema()
           
static String[] getTypeNames(List<? extends Expression> expressions)
          Gets the data type names for each of the input expressions, in order.
 String[] getTypes()
           
 boolean isFinal()
           
 boolean isForwardOnly()
           
 boolean isLobs()
           
 boolean isRemoved()
           
 void persistLobs()
           
 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 setId(String uuid)
           
 void setInlineLobs(boolean inline)
           
 void setPrefersMemory(boolean prefersMemory)
           
 void setRowCount(int rowCount)
           
 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,
                   String id,
                   List<? extends Expression> schema,
                   LobManager lobManager,
                   int batchSize)
Method Detail

getTypeNames

public static String[] getTypeNames(List<? extends Expression> expressions)
Gets the data type names for each of the input expressions, in order.

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

setInlineLobs

public void setInlineLobs(boolean inline)

getId

public String getId()

setId

public void setId(String uuid)

isLobs

public boolean isLobs()

addTuple

public void addTuple(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()

persistLobs

public void persistLobs()
                 throws TeiidComponentException
Throws:
TeiidComponentException

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 - TODO: a method to get the raw batch

remove

public void remove()

getManagedRowCount

public int getManagedRowCount()
Returns the total number of rows contained in managed batches

Returns:

getRowCount

public int getRowCount()
Returns the last row number

Returns:

isFinal

public boolean isFinal()

setFinal

public void setFinal(boolean isFinal)

getSchema

public List<? extends Expression> getSchema()

getBatchSize

public int getBatchSize()

setBatchSize

public void setBatchSize(int batchSize)

getLobReference

public Streamable<?> getLobReference(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 String toString()
Overrides:
toString in class Object

isRemoved

public boolean isRemoved()

isForwardOnly

public boolean isForwardOnly()

setPrefersMemory

public void setPrefersMemory(boolean prefersMemory)

getTypes

public String[] getTypes()

getLobCount

public int getLobCount()


Copyright © 2012. All Rights Reserved.