public class BufferManagerImpl extends Object implements BufferManager, ReplicatedObject<String>
Default implementation of BufferManager.
Responsible for creating/tracking TupleBuffers and providing access to the StorageManager. TODO: add detection of pinned batches to prevent unnecessary purging of non-persistent batches - this is not necessary for already persistent batches, since we hold a weak reference TODO: add a pre-fetch for tuplebuffers or some built-in correlation logic with the queue.BufferManager.BufferReserveMode, BufferManager.TupleSourceType
DEFAULT_MAX_PROCESSING_KB, DEFAULT_PROCESSOR_BATCH_SIZE, DEFAULT_RESERVE_BUFFER_KB
Constructor and Description |
---|
BufferManagerImpl() |
BufferManagerImpl(boolean sharedTimer) |
Modifier and Type | Method and Description |
---|---|
void |
addTupleBuffer(TupleBuffer tb) |
FileStore |
createFileStore(String name)
Creates a new
FileStore . |
STree |
createSTree(List<? extends Expression> elements,
String groupName,
int keyLength) |
TupleBuffer |
createTupleBuffer(List elements,
String groupName,
BufferManager.TupleSourceType tupleSourceType) |
void |
distributeTupleBuffer(String uuid,
TupleBuffer tb) |
void |
droppedMembers(Collection<Serializable> addresses)
Called when members are dropped
|
long |
getActiveBatchBytes() |
long |
getBatchesAdded() |
Cache |
getCache() |
int |
getMaxProcessingSize()
Return the max that can be temporarily held potentially
across even a blocked exception.
|
int |
getMaxReserveKB() |
long |
getMaxStorageSpace() |
int |
getMemoryCacheEntries() |
Options |
getOptions() |
int |
getProcessorBatchSize()
Get processor batch size
|
int |
getProcessorBatchSize(List<? extends Expression> schema)
Get the batch size to use during query processing.
|
long |
getReadAttempts() |
long |
getReadCount() |
long |
getReferenceHits() |
long |
getReserveBatchBytes() |
int |
getSchemaSize(List<? extends Expression> elements)
Get the size estimate for the given schema.
|
void |
getState(OutputStream ostream)
Allows an application to write a state through a provided OutputStream.
|
void |
getState(String state_id,
OutputStream ostream)
Allows an application to write a partial state through a provided OutputStream.
|
TupleBuffer |
getTupleBuffer(String id) |
long |
getWriteCount() |
boolean |
hasState(String stateId)
Return true if the object has the given state
|
void |
initialize() |
void |
invalidCacheGroup(Long gid) |
void |
persistLob(Streamable<?> lob,
FileStore store,
byte[] bytes) |
void |
releaseBuffers(int count)
Releases the buffers reserved by a call to
BufferManager#reserveBuffers(int, boolean) |
void |
releaseOrphanedBuffers(long count) |
int |
reserveBuffers(int count,
BufferManager.BufferReserveMode mode)
Reserve up to count buffers for use.
|
int |
reserveBuffersBlocking(int count,
long[] val,
boolean force) |
void |
setAddress(Serializable address)
Allows the replicator to set the local address from the channel
|
void |
setCache(Cache cache) |
void |
setInlineLobs(boolean inlineLobs) |
void |
setMaxActivePlans(int maxActivePlans)
Set the maxActivePlans as a hint at determining the maxProcessing
|
void |
setMaxProcessingKB(int maxProcessingKB) |
void |
setMaxReserveKB(int maxReserveBatchKB) |
void |
setMaxSessionBatchManagerSizeEstimate(long maxSessionBatchManagerSizeEstimate) |
void |
setOptions(Options options) |
void |
setProcessorBatchSize(int processorBatchSize) |
void |
setState(InputStream istream)
Allows an application to read a state through a provided InputStream.
|
void |
setState(String state_id,
InputStream istream)
Allows an application to read a partial state through a provided InputStream.
|
void |
setStorageManager(StorageManager ssm) |
void |
setTargetBytesPerRow(int targetBytesPerRow) |
void |
setUseWeakReferences(boolean useWeakReferences) |
void |
shutdown() |
public BufferManagerImpl()
public BufferManagerImpl(boolean sharedTimer)
public long getBatchesAdded()
public long getReadCount()
public long getWriteCount()
public long getReadAttempts()
public int getMaxProcessingSize()
BufferManager
getMaxProcessingSize
in interface BufferManager
public long getReserveBatchBytes()
public int getProcessorBatchSize()
getProcessorBatchSize
in interface BufferManager
public void setTargetBytesPerRow(int targetBytesPerRow)
public void setProcessorBatchSize(int processorBatchSize)
public TupleBuffer createTupleBuffer(List elements, String groupName, BufferManager.TupleSourceType tupleSourceType)
createTupleBuffer
in interface BufferManager
public STree createSTree(List<? extends Expression> elements, String groupName, int keyLength)
createSTree
in interface BufferManager
public FileStore createFileStore(String name)
BufferManager
FileStore
. See FileStore#setCleanupReference(Object)
to
automatically cleanup the underlying resources.createFileStore
in interface BufferManager
createFileStore
in interface StorageManager
public long getMaxStorageSpace()
getMaxStorageSpace
in interface StorageManager
public Cache getCache()
public void setMaxActivePlans(int maxActivePlans)
BufferManager
setMaxActivePlans
in interface BufferManager
public void setMaxProcessingKB(int maxProcessingKB)
public void setMaxReserveKB(int maxReserveBatchKB)
public void initialize() throws TeiidComponentException
initialize
in interface StorageManager
TeiidComponentException
public void releaseOrphanedBuffers(long count)
releaseOrphanedBuffers
in interface BufferManager
public void releaseBuffers(int count)
BufferManager
BufferManager#reserveBuffers(int, boolean)
releaseBuffers
in interface BufferManager
public int reserveBuffers(int count, BufferManager.BufferReserveMode mode)
BufferManager
reserveBuffers
in interface BufferManager
public int reserveBuffersBlocking(int count, long[] val, boolean force) throws BlockedException
reserveBuffersBlocking
in interface BufferManager
BlockedException
public int getProcessorBatchSize(List<? extends Expression> schema)
BufferManager
getProcessorBatchSize
in interface BufferManager
public int getSchemaSize(List<? extends Expression> elements)
BufferManager
getSchemaSize
in interface BufferManager
public void shutdown()
public void addTupleBuffer(TupleBuffer tb)
addTupleBuffer
in interface BufferManager
public void distributeTupleBuffer(String uuid, TupleBuffer tb)
distributeTupleBuffer
in interface TupleBufferCache
public TupleBuffer getTupleBuffer(String id)
getTupleBuffer
in interface TupleBufferCache
public void setUseWeakReferences(boolean useWeakReferences)
public void getState(OutputStream ostream)
ReplicatedObject
getState
in interface ReplicatedObject<String>
ostream
- the OutputStreampublic void getState(String state_id, OutputStream ostream)
ReplicatedObject
getState
in interface ReplicatedObject<String>
state_id
- id of the partial state requestedostream
- the OutputStreampublic void setState(InputStream istream)
ReplicatedObject
setState
in interface ReplicatedObject<String>
istream
- the InputStreampublic void setState(String state_id, InputStream istream)
ReplicatedObject
setState
in interface ReplicatedObject<String>
state_id
- id of the partial state requestedistream
- the InputStreampublic void setAddress(Serializable address)
ReplicatedObject
setAddress
in interface ReplicatedObject<String>
public void droppedMembers(Collection<Serializable> addresses)
ReplicatedObject
droppedMembers
in interface ReplicatedObject<String>
public void setInlineLobs(boolean inlineLobs)
public int getMaxReserveKB()
public void setCache(Cache cache)
public int getMemoryCacheEntries()
public long getActiveBatchBytes()
public boolean hasState(String stateId)
ReplicatedObject
hasState
in interface ReplicatedObject<String>
public long getReferenceHits()
public void persistLob(Streamable<?> lob, FileStore store, byte[] bytes) throws TeiidComponentException
persistLob
in interface BufferManager
TeiidComponentException
public void invalidCacheGroup(Long gid)
public void setOptions(Options options)
setOptions
in interface BufferManager
public Options getOptions()
getOptions
in interface BufferManager
public void setStorageManager(StorageManager ssm)
public void setMaxSessionBatchManagerSizeEstimate(long maxSessionBatchManagerSizeEstimate)
Copyright © 2018 JBoss by Red Hat. All rights reserved.