Package org.teiid.common.buffer
Interface BufferManager
-
- All Superinterfaces:
StorageManager,TupleBufferCache
- All Known Implementing Classes:
BufferManagerImpl
public interface BufferManager extends StorageManager, TupleBufferCache
The buffer manager controls how memory is used and how data flows through the system. It usesstorage managersto 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
Nested Classes Modifier and Type Interface Description static classBufferManager.BufferReserveModestatic classBufferManager.TupleSourceType
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_MAX_PROCESSING_KBstatic intDEFAULT_PROCESSOR_BATCH_SIZEstatic intDEFAULT_RESERVE_BUFFER_KB
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddTupleBuffer(TupleBuffer tb)FileStorecreateFileStore(String name)Creates a newFileStore.STreecreateSTree(List<? extends Expression> elements, String groupName, int keyLength)TupleBuffercreateTupleBuffer(List elements, String groupName, BufferManager.TupleSourceType tupleSourceType)intgetMaxProcessingSize()Return the max that can be temporarily held potentially across even a blocked exception.OptionsgetOptions()intgetProcessorBatchSize()Get the nominal batch size targetintgetProcessorBatchSize(List<? extends Expression> schema)Get the batch size to use during query processing.intgetSchemaSize(List<? extends Expression> elements)Get the size estimate for the given schema.voidpersistLob(Streamable<?> lob, FileStore store, byte[] bytes)voidreleaseBuffers(int count)Releases the buffers reserved by a call toreserveBuffers(int, BufferReserveMode)voidreleaseOrphanedBuffers(long count)intreserveBuffers(int count, BufferManager.BufferReserveMode mode)Reserve up to count buffers for use.intreserveBuffersBlocking(int count, long[] attempts, boolean force)voidsetMaxActivePlans(int maxActivePlans)Set the maxActivePlans as a hint at determining the maxProcessingvoidsetOptions(Options options)-
Methods inherited from interface org.teiid.common.buffer.StorageManager
getMaxStorageSpace, initialize
-
Methods inherited from interface org.teiid.common.buffer.TupleBufferCache
distributeTupleBuffer, getTupleBuffer
-
-
-
-
Field Detail
-
DEFAULT_PROCESSOR_BATCH_SIZE
static final int DEFAULT_PROCESSOR_BATCH_SIZE
- See Also:
- Constant Field Values
-
DEFAULT_MAX_PROCESSING_KB
static final int DEFAULT_MAX_PROCESSING_KB
- See Also:
- Constant Field Values
-
DEFAULT_RESERVE_BUFFER_KB
static final int DEFAULT_RESERVE_BUFFER_KB
- See Also:
- Constant Field Values
-
-
Method Detail
-
getProcessorBatchSize
int getProcessorBatchSize(List<? extends Expression> schema)
Get the batch size to use during query processing.- Returns:
- Batch size (# of rows)
-
getProcessorBatchSize
int getProcessorBatchSize()
Get the nominal batch size target- Returns:
-
createTupleBuffer
TupleBuffer createTupleBuffer(List elements, String groupName, BufferManager.TupleSourceType tupleSourceType) throws TeiidComponentException
- Throws:
TeiidComponentException
-
getMaxProcessingSize
int getMaxProcessingSize()
Return the max that can be temporarily held potentially across even a blocked exception.- Returns:
-
createFileStore
FileStore createFileStore(String name)
Creates a newFileStore.- Specified by:
createFileStorein interfaceStorageManager- 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 toreserveBuffers(int, BufferReserveMode)- Parameters:
count-
-
getSchemaSize
int getSchemaSize(List<? extends Expression> elements)
Get the size estimate for the given schema.
-
createSTree
STree createSTree(List<? extends Expression> elements, String groupName, int keyLength)
-
addTupleBuffer
void addTupleBuffer(TupleBuffer tb)
-
setMaxActivePlans
void setMaxActivePlans(int maxActivePlans)
Set the maxActivePlans as a hint at determining the maxProcessing- Parameters:
maxActivePlans-
-
setOptions
void setOptions(Options options)
-
persistLob
void persistLob(Streamable<?> lob, FileStore store, byte[] bytes) throws TeiidComponentException
- Throws:
TeiidComponentException
-
reserveBuffersBlocking
int reserveBuffersBlocking(int count, long[] attempts, boolean force) throws BlockedException- Throws:
BlockedException
-
releaseOrphanedBuffers
void releaseOrphanedBuffers(long count)
-
getOptions
Options getOptions()
-
-