Modifier and Type | Field and Description |
---|---|
static int |
SNAP_MAGIC |
Constructor and Description |
---|
FileSnap(java.io.File snapDir) |
Modifier and Type | Method and Description |
---|---|
void |
close()
synchronized close just so that if serialize is in place
the close operation will block and will wait till serialize
is done and will set the close flag
|
long |
deserialize(DataTree dt,
java.util.Map<java.lang.Long,java.lang.Integer> sessions)
deserialize a data tree from the most recent snapshot
|
void |
deserialize(DataTree dt,
java.util.Map<java.lang.Long,java.lang.Integer> sessions,
org.apache.jute.InputArchive ia)
deserialize the datatree from an inputarchive
|
java.io.File |
findMostRecentSnapshot()
find the most recent snapshot in the database.
|
java.util.List<java.io.File> |
findNRecentSnapshots(int n)
find the last n snapshots.
|
void |
serialize(DataTree dt,
java.util.Map<java.lang.Long,java.lang.Integer> sessions,
java.io.File snapShot)
serialize the datatree and session into the file snapshot
|
protected void |
serialize(DataTree dt,
java.util.Map<java.lang.Long,java.lang.Integer> sessions,
org.apache.jute.OutputArchive oa,
FileHeader header)
serialize the datatree and sessions
|
public long deserialize(DataTree dt, java.util.Map<java.lang.Long,java.lang.Integer> sessions) throws java.io.IOException
deserialize
in interface SnapShot
dt
- the datatree to be deserialized intosessions
- the sessions to be deserialized intojava.io.IOException
public void deserialize(DataTree dt, java.util.Map<java.lang.Long,java.lang.Integer> sessions, org.apache.jute.InputArchive ia) throws java.io.IOException
dt
- the datatree to be serialized intosessions
- the sessions to be filled upia
- the input archive to restore fromjava.io.IOException
public java.io.File findMostRecentSnapshot() throws java.io.IOException
findMostRecentSnapshot
in interface SnapShot
java.io.IOException
public java.util.List<java.io.File> findNRecentSnapshots(int n) throws java.io.IOException
the
- number of most recent snapshotsjava.io.IOException
protected void serialize(DataTree dt, java.util.Map<java.lang.Long,java.lang.Integer> sessions, org.apache.jute.OutputArchive oa, FileHeader header) throws java.io.IOException
dt
- the datatree to be serializedsessions
- the sessions to be serializedoa
- the output archive to serialize intoheader
- the header of this snapshotjava.io.IOException
public void serialize(DataTree dt, java.util.Map<java.lang.Long,java.lang.Integer> sessions, java.io.File snapShot) throws java.io.IOException
Copyright © 2023 The Apache Software Foundation