com.metamatrix.common.buffer.impl
Class TupleSourceInfo

java.lang.Object
  extended by com.metamatrix.common.buffer.impl.TupleSourceInfo

public class TupleSourceInfo
extends java.lang.Object

Describe a TupleSource and all important information about it.


Constructor Summary
TupleSourceInfo(TupleSourceID tsID, java.util.List schema, java.lang.String[] types, com.metamatrix.common.buffer.impl.TupleGroupInfo groupInfo, BufferManager.TupleSourceType type)
          Construct a TupleSourceInfo given information about it.
 
Method Summary
 void addBatch(com.metamatrix.common.buffer.impl.ManagedBatch batch)
          Add a managed batch to this tuple source
 com.metamatrix.common.buffer.impl.ManagedBatch getBatch(int beginRow)
          Get a batch, specified by beginRow
 java.util.Iterator getBatchIterator()
          Get iterator directly on the batches contained by this tuple source.
 com.metamatrix.common.buffer.impl.TupleGroupInfo getGroupInfo()
          Get group this tuple source is in.
 int getRowCount()
          Get current row count
 BufferManager.TupleSourceStatus getStatus()
          Get status of this tuple source, as defined in BufferManager constants
 java.util.List getTupleSchema()
          Get the tuple schema describing a tuple source
 TupleSourceID getTupleSourceID()
          Get the tuple source identifier
 BufferManager.TupleSourceType getType()
          Get type of this tuple source
 java.lang.String[] getTypes()
           
 boolean isRemoved()
          Check whether this tuple source has been removed.
 boolean lobsInSource()
           
 void removeBatch(int beginRow)
          Remove a managed batch for this tuple source, indexed by beginRow
 void setRemoved()
          Set a flag that this tuple source has been removed
 void setRowCount(int rows)
          Set the current row count
 void setStatus(BufferManager.TupleSourceStatus status)
          Set status of this tuple source
 java.lang.String toString()
          Get string representation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TupleSourceInfo

public TupleSourceInfo(TupleSourceID tsID,
                       java.util.List schema,
                       java.lang.String[] types,
                       com.metamatrix.common.buffer.impl.TupleGroupInfo groupInfo,
                       BufferManager.TupleSourceType type)
Construct a TupleSourceInfo given information about it.

Parameters:
tsID - Identifier
schema - Schema describing tuple source
groupInfo - The tuple gorup to which this tuple source belongs
type - Type of tuple source, as defined in BufferManager constants
Method Detail

getTupleSourceID

public TupleSourceID getTupleSourceID()
Get the tuple source identifier

Returns:
Tuple source identifier

getTupleSchema

public java.util.List getTupleSchema()
Get the tuple schema describing a tuple source

Returns:
Schema

getGroupInfo

public com.metamatrix.common.buffer.impl.TupleGroupInfo getGroupInfo()
Get group this tuple source is in. Never null

Returns:
TupleGroupInfo instance representing the tuple group to which this tuple source belongs.

getRowCount

public int getRowCount()
Get current row count

Returns:
Row count

setRowCount

public void setRowCount(int rows)
Set the current row count

Parameters:
rows - New row count

getStatus

public BufferManager.TupleSourceStatus getStatus()
Get status of this tuple source, as defined in BufferManager constants

Returns:
Status

setStatus

public void setStatus(BufferManager.TupleSourceStatus status)
Set status of this tuple source

Parameters:
status - New status

getType

public BufferManager.TupleSourceType getType()
Get type of this tuple source

Returns:
Type of tuple source

isRemoved

public boolean isRemoved()
Check whether this tuple source has been removed. Due to synchronization, this tuple source may have been removed between the time it was retrieved and now.


setRemoved

public void setRemoved()
Set a flag that this tuple source has been removed


addBatch

public void addBatch(com.metamatrix.common.buffer.impl.ManagedBatch batch)
Add a managed batch to this tuple source

Parameters:
batch - Managed batch for this tuple source

removeBatch

public void removeBatch(int beginRow)
Remove a managed batch for this tuple source, indexed by beginRow

Parameters:
beginRow - First row of batch to remove

getBatch

public com.metamatrix.common.buffer.impl.ManagedBatch getBatch(int beginRow)
Get a batch, specified by beginRow

Parameters:
beginRow - First row of batch to retrieve
Returns:
Managed batch or null if not found

lobsInSource

public boolean lobsInSource()

getBatchIterator

public java.util.Iterator getBatchIterator()
Get iterator directly on the batches contained by this tuple source. To use this safely, the user should ensure through locking that no other thread are modifying this TupleSourceInfo while the iterator is being used.

Returns:
Unsafe iterator

getTypes

public java.lang.String[] getTypes()

toString

public java.lang.String toString()
Get string representation

Overrides:
toString in class java.lang.Object
Returns:
String representation


Copyright © 2009. All Rights Reserved.