Package io.deephaven.persistence
Class PersistentHashtable<K,V>
java.lang.Object
io.deephaven.persistence.PersistentHashtable<K,V>
- Type Parameters:
K- the table's key classV- the table's value class
- All Implemented Interfaces:
com.fishlib.dataobjects.persistence.PersistentCollection,Persistence.Callbacks<com.fishlib.base.Command>
public class PersistentHashtable<K,V>
extends Object
implements com.fishlib.dataobjects.persistence.PersistentCollection, Persistence.Callbacks<com.fishlib.base.Command>
Implementation of a persistently-stored hash table using the Persistence classes.
-
Constructor Summary
ConstructorsConstructorDescriptionPersistentHashtable(String id, PersistencePolicy checkPointPolicy) PersistentHashtable(String id, PersistencePolicy checkPointPolicy, boolean cleanFileOnError) PersistentHashtable(String id, PersistencePolicy checkPointPolicy, boolean cleanFileOnError, int size) PersistentHashtable(String id, PersistencePolicy checkPointPolicy, boolean cleanFileOnError, com.fishlib.dataobjects.WColumnSet[] columnSetsToPersist) PersistentHashtable(String id, PersistencePolicy checkPointPolicy, com.fishlib.dataobjects.WColumnSet[] columnSetsToPersist) -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()voidvoidvoiddisconnect(boolean forceCheckpoint) entrySet()List<com.fishlib.base.Command>Called to obtain an atomic (?) snapshot of the contents of the persistent collection in preparation for writing a checkpoint.voidHandle an update read from the persistent cache while the persistent collection is being initialized.keySet()putNoPersist(K key, V value) voidreleaseCheckPoint(List<com.fishlib.base.Command> checkpoint) Called once for every call to getCheckPoint(), to indicate that the persistence implementation is finished with the checkpoint list and the objects contained within it.voidsetLastCommandId(int cmdId) values()
-
Constructor Details
-
PersistentHashtable
public PersistentHashtable(String id, PersistencePolicy checkPointPolicy) throws IOException, ClassNotFoundException - Throws:
IOExceptionClassNotFoundException
-
PersistentHashtable
public PersistentHashtable(String id, PersistencePolicy checkPointPolicy, com.fishlib.dataobjects.WColumnSet[] columnSetsToPersist) throws IOException, ClassNotFoundException - Throws:
IOExceptionClassNotFoundException
-
PersistentHashtable
public PersistentHashtable(String id, PersistencePolicy checkPointPolicy, boolean cleanFileOnError) throws IOException, ClassNotFoundException - Throws:
IOExceptionClassNotFoundException
-
PersistentHashtable
public PersistentHashtable(String id, PersistencePolicy checkPointPolicy, boolean cleanFileOnError, com.fishlib.dataobjects.WColumnSet[] columnSetsToPersist) throws IOException, ClassNotFoundException - Throws:
IOExceptionClassNotFoundException
-
PersistentHashtable
public PersistentHashtable(String id, PersistencePolicy checkPointPolicy, boolean cleanFileOnError, int size) throws IOException, ClassNotFoundException - Throws:
IOExceptionClassNotFoundException
-
-
Method Details
-
handlePersistenceInitializationUpdate
Description copied from interface:Persistence.CallbacksHandle an update read from the persistent cache while the persistent collection is being initialized. This should be called *only* during initPersistence().- Specified by:
handlePersistenceInitializationUpdatein interfacePersistence.Callbacks<K>- Parameters:
obj- The object just read from the persistent stream.
-
getCheckPoint
Description copied from interface:Persistence.CallbacksCalled to obtain an atomic (?) snapshot of the contents of the persistent collection in preparation for writing a checkpoint. The persistence policy that the PersistenceImpl was instantiated with controls when checkpoints are written, so this call may come at any time.- Specified by:
getCheckPointin interfacePersistence.Callbacks<K>- Returns:
- the list of UpdateType objects (commands) representing the current state of the collection
-
releaseCheckPoint
Description copied from interface:Persistence.CallbacksCalled once for every call to getCheckPoint(), to indicate that the persistence implementation is finished with the checkpoint list and the objects contained within it.- Specified by:
releaseCheckPointin interfacePersistence.Callbacks<K>- Parameters:
checkpoint- the checkpoint from the getCheckPoint() call
-
put
- Throws:
IOException
-
putNoPersist
-
remove
- Throws:
IOException
-
clear
- Throws:
IOException
-
entrySet
-
keySet
-
values
-
get
-
setLastCommandId
public void setLastCommandId(int cmdId) - Specified by:
setLastCommandIdin interfacecom.fishlib.dataobjects.persistence.PersistentCollection
-
disconnect
public void disconnect()- Specified by:
disconnectin interfacecom.fishlib.dataobjects.persistence.PersistentCollection
-
disconnect
public void disconnect(boolean forceCheckpoint) - Specified by:
disconnectin interfacecom.fishlib.dataobjects.persistence.PersistentCollection
-
commitCheckPoint
- Throws:
IOException
-