Package uk.ac.starlink.table.storage
Class ByteStoreStoragePolicy
java.lang.Object
uk.ac.starlink.table.StoragePolicy
uk.ac.starlink.table.storage.ByteStoreStoragePolicy
Abstract StoragePolicy implementation based on a ByteStore.
The
attemptMakeByteStore()
method must be implemented,
and the other methods are implemented in terms of that.- Since:
- 5 Nov 2009
- Author:
- Mark Taylor
-
Field Summary
Fields inherited from class uk.ac.starlink.table.StoragePolicy
ADAPTIVE, DISCARD, PREF_PROPERTY, PREFER_DISK, PREFER_MEMORY, SIDEWAYS
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract ByteStore
Returns a ByteStore object to hold data.Returns a new ByteStore object which can be used to provide a destination for general purpose data storage.Creates a new RowStore and primes it by callingTableSink.acceptMetadata(uk.ac.starlink.table.StarTable)
on it.Returns a newRowStore
object which can be used to provide a destination for random-access table storage.Methods inherited from class uk.ac.starlink.table.StoragePolicy
copyTable, getDefaultPolicy, randomTable, setDefaultPolicy
-
Constructor Details
-
ByteStoreStoragePolicy
public ByteStoreStoragePolicy()
-
-
Method Details
-
attemptMakeByteStore
Returns a ByteStore object to hold data. If an exception is thrown, this implementation will fall back to memory-based techniques.- Returns:
- new byte store
- Throws:
IOException
-
makeByteStore
Description copied from class:StoragePolicy
Returns a new ByteStore object which can be used to provide a destination for general purpose data storage.- Specified by:
makeByteStore
in classStoragePolicy
- Returns:
- new byte store
-
makeRowStore
Description copied from class:StoragePolicy
Returns a newRowStore
object which can be used to provide a destination for random-access table storage.- Specified by:
makeRowStore
in classStoragePolicy
- Returns:
- a RowStore object
-
makeConfiguredRowStore
Description copied from class:StoragePolicy
Creates a new RowStore and primes it by callingTableSink.acceptMetadata(uk.ac.starlink.table.StarTable)
on it.- Specified by:
makeConfiguredRowStore
in classStoragePolicy
- Parameters:
meta
- template giving the metadata which describes the rows that will have to be stored- Returns:
- a RowStore on which
acceptMetadata(meta)
has been called
-