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.TupleSourceTypeDEFAULT_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()
BufferManagergetMaxProcessingSize in interface BufferManagerpublic long getReserveBatchBytes()
public int getProcessorBatchSize()
getProcessorBatchSize in interface BufferManagerpublic void setTargetBytesPerRow(int targetBytesPerRow)
public void setProcessorBatchSize(int processorBatchSize)
public TupleBuffer createTupleBuffer(List elements, String groupName, BufferManager.TupleSourceType tupleSourceType)
createTupleBuffer in interface BufferManagerpublic STree createSTree(List<? extends Expression> elements, String groupName, int keyLength)
createSTree in interface BufferManagerpublic FileStore createFileStore(String name)
BufferManagerFileStore. See FileStore#setCleanupReference(Object) to
automatically cleanup the underlying resources.createFileStore in interface BufferManagercreateFileStore in interface StorageManagerpublic long getMaxStorageSpace()
getMaxStorageSpace in interface StorageManagerpublic Cache getCache()
public void setMaxActivePlans(int maxActivePlans)
BufferManagersetMaxActivePlans in interface BufferManagerpublic void setMaxProcessingKB(int maxProcessingKB)
public void setMaxReserveKB(int maxReserveBatchKB)
public void initialize()
throws TeiidComponentException
initialize in interface StorageManagerTeiidComponentExceptionpublic void releaseOrphanedBuffers(long count)
releaseOrphanedBuffers in interface BufferManagerpublic void releaseBuffers(int count)
BufferManagerBufferManager#reserveBuffers(int, boolean)releaseBuffers in interface BufferManagerpublic int reserveBuffers(int count,
BufferManager.BufferReserveMode mode)
BufferManagerreserveBuffers in interface BufferManagerpublic int reserveBuffersBlocking(int count,
long[] val,
boolean force)
throws BlockedException
reserveBuffersBlocking in interface BufferManagerBlockedExceptionpublic int getProcessorBatchSize(List<? extends Expression> schema)
BufferManagergetProcessorBatchSize in interface BufferManagerpublic int getSchemaSize(List<? extends Expression> elements)
BufferManagergetSchemaSize in interface BufferManagerpublic void shutdown()
public void addTupleBuffer(TupleBuffer tb)
addTupleBuffer in interface BufferManagerpublic void distributeTupleBuffer(String uuid, TupleBuffer tb)
distributeTupleBuffer in interface TupleBufferCachepublic TupleBuffer getTupleBuffer(String id)
getTupleBuffer in interface TupleBufferCachepublic void setUseWeakReferences(boolean useWeakReferences)
public void getState(OutputStream ostream)
ReplicatedObjectgetState in interface ReplicatedObject<String>ostream - the OutputStreampublic void getState(String state_id, OutputStream ostream)
ReplicatedObjectgetState in interface ReplicatedObject<String>state_id - id of the partial state requestedostream - the OutputStreampublic void setState(InputStream istream)
ReplicatedObjectsetState in interface ReplicatedObject<String>istream - the InputStreampublic void setState(String state_id, InputStream istream)
ReplicatedObjectsetState in interface ReplicatedObject<String>state_id - id of the partial state requestedistream - the InputStreampublic void setAddress(Serializable address)
ReplicatedObjectsetAddress in interface ReplicatedObject<String>public void droppedMembers(Collection<Serializable> addresses)
ReplicatedObjectdroppedMembers 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)
ReplicatedObjecthasState in interface ReplicatedObject<String>public long getReferenceHits()
public void persistLob(Streamable<?> lob, FileStore store, byte[] bytes) throws TeiidComponentException
persistLob in interface BufferManagerTeiidComponentExceptionpublic void invalidCacheGroup(Long gid)
public void setOptions(Options options)
setOptions in interface BufferManagerpublic Options getOptions()
getOptions in interface BufferManagerpublic void setStorageManager(StorageManager ssm)
public void setMaxSessionBatchManagerSizeEstimate(long maxSessionBatchManagerSizeEstimate)
Copyright © 2018 JBoss by Red Hat. All rights reserved.