ReliableLog
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public abstract Object | Returns: the new statethe update object update, Object the current state state)Reads a stably logged update (a serializable object) from a stream. |
| public abstract Object | Returns: the initial stateCreates and returns the initial state of data structure that needs to be stably stored. |
| public Object | Returns: the new statethe input stream in, Object the current state state)Reads a stably logged update (a serializable object) from a stream. |
| public Object | Returns: the state (snapshot)the input stream in)Read the snapshot object from a stream and returns the snapshot. |
| public void | snapshot(OutputStream
the output stream out, Object the snapshot value)Writes the snapshot object to a stream. |
| public void | writeUpdate(LogOutputStream
the output stream out, Object the snapshot value)Writes the representation (a serializable object) of an update to a stream. |
| LogHandler | back to summary |
|---|---|
| public LogHandler() Creates a LogHandler for a ReliableLog. | |
| applyUpdate | back to summary |
|---|---|
| public abstract Object applyUpdate(Object update, Object state) throws Exception Reads a stably logged update (a serializable object) from a stream.
This callback is invoked during recovery, once for every record in the
log. After reading the update, this method is invoked in order to
obtain the new snapshot value. The method should apply the update
object to the current state | |
| initialSnapshot | back to summary |
|---|---|
| public abstract Object initialSnapshot() throws Exception Creates and returns the initial state of data structure that needs to be stably stored. This method is called when a ReliableLog is created. | |
| readUpdate | back to summary |
|---|---|
| public Object readUpdate(LogInputStream in, Object state) throws Exception Reads a stably logged update (a serializable object) from a stream. This callback is invoked during recovery, once for every record in the log. After reading the update, this method invokes the applyUpdate (abstract) method in order to obtain the new snapshot value. It then returns the new snapshot.
| |
| recover | back to summary |
|---|---|
| public Object recover(InputStream in) throws Exception Read the snapshot object from a stream and returns the snapshot. This callback is invoked when the client calls the recover method of ReliableLog.
| |
| snapshot | back to summary |
|---|---|
| public void snapshot(OutputStream out, Object value) throws Exception Writes the snapshot object to a stream. This callback is invoked when the client calls the snapshot method of ReliableLog.
| |
| writeUpdate | back to summary |
|---|---|
| public void writeUpdate(LogOutputStream out, Object value) throws Exception Writes the representation (a serializable object) of an update to a stream. This callback is invoked when the client calls the update method of ReliableLog.
| |