Package io.deephaven.persistence
Class PersistenceImpl.LegacyStreams<UpdateType>
java.lang.Object
io.deephaven.persistence.PersistenceImpl.LegacyStreams<UpdateType>
- All Implemented Interfaces:
Persistence.PersistenceStream<UpdateType,com.fishlib.dataobjects.persistence.PersistentInputStream, com.fishlib.dataobjects.persistence.PersistentOutputStream>
- Enclosing class:
- PersistenceImpl<U>
public static class PersistenceImpl.LegacyStreams<UpdateType>
extends Object
implements Persistence.PersistenceStream<UpdateType,com.fishlib.dataobjects.persistence.PersistentInputStream,com.fishlib.dataobjects.persistence.PersistentOutputStream>
This is the peristence streams manager used for PHTs and other persistent caches.
-
Method Summary
Modifier and TypeMethodDescriptionvoidcloseCheckpointOutputStream(com.fishlib.dataobjects.persistence.PersistentOutputStream out, int lastCommandId) Close a checkpoint output stream.voidcloseUpdateOutputStream(com.fishlib.dataobjects.persistence.PersistentOutputStream out) Close an update output stream.com.fishlib.dataobjects.persistence.PersistentInputStreamnewCheckpointInputStream(String path, int bufferSizeHint) Return a new input stream for a checkpoint file.com.fishlib.dataobjects.persistence.PersistentOutputStreamnewCheckpointOutputStream(String path, int bufferSizeHint) Return a new output stream for a checkpoint file.com.fishlib.dataobjects.persistence.PersistentInputStreamnewUpdateInputStream(String path) Return a new input stream for an update file.com.fishlib.dataobjects.persistence.PersistentOutputStreamnewUpdateOutputStream(String path) Return a new output stream for an update file.readObject(com.fishlib.dataobjects.persistence.PersistentInputStream in) Read the next persisted Object from disk.voidwriteObject(com.fishlib.dataobjects.persistence.PersistentOutputStream out, UpdateType update) Write an update to an output stream.
-
Method Details
-
newCheckpointInputStream
public com.fishlib.dataobjects.persistence.PersistentInputStream newCheckpointInputStream(String path, int bufferSizeHint) throws IOException, ClassNotFoundException Description copied from interface:Persistence.PersistenceStreamReturn a new input stream for a checkpoint file.- Specified by:
newCheckpointInputStreamin interfacePersistence.PersistenceStream<UpdateType,com.fishlib.dataobjects.persistence.PersistentInputStream, com.fishlib.dataobjects.persistence.PersistentOutputStream> - Parameters:
path- the full path and filename for the checkpoint filebufferSizeHint- a suggestion for the buffer size- Returns:
- the input stream
- Throws:
IOException- from the implementationClassNotFoundException- from the implementation
-
newCheckpointOutputStream
public com.fishlib.dataobjects.persistence.PersistentOutputStream newCheckpointOutputStream(String path, int bufferSizeHint) throws IOException Description copied from interface:Persistence.PersistenceStreamReturn a new output stream for a checkpoint file.- Specified by:
newCheckpointOutputStreamin interfacePersistence.PersistenceStream<UpdateType,com.fishlib.dataobjects.persistence.PersistentInputStream, com.fishlib.dataobjects.persistence.PersistentOutputStream> - Parameters:
path- the full path and filename for the checkpoint filebufferSizeHint- a suggestion for the buffer size- Returns:
- the output stream
- Throws:
IOException- from the implementation
-
closeCheckpointOutputStream
public void closeCheckpointOutputStream(com.fishlib.dataobjects.persistence.PersistentOutputStream out, int lastCommandId) throws IOException Description copied from interface:Persistence.PersistenceStreamClose a checkpoint output stream.- Specified by:
closeCheckpointOutputStreamin interfacePersistence.PersistenceStream<UpdateType,com.fishlib.dataobjects.persistence.PersistentInputStream, com.fishlib.dataobjects.persistence.PersistentOutputStream> - Parameters:
out- the output streamlastCommandId- the command ID for this checkpoint- Throws:
IOException- from the implementation
-
newUpdateInputStream
public com.fishlib.dataobjects.persistence.PersistentInputStream newUpdateInputStream(String path) throws IOException, ClassNotFoundException Description copied from interface:Persistence.PersistenceStreamReturn a new input stream for an update file.- Specified by:
newUpdateInputStreamin interfacePersistence.PersistenceStream<UpdateType,com.fishlib.dataobjects.persistence.PersistentInputStream, com.fishlib.dataobjects.persistence.PersistentOutputStream> - Parameters:
path- the full path and filename for the update file- Returns:
- the input stream
- Throws:
IOException- from the implementationClassNotFoundException- from the implementation
-
newUpdateOutputStream
public com.fishlib.dataobjects.persistence.PersistentOutputStream newUpdateOutputStream(String path) throws IOException Description copied from interface:Persistence.PersistenceStreamReturn a new output stream for an update file.- Specified by:
newUpdateOutputStreamin interfacePersistence.PersistenceStream<UpdateType,com.fishlib.dataobjects.persistence.PersistentInputStream, com.fishlib.dataobjects.persistence.PersistentOutputStream> - Parameters:
path- the full path and filename for the checkpoint file- Returns:
- the output stream
- Throws:
IOException- from the implementation
-
closeUpdateOutputStream
public void closeUpdateOutputStream(com.fishlib.dataobjects.persistence.PersistentOutputStream out) throws IOException Description copied from interface:Persistence.PersistenceStreamClose an update output stream.- Specified by:
closeUpdateOutputStreamin interfacePersistence.PersistenceStream<UpdateType,com.fishlib.dataobjects.persistence.PersistentInputStream, com.fishlib.dataobjects.persistence.PersistentOutputStream> - Parameters:
out- the output stream- Throws:
IOException- from the implementation
-
readObject
public Object readObject(com.fishlib.dataobjects.persistence.PersistentInputStream in) throws IOException, ClassNotFoundException Description copied from interface:Persistence.PersistenceStreamRead the next persisted Object from disk. Return null if the stream is at end of file. The returned object need be immutable only if the semantics of the associated Callbacks.handlePersistenceInitializationUpdate() require it to be so. The Persistence instance itself only relies on the returned object remaining unchanged until it has been passed to handlePersistenceInitializationUpdate().- Specified by:
readObjectin interfacePersistence.PersistenceStream<UpdateType,com.fishlib.dataobjects.persistence.PersistentInputStream, com.fishlib.dataobjects.persistence.PersistentOutputStream> - Parameters:
in- the input stream- Returns:
- the next persisted Object, or null if end-of-file
- Throws:
IOException- from the implementationClassNotFoundException- from the implementation
-
writeObject
public void writeObject(com.fishlib.dataobjects.persistence.PersistentOutputStream out, UpdateType update) throws IOException Description copied from interface:Persistence.PersistenceStreamWrite an update to an output stream.- Specified by:
writeObjectin interfacePersistence.PersistenceStream<UpdateType,com.fishlib.dataobjects.persistence.PersistentInputStream, com.fishlib.dataobjects.persistence.PersistentOutputStream> - Parameters:
out- the output streamupdate- the update object to be written- Throws:
IOException- from the implementation
-