|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.metamatrix.common.buffer.storage.file.FileStorageManager
public class FileStorageManager
This class stores batches in files on disk in a specified directory. Every tuple source gets it's own set of files, named b_id_num where id is the unique id value of the TupleSourceID, and num is a file counter for the files associated with the TupleSourceID. Batches are stored random access into the file, typically but not necessarily in order. An in memory data structure stores info about all open files and where the batches are in the file (file pointers and lengths).
Field Summary |
---|
Fields inherited from interface com.metamatrix.common.buffer.StorageManager |
---|
TYPE_DATABASE, TYPE_FILE, TYPE_MEMORY, TYPE_REMOTE |
Constructor Summary | |
---|---|
FileStorageManager()
|
Method Summary | |
---|---|
void |
addBatch(TupleSourceID sourceID,
TupleBatch batch,
java.lang.String[] types)
Add a batch to the storage manager. |
TupleBatch |
getBatch(TupleSourceID sourceID,
int beginRow,
java.lang.String[] types)
Get a batch from the storage manager based on the beginRow. |
int |
getOpenFiles()
|
int |
getStorageType()
Return file type: com.metamatrix.common.buffer.StorageManager.TYPE_FILE |
void |
initialize(java.util.Properties props)
Initialize with properties |
void |
removeBatch(TupleSourceID sourceID,
int beginRow)
This method does nothing - rather than deleting batches from the middle of a RandomAccessFile, which would be very expensive, we just handle the possibility that a batch already exists in the addBatch method. |
void |
removeBatches(TupleSourceID sourceID)
Remove all batches for a sourceID. |
void |
shutdown()
This method removes all storage area files by walking through the file info map and closing and removing each file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FileStorageManager()
Method Detail |
---|
public void initialize(java.util.Properties props) throws MetaMatrixComponentException
initialize
in interface StorageManager
props
- Initialization properties
MetaMatrixComponentException
- indicating a non-business-related
exception (such as a communication exception)BufferManagerPropertyNames.BUFFER_STORAGE_DIRECTORY
,
BufferManagerPropertyNames.MAX_OPEN_FILES
,
BufferManagerPropertyNames.MAX_FILE_SIZE
public int getStorageType()
com.metamatrix.common.buffer.StorageManager.TYPE_FILE
getStorageType
in interface StorageManager
StorageManager.TYPE_MEMORY
,
StorageManager.TYPE_DATABASE
,
StorageManager.TYPE_FILE
,
StorageManager.TYPE_REMOTE
public void addBatch(TupleSourceID sourceID, TupleBatch batch, java.lang.String[] types) throws MetaMatrixComponentException
addBatch
in interface StorageManager
sourceID
- Source identifierbatch
- Batch to addtypes
- a hint to the StorageManager about the types of data in the batch
MetaMatrixComponentException
- indicating a non-business-related
exception (such as a communication exception)public TupleBatch getBatch(TupleSourceID sourceID, int beginRow, java.lang.String[] types) throws TupleSourceNotFoundException, MetaMatrixComponentException
getBatch
in interface StorageManager
sourceID
- Source identifierbeginRow
- Beginning row of batch to retrievetypes
- a hint to the StorageManager about the types of data in the batch
TupleSourceNotFoundException
- indicating the sourceID is unknown
MetaMatrixComponentException
- indicating a non-business-related
exception (such as a communication exception)public void removeBatch(TupleSourceID sourceID, int beginRow) throws TupleSourceNotFoundException, MetaMatrixComponentException
removeBatch
in interface StorageManager
sourceID
- Source identifierbeginRow
- Beginning batch row to remove
TupleSourceNotFoundException
- indicating the sourceID is unknown
MetaMatrixComponentException
- indicating a non-business-related
exception (such as a communication exception)public void removeBatches(TupleSourceID sourceID) throws MetaMatrixComponentException
removeBatches
in interface StorageManager
sourceID
- Tuple source ID
MetaMatrixComponentException
- indicating a non-business-related
exception (such as a communication exception)public void shutdown()
shutdown
in interface StorageManager
public int getOpenFiles()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |