|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.metamatrix.common.buffer.impl.BufferManagerImpl
public class BufferManagerImpl
Default implementation of BufferManager. This buffer manager implementation assumes the usage of a StorageManager of type memory and optionally (preferred) an additional StorageManager of type FILE.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.metamatrix.common.buffer.BufferManager |
|---|
BufferManager.TupleSourceStatus, BufferManager.TupleSourceType |
| Constructor Summary | |
|---|---|
BufferManagerImpl()
|
|
| Method Summary | |
|---|---|
void |
addStreamablePart(TupleSourceID tupleSourceID,
LobChunk streamChunk,
int beginRow)
Add a streamable object to the persistent store. |
void |
addTupleBatch(TupleSourceID tupleSourceID,
TupleBatch tupleBatch)
Add a batch to the given tuple source. |
protected void |
clean(long memoryRequired,
com.metamatrix.common.buffer.impl.TupleGroupInfo targetGroupInfo)
This can be done actively if someone wants memory and none is free. |
TupleSourceID |
createTupleSource(java.util.List schema,
java.lang.String[] types,
java.lang.String groupName,
BufferManager.TupleSourceType tupleSourceType)
Register a new tuple source and return a unique ID for it. |
BufferConfig |
getConfig()
Get the configuration of the buffer manager |
int |
getConnectorBatchSize()
Get connector batch size |
int |
getFinalRowCount(TupleSourceID tupleSourceID)
Gets the final row count if tuple source is FULL, otherwise returns -1. |
int |
getPinnedCount()
for testing purposes |
int |
getProcessorBatchSize()
Get processor batch size |
int |
getRowCount(TupleSourceID tupleSourceID)
Get the row count for a particular tuple source |
BufferStats |
getStats()
Construct a BufferStats object by looking at all the state. |
BufferManager.TupleSourceStatus |
getStatus(TupleSourceID tupleSourceID)
Get the status for a particular tuple source |
Streamable<?> |
getStreamable(TupleSourceID id,
java.lang.String referenceId)
Return the LOB associated with the referenceId |
LobChunk |
getStreamablePart(TupleSourceID tupleSourceID,
int beginRow)
Returns the streamable batch object's part stored with specified identifier |
java.util.List |
getTupleSchema(TupleSourceID tupleSourceID)
Get the tuple schema for a particular tuple source |
IndexedTupleSource |
getTupleSource(TupleSourceID tupleSourceID)
Get a tuple source to walk through the rows for a particular tupleSourceID. |
void |
initialize(java.lang.String lookup,
java.util.Properties properties)
See BufferManagerPropertyNames for a
description of all the properties. |
TupleBatch |
pinTupleBatch(TupleSourceID tupleSourceID,
int beginRow)
Pin a tuple batch in memory and return it. |
void |
releasePinnedBatches()
Release batches that have been pinned by this thread. |
void |
removeTupleSource(TupleSourceID tupleSourceID)
Remove a tuple source based on ID |
void |
removeTupleSources(java.lang.String groupName)
Remove all the tuple sources with the specified group name. |
void |
setPersistentTupleSource(TupleSourceID id,
Streamable<?> s)
Assign the TupleSource as the persistent stream for the Streamable |
void |
setStatus(TupleSourceID tupleSourceID,
BufferManager.TupleSourceStatus status)
Set the status for a particular tuple source |
void |
setStorageManager(StorageManager storageManager)
Add a storage manager to this buffer manager, order is unimportant |
void |
stop()
|
void |
unpinTupleBatch(TupleSourceID tupleSourceID,
int beginRow)
Unpin a tuple source batch. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BufferManagerImpl()
| Method Detail |
|---|
public void initialize(java.lang.String lookup,
java.util.Properties properties)
throws MetaMatrixComponentException
BufferManagerPropertyNames for a
description of all the properties.
initialize in interface BufferManagerlookup - An object telling the buffer manager what his location is and
how to find other buffer managers of different locationsproperties - Properties to configure the buffer manager
MetaMatrixComponentExceptionpublic BufferConfig getConfig()
public BufferStats getStats()
public int getProcessorBatchSize()
getProcessorBatchSize in interface BufferManagerpublic int getConnectorBatchSize()
getConnectorBatchSize in interface BufferManagerpublic void setStorageManager(StorageManager storageManager)
setStorageManager in interface BufferManagerstorageManager - Storage manager to add
public TupleSourceID createTupleSource(java.util.List schema,
java.lang.String[] types,
java.lang.String groupName,
BufferManager.TupleSourceType tupleSourceType)
throws MetaMatrixComponentException
createTupleSource in interface BufferManagerschema - List of ElementSymbolgroupName - Group nametupleSourceType - Type of tuple source as defined in BufferManager constants
MetaMatrixComponentException - If internal server error occurs
public void removeTupleSource(TupleSourceID tupleSourceID)
throws TupleSourceNotFoundException,
MetaMatrixComponentException
removeTupleSource in interface BufferManagertupleSourceID - Tuple source identifier
TupleSourceNotFoundException - If tuple source not found
MetaMatrixComponentException - If internal server error occurs
public void removeTupleSources(java.lang.String groupName)
throws MetaMatrixComponentException
removeTupleSources in interface BufferManagergroupName - Name of the group
MetaMatrixComponentException - If internal server error occurs
public IndexedTupleSource getTupleSource(TupleSourceID tupleSourceID)
throws TupleSourceNotFoundException,
MetaMatrixComponentException
getTupleSource in interface BufferManagertupleSourceID - Tuple source identifier
TupleSourceNotFoundException - If tuple source not found
MetaMatrixComponentException - If an internal server error occurred
public java.util.List getTupleSchema(TupleSourceID tupleSourceID)
throws TupleSourceNotFoundException,
MetaMatrixComponentException
getTupleSchema in interface BufferManagertupleSourceID - Tuple source identifier
TupleSourceNotFoundException - If tuple source not found
MetaMatrixComponentException - If an internal server error occurred
public void setStatus(TupleSourceID tupleSourceID,
BufferManager.TupleSourceStatus status)
throws TupleSourceNotFoundException,
MetaMatrixComponentException
setStatus in interface BufferManagertupleSourceID - Tuple source identifierstatus - New status
TupleSourceNotFoundException - If tuple source not found
MetaMatrixComponentException - If an internal server error occurredBufferManager.TupleSourceStatus.ACTIVE,
BufferManager.TupleSourceStatus.FULL
public BufferManager.TupleSourceStatus getStatus(TupleSourceID tupleSourceID)
throws TupleSourceNotFoundException,
MetaMatrixComponentException
getStatus in interface BufferManagertupleSourceID - Tuple source identifier
TupleSourceNotFoundException - If tuple source not found
MetaMatrixComponentException - If an internal server error occurredBufferManager.TupleSourceStatus.ACTIVE,
BufferManager.TupleSourceStatus.FULL
public int getRowCount(TupleSourceID tupleSourceID)
throws TupleSourceNotFoundException,
MetaMatrixComponentException
getRowCount in interface BufferManagertupleSourceID - Tuple source identifier
TupleSourceNotFoundException - If tuple source not found
MetaMatrixComponentException - If an internal server error occurred
public void addTupleBatch(TupleSourceID tupleSourceID,
TupleBatch tupleBatch)
throws TupleSourceNotFoundException,
MetaMatrixComponentException
addTupleBatch in interface BufferManagertupleSourceID - Tuple source identifiertupleBatch - New batch
TupleSourceNotFoundException - If tuple source not found
MetaMatrixComponentException - If an internal server error occurred
public TupleBatch pinTupleBatch(TupleSourceID tupleSourceID,
int beginRow)
throws TupleSourceNotFoundException,
MemoryNotAvailableException,
MetaMatrixComponentException
TupleBatch will have the exact same bounds as the ManagedBatch
pinTupleBatch in interface BufferManagertupleSourceID - Tuple source identifierbeginRow - Beginning row
TupleSourceNotFoundException - If tuple source not found
MetaMatrixComponentException - If an internal server error occurred
MemoryNotAvailableException - If memory was not available for the pin
public void unpinTupleBatch(TupleSourceID tupleSourceID,
int beginRow)
throws TupleSourceNotFoundException,
MetaMatrixComponentException
unpinTupleBatch in interface BufferManagertupleSourceID - Tuple source identifierbeginRow - Beginning row
TupleSourceNotFoundException - If tuple source not found
MetaMatrixComponentException - If an internal server error occurred
public int getFinalRowCount(TupleSourceID tupleSourceID)
throws TupleSourceNotFoundException,
MetaMatrixComponentException
getFinalRowCount in interface BufferManagertupleSourceID - Tuple source identifier
TupleSourceNotFoundException - If tuple source not found
MetaMatrixComponentException - If an internal server error occurred
protected void clean(long memoryRequired,
com.metamatrix.common.buffer.impl.TupleGroupInfo targetGroupInfo)
public void stop()
stop in interface BufferManagerBufferManager.stop()
public Streamable<?> getStreamable(TupleSourceID id,
java.lang.String referenceId)
throws TupleSourceNotFoundException,
MetaMatrixComponentException
BufferManager
getStreamable in interface BufferManagerTupleSourceNotFoundException
MetaMatrixComponentException
public void setPersistentTupleSource(TupleSourceID id,
Streamable<?> s)
throws TupleSourceNotFoundException
BufferManagerTupleSource as the persistent stream for the Streamable
setPersistentTupleSource in interface BufferManagerTupleSourceNotFoundException
public void addStreamablePart(TupleSourceID tupleSourceID,
LobChunk streamChunk,
int beginRow)
throws TupleSourceNotFoundException,
MetaMatrixComponentException
BufferManager
addStreamablePart in interface BufferManagerstreamChunk - part of the stream
TupleSourceNotFoundException
MetaMatrixComponentExceptionBufferManager.addStreamablePart(com.metamatrix.common.buffer.TupleSourceID, com.metamatrix.common.lob.LobChunk, int)
public LobChunk getStreamablePart(TupleSourceID tupleSourceID,
int beginRow)
throws TupleSourceNotFoundException,
MetaMatrixComponentException
BufferManager
getStreamablePart in interface BufferManagertupleSourceID - - identifier
TupleSourceNotFoundException
MetaMatrixComponentExceptioncom.metamatrix.common.buffer.BufferManager#getStreamable(com.metamatrix.common.buffer.TupleSourceID)
public void releasePinnedBatches()
throws MetaMatrixComponentException
BufferManager
releasePinnedBatches in interface BufferManagerMetaMatrixComponentExceptionBufferManager.releasePinnedBatches()public int getPinnedCount()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||