Package uk.ac.starlink.table.storage
Class MonitorStoragePolicy
- java.lang.Object
-
- uk.ac.starlink.table.StoragePolicy
-
- uk.ac.starlink.table.storage.MonitorStoragePolicy
-
public class MonitorStoragePolicy extends StoragePolicy
Wrapper storage policy which derives its functionality from an existing ("base") policy, but additionally passes row storage events to a supplied TableSink.- Since:
- 24 Aug 2010
- Author:
- Mark Taylor
- See Also:
ProgressBarTableSink
-
-
Field Summary
-
Fields inherited from class uk.ac.starlink.table.StoragePolicy
ADAPTIVE, DISCARD, PREF_PROPERTY, PREFER_DISK, PREFER_MEMORY, SIDEWAYS
-
-
Constructor Summary
Constructors Constructor Description MonitorStoragePolicy(StoragePolicy base, TableSink sink)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StoragePolicygetBasePolicy()Returns the base storage policy.voidinterrupt()Cancels this storage policy for table row writes.booleanisInterrupted()Indicates whetherinterrupt()has been called on this object.ByteStoremakeByteStore()Returns a new ByteStore object which can be used to provide a destination for general purpose data storage.RowStoremakeConfiguredRowStore(StarTable meta)Creates a new RowStore and primes it by callingTableSink.acceptMetadata(uk.ac.starlink.table.StarTable)on it.RowStoremakeRowStore()Returns a new RowStore 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 Detail
-
MonitorStoragePolicy
public MonitorStoragePolicy(StoragePolicy base, TableSink sink)
Constructor.- Parameters:
base- base policysink- recipient for row storage events associated with this policy
-
-
Method Detail
-
interrupt
public void interrupt()
Cancels this storage policy for table row writes. Any attempt to callacceptRowon a RowStore obtained from this policy after calling this will result in anInterruptedIOException.
-
isInterrupted
public boolean isInterrupted()
Indicates whetherinterrupt()has been called on this object.- Returns:
- true iff interrupted
-
getBasePolicy
public StoragePolicy getBasePolicy()
Returns the base storage policy.- Returns:
- base policy
-
makeRowStore
public RowStore makeRowStore()
Description copied from class:StoragePolicyReturns a new RowStore object which can be used to provide a destination for random-access table storage.- Specified by:
makeRowStorein classStoragePolicy- Returns:
- a RowStore object
-
makeConfiguredRowStore
public RowStore makeConfiguredRowStore(StarTable meta)
Description copied from class:StoragePolicyCreates a new RowStore and primes it by callingTableSink.acceptMetadata(uk.ac.starlink.table.StarTable)on it.- Specified by:
makeConfiguredRowStorein 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
-
makeByteStore
public ByteStore makeByteStore()
Description copied from class:StoragePolicyReturns a new ByteStore object which can be used to provide a destination for general purpose data storage.- Specified by:
makeByteStorein classStoragePolicy- Returns:
- new byte store
-
-