public class Checkpoint
extends java.lang.Object
rollback(long, boolean)
function is called, all
the monitored objects are rolled back to their previous states, defined by a
timestamp.Red (tfeng) |
Red (tfeng) |
Constructor and Description |
---|
Checkpoint(Rollbackable object)
Construct a checkpoint object with an initial object in its monitored
object list.
|
Modifier and Type | Method and Description |
---|---|
void |
addObject(Rollbackable object)
Add an object to the monitored object list.
|
void |
commit(long timestamp)
Commit the changes on all the monitored objects up to the given
timestamp.
|
long |
createCheckpoint()
Create a new checkpoint and return its handle.
|
long |
getTimestamp()
Get the current timestamp (also considered as the last created handle).
|
boolean |
isCheckpointing()
Test if the checkpointing facility is running.
|
void |
removeObject(Rollbackable object)
Remove an object from the monitored object list.
|
void |
rollback(long timestamp)
Rollback all the monitored objects to their previous states defined by
the given timestamp (or, handle).
|
void |
rollback(long timestamp,
boolean trim)
Rollback all the monitored objects to their previous states defined by
the given timestamp (or, handle).
|
void |
setCheckpoint(Checkpoint checkpoint)
Set this checkpoint object to be the same as the given checkpoint
object.
|
public Checkpoint(Rollbackable object)
object
- The first object to be placed in the list, or
null if the list is intended to be empty.public void addObject(Rollbackable object)
object
- The object to be added.public void commit(long timestamp)
timestamp
- The timestamp.public long createCheckpoint()
public long getTimestamp()
public boolean isCheckpointing()
public void removeObject(Rollbackable object)
object
- The object to be removed.public void rollback(long timestamp)
timestamp
- The timestamp taken at a previous time.rollback(long, boolean)
public void rollback(long timestamp, boolean trim)
timestamp
- The timestamp taken at a previous time.trim
- Whether to delete the records used for the rollback.public void setCheckpoint(Checkpoint checkpoint)
checkpoint
- The given checkpoint object to be merged with this
one.