Interface SnapShot
-
- All Known Implementing Classes:
FileSnap
public interface SnapShotsnapshot interface for the persistence layer. implement this interface for implementing snapshots.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclose()free resources from this snapshot immediatelylongdeserialize(DataTree dt, java.util.Map<java.lang.Long,java.lang.Integer> sessions)deserialize a data tree from the last valid snapshot and return the last zxid that was deserializedjava.io.FilefindMostRecentSnapshot()find the most recent snapshot filevoidserialize(DataTree dt, java.util.Map<java.lang.Long,java.lang.Integer> sessions, java.io.File name)persist the datatree and the sessions into a persistence storage
-
-
-
Method Detail
-
deserialize
long deserialize(DataTree dt, java.util.Map<java.lang.Long,java.lang.Integer> sessions) throws java.io.IOException
deserialize a data tree from the last valid snapshot and return the last zxid that was deserialized- Parameters:
dt- the datatree to be deserialized intosessions- the sessions to be deserialized into- Returns:
- the last zxid that was deserialized from the snapshot
- Throws:
java.io.IOException
-
serialize
void serialize(DataTree dt, java.util.Map<java.lang.Long,java.lang.Integer> sessions, java.io.File name) throws java.io.IOException
persist the datatree and the sessions into a persistence storage- Parameters:
dt- the datatree to be serializedsessions-- Throws:
java.io.IOException
-
findMostRecentSnapshot
java.io.File findMostRecentSnapshot() throws java.io.IOExceptionfind the most recent snapshot file- Returns:
- the most recent snapshot file
- Throws:
java.io.IOException
-
close
void close() throws java.io.IOExceptionfree resources from this snapshot immediately- Throws:
java.io.IOException
-
-