org.teiid.common.buffer
Interface BufferManager

All Superinterfaces:
StorageManager
All Known Implementing Classes:
BufferManagerImpl

public interface BufferManager
extends StorageManager

The buffer manager controls how memory is used and how data flows through the system. It uses storage managers to retrieve data, store data, and transfer data. The buffer manager has algorithms that tell it when and how to store data. The buffer manager should also be aware of memory management issues.


Nested Class Summary
static class BufferManager.BufferReserveMode
           
static class BufferManager.TupleSourceType
           
 
Field Summary
static int DEFAULT_CONNECTOR_BATCH_SIZE
           
static int DEFAULT_MAX_PROCESSING_BATCHES
           
static int DEFAULT_PROCESSOR_BATCH_SIZE
           
static int DEFAULT_RESERVE_BUFFERS
           
 
Method Summary
 void addTupleBuffer(TupleBuffer tb)
           
 FileStore createFileStore(java.lang.String name)
          Creates a new FileStore.
 STree createSTree(java.util.List elements, java.lang.String groupName, int keyLength)
           
 TupleBuffer createTupleBuffer(java.util.List elements, java.lang.String groupName, BufferManager.TupleSourceType tupleSourceType)
           
 int getConnectorBatchSize()
          Get the batch size to use when reading data from a connector.
 int getMaxProcessingKB()
          Return the maximum KB that can be temporarily held potentially across even a blocked exception.
 int getProcessorBatchSize()
          Get the batch size to use during query processing.
 int getSchemaSize(java.util.List<? extends Expression> elements)
          Get the size estimate in KB for the given schema.
 TupleBuffer getTupleBuffer(java.lang.String id)
           
 void releaseBuffers(int count)
          Releases the buffers reserved by a call to BufferManager#reserveBuffers(int, boolean)
 int reserveBuffers(int count, BufferManager.BufferReserveMode mode)
          Reserve up to count buffers for use.
 void setMaxActivePlans(int maxActivePlans)
          Set the maxActivePlans as a hint at determining the maxProcessingKB
 
Methods inherited from interface org.teiid.common.buffer.StorageManager
initialize
 

Field Detail

DEFAULT_CONNECTOR_BATCH_SIZE

static final int DEFAULT_CONNECTOR_BATCH_SIZE
See Also:
Constant Field Values

DEFAULT_PROCESSOR_BATCH_SIZE

static final int DEFAULT_PROCESSOR_BATCH_SIZE
See Also:
Constant Field Values

DEFAULT_MAX_PROCESSING_BATCHES

static final int DEFAULT_MAX_PROCESSING_BATCHES
See Also:
Constant Field Values

DEFAULT_RESERVE_BUFFERS

static final int DEFAULT_RESERVE_BUFFERS
See Also:
Constant Field Values
Method Detail

getProcessorBatchSize

int getProcessorBatchSize()
Get the batch size to use during query processing.

Returns:
Batch size (# of rows)

getConnectorBatchSize

int getConnectorBatchSize()
Get the batch size to use when reading data from a connector.

Returns:
Batch size (# of rows)

createTupleBuffer

TupleBuffer createTupleBuffer(java.util.List elements,
                              java.lang.String groupName,
                              BufferManager.TupleSourceType tupleSourceType)
                              throws TeiidComponentException
Throws:
TeiidComponentException

getMaxProcessingKB

int getMaxProcessingKB()
Return the maximum KB that can be temporarily held potentially across even a blocked exception.

Returns:

createFileStore

FileStore createFileStore(java.lang.String name)
Creates a new FileStore. See FileStore.setCleanupReference(Object) to automatically cleanup the underlying resources.

Specified by:
createFileStore in interface StorageManager
Parameters:
name -
Returns:

reserveBuffers

int reserveBuffers(int count,
                   BufferManager.BufferReserveMode mode)
Reserve up to count buffers for use.

Parameters:
count -
mode -
Returns:

releaseBuffers

void releaseBuffers(int count)
Releases the buffers reserved by a call to BufferManager#reserveBuffers(int, boolean)

Parameters:
count -

getSchemaSize

int getSchemaSize(java.util.List<? extends Expression> elements)
Get the size estimate in KB for the given schema.


createSTree

STree createSTree(java.util.List elements,
                  java.lang.String groupName,
                  int keyLength)

addTupleBuffer

void addTupleBuffer(TupleBuffer tb)

getTupleBuffer

TupleBuffer getTupleBuffer(java.lang.String id)

setMaxActivePlans

void setMaxActivePlans(int maxActivePlans)
Set the maxActivePlans as a hint at determining the maxProcessingKB

Parameters:
maxActivePlans -


Copyright © 2011. All Rights Reserved.