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 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
Nested Classes Modifier and Type Interface Description static class
BufferManager.BufferReserveMode
static class
BufferManager.TupleSourceType
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_MAX_PROCESSING_KB
static int
DEFAULT_PROCESSOR_BATCH_SIZE
static int
DEFAULT_RESERVE_BUFFER_KB
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addTupleBuffer(TupleBuffer tb)
FileStore
createFileStore(String name)
Creates a newFileStore
.STree
createSTree(List<? extends Expression> elements, String groupName, int keyLength)
TupleBuffer
createTupleBuffer(List elements, String groupName, BufferManager.TupleSourceType tupleSourceType)
int
getMaxProcessingSize()
Return the max that can be temporarily held potentially across even a blocked exception.Options
getOptions()
int
getProcessorBatchSize()
Get the nominal batch size targetint
getProcessorBatchSize(List<? extends Expression> schema)
Get the batch size to use during query processing.int
getSchemaSize(List<? extends Expression> elements)
Get the size estimate for the given schema.void
persistLob(Streamable<?> lob, FileStore store, byte[] bytes)
void
releaseBuffers(int count)
Releases the buffers reserved by a call toreserveBuffers(int, BufferReserveMode)
void
releaseOrphanedBuffers(long count)
int
reserveBuffers(int count, BufferManager.BufferReserveMode mode)
Reserve up to count buffers for use.int
reserveBuffersBlocking(int count, long[] attempts, boolean force)
void
setMaxActivePlans(int maxActivePlans)
Set the maxActivePlans as a hint at determining the maxProcessingvoid
setOptions(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:
createFileStore
in 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()
-
-