|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--uk.ac.starlink.table.StoragePolicy
Defines storage methods for bulk data. If the table handling system needs to cache bulk data somewhere, for instance because it is reading a table from a stream but needs to make it available for random access, it will use a StoragePolicy object to work out how to do it.
Code which has no preferences about how to store data can obtain
an instance of this class using the getDefaultPolicy()
method.
The initial value of this may be selected by setting the
startable.storage system property; currently recognised values
are the strings "disk", "memory" and "discard".
You may also use the name of a class which extends StoragePolicy
and has a no-arg constructor, in which case one of these will be
instantiated and used.
Code which wants to store data in a particular way may use one of
the predefined policies PREFER_MEMORY
, PREFER_DISK
or DISCARD
, or may implement their own policy by extending
this class.
If you want more control, you can always create instances of the
public RowStore
implementations directly.
Field Summary | |
static StoragePolicy |
DISCARD
Storage policy which just throws away the rows it is given. |
static StoragePolicy |
PREFER_DISK
Storage policy which will normally store table data in a scratch disk file. |
static StoragePolicy |
PREFER_MEMORY
Storage policy which will always store table data in memory. |
Constructor Summary | |
StoragePolicy()
|
Method Summary | |
static StoragePolicy |
getDefaultPolicy()
Returns the default storage policy for this JVM. |
abstract RowStore |
makeConfiguredRowStore(StarTable meta)
Creates a new RowStore and primes it by calling TableSink.acceptMetadata(uk.ac.starlink.table.StarTable) on it. |
abstract RowStore |
makeRowStore()
Returns a new RowStore object which can be used to provide a destination for random-access table storage. |
StarTable |
randomTable(StarTable table)
Returns a table based on a given table and guaranteed to have random access. |
static void |
setDefaultPolicy(StoragePolicy policy)
Sets the default storage policy used for this JVM. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final StoragePolicy PREFER_MEMORY
public static final StoragePolicy PREFER_DISK
public static final StoragePolicy DISCARD
Constructor Detail |
public StoragePolicy()
Method Detail |
public static StoragePolicy getDefaultPolicy()
public static void setDefaultPolicy(StoragePolicy policy)
policy
- new default storage policypublic abstract RowStore makeRowStore()
public abstract RowStore makeConfiguredRowStore(StarTable meta)
TableSink.acceptMetadata(uk.ac.starlink.table.StarTable)
on it.
meta
- template giving the metadata which describes the rows
that will have to be stored
public StarTable randomTable(StarTable table) throws IOException
table
- original table
IOException
|
Copyright © 2004 CLRC: Central Laboratory of the Research Councils. All rights reserved. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |