|
||||||||||
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 BufferManager
lookup
- 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
MetaMatrixComponentException
public BufferConfig getConfig()
public BufferStats getStats()
public int getProcessorBatchSize()
getProcessorBatchSize
in interface BufferManager
public int getConnectorBatchSize()
getConnectorBatchSize
in interface BufferManager
public void setStorageManager(StorageManager storageManager)
setStorageManager
in interface BufferManager
storageManager
- Storage manager to addpublic TupleSourceID createTupleSource(java.util.List schema, java.lang.String[] types, java.lang.String groupName, BufferManager.TupleSourceType tupleSourceType) throws MetaMatrixComponentException
createTupleSource
in interface BufferManager
schema
- List of ElementSymbolgroupName
- Group nametupleSourceType
- Type of tuple source as defined in BufferManager constants
MetaMatrixComponentException
- If internal server error occurspublic void removeTupleSource(TupleSourceID tupleSourceID) throws TupleSourceNotFoundException, MetaMatrixComponentException
removeTupleSource
in interface BufferManager
tupleSourceID
- Tuple source identifier
TupleSourceNotFoundException
- If tuple source not found
MetaMatrixComponentException
- If internal server error occurspublic void removeTupleSources(java.lang.String groupName) throws MetaMatrixComponentException
removeTupleSources
in interface BufferManager
groupName
- Name of the group
MetaMatrixComponentException
- If internal server error occurspublic IndexedTupleSource getTupleSource(TupleSourceID tupleSourceID) throws TupleSourceNotFoundException, MetaMatrixComponentException
getTupleSource
in interface BufferManager
tupleSourceID
- Tuple source identifier
TupleSourceNotFoundException
- If tuple source not found
MetaMatrixComponentException
- If an internal server error occurredpublic java.util.List getTupleSchema(TupleSourceID tupleSourceID) throws TupleSourceNotFoundException, MetaMatrixComponentException
getTupleSchema
in interface BufferManager
tupleSourceID
- Tuple source identifier
TupleSourceNotFoundException
- If tuple source not found
MetaMatrixComponentException
- If an internal server error occurredpublic void setStatus(TupleSourceID tupleSourceID, BufferManager.TupleSourceStatus status) throws TupleSourceNotFoundException, MetaMatrixComponentException
setStatus
in interface BufferManager
tupleSourceID
- 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 BufferManager
tupleSourceID
- 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 BufferManager
tupleSourceID
- Tuple source identifier
TupleSourceNotFoundException
- If tuple source not found
MetaMatrixComponentException
- If an internal server error occurredpublic void addTupleBatch(TupleSourceID tupleSourceID, TupleBatch tupleBatch) throws TupleSourceNotFoundException, MetaMatrixComponentException
addTupleBatch
in interface BufferManager
tupleSourceID
- Tuple source identifiertupleBatch
- New batch
TupleSourceNotFoundException
- If tuple source not found
MetaMatrixComponentException
- If an internal server error occurredpublic TupleBatch pinTupleBatch(TupleSourceID tupleSourceID, int beginRow) throws TupleSourceNotFoundException, MemoryNotAvailableException, MetaMatrixComponentException
TupleBatch
will have the exact same bounds as the ManagedBatch
pinTupleBatch
in interface BufferManager
tupleSourceID
- 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 pinpublic void unpinTupleBatch(TupleSourceID tupleSourceID, int beginRow) throws TupleSourceNotFoundException, MetaMatrixComponentException
unpinTupleBatch
in interface BufferManager
tupleSourceID
- Tuple source identifierbeginRow
- Beginning row
TupleSourceNotFoundException
- If tuple source not found
MetaMatrixComponentException
- If an internal server error occurredpublic int getFinalRowCount(TupleSourceID tupleSourceID) throws TupleSourceNotFoundException, MetaMatrixComponentException
getFinalRowCount
in interface BufferManager
tupleSourceID
- Tuple source identifier
TupleSourceNotFoundException
- If tuple source not found
MetaMatrixComponentException
- If an internal server error occurredprotected void clean(long memoryRequired, com.metamatrix.common.buffer.impl.TupleGroupInfo targetGroupInfo)
public void stop()
stop
in interface BufferManager
BufferManager.stop()
public Streamable<?> getStreamable(TupleSourceID id, java.lang.String referenceId) throws TupleSourceNotFoundException, MetaMatrixComponentException
BufferManager
getStreamable
in interface BufferManager
TupleSourceNotFoundException
MetaMatrixComponentException
public void setPersistentTupleSource(TupleSourceID id, Streamable<?> s) throws TupleSourceNotFoundException
BufferManager
TupleSource
as the persistent stream for the Streamable
setPersistentTupleSource
in interface BufferManager
TupleSourceNotFoundException
public void addStreamablePart(TupleSourceID tupleSourceID, LobChunk streamChunk, int beginRow) throws TupleSourceNotFoundException, MetaMatrixComponentException
BufferManager
addStreamablePart
in interface BufferManager
streamChunk
- part of the stream
TupleSourceNotFoundException
MetaMatrixComponentException
BufferManager.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 BufferManager
tupleSourceID
- - identifier
TupleSourceNotFoundException
MetaMatrixComponentException
com.metamatrix.common.buffer.BufferManager#getStreamable(com.metamatrix.common.buffer.TupleSourceID)
public void releasePinnedBatches() throws MetaMatrixComponentException
BufferManager
releasePinnedBatches
in interface BufferManager
MetaMatrixComponentException
BufferManager.releasePinnedBatches()
public int getPinnedCount()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |