|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openstreetmap.osmosis.core.store.ChunkedObjectStore<T>
T
- The class type to be stored.public class ChunkedObjectStore<T extends Storeable>
Adds indexed chunking capabilities to a basic object store allowing groups of objects to be written and retrieved later by their chunk index. The number of objects and the size of the index is limited only by disk space.
This store is only suitable for single-threaded use because it does not provide per-thread readers.
Constructor Summary | |
---|---|
ChunkedObjectStore(ObjectSerializationFactory serializationFactory,
java.lang.String storageFilePrefix,
java.lang.String indexFilePrefix,
boolean useCompression)
Creates a new instance. |
Method Summary | |
---|---|
void |
add(T data)
Adds the specified object to the store. |
void |
closeChunk()
Stops the current writing operation and begins a new one saving the current position against a new interval index. |
void |
complete()
Ensures that all information is fully persisted. |
long |
getChunkCount()
Returns the number of chunks managed by this store. |
ReleasableIterator<T> |
iterate(long chunk)
Provides access to the contents of this store. |
void |
release()
Performs resource cleanup tasks such as closing files, or database connections. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ChunkedObjectStore(ObjectSerializationFactory serializationFactory, java.lang.String storageFilePrefix, java.lang.String indexFilePrefix, boolean useCompression)
serializationFactory
- The factory defining the object serialisation implementation.storageFilePrefix
- The prefix of the storage file name.indexFilePrefix
- The prefix of the index file name.useCompression
- If true, the storage file will be compressed.Method Detail |
---|
public void add(T data)
data
- The object to be added.public void closeChunk()
public long getChunkCount()
public ReleasableIterator<T> iterate(long chunk)
chunk
- The chunk to read objects from.
public void complete()
complete
in interface Completable
public void release()
release
in interface Releasable
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |