Class Checkpoint
java.lang.Object
org.apache.uima.collection.impl.cpm.Checkpoint
- All Implemented Interfaces:
Runnable
Runing in a seperate thread creates a checkpoint file at predefined intervals.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate longThe checkpoint frequency.private BaseCPMImplThe cpm.private StringThe file name.private final ObjectThe lock for pause.private booleanThe pause.private booleanThe stop.private StringThe synch point file name. -
Constructor Summary
ConstructorsConstructorDescriptionCheckpoint(BaseCPMImpl aCpm, String aFilename, long aCheckpointFrequency) Initialize the checkpoint with a reference to controlling cpe, the file where the checkpoint is to be stored, and the frequency of checkpoints. -
Method Summary
Modifier and TypeMethodDescriptionvoiddelete()Deletes checkpoint file from the filesystem.voidSerializes checkpoint information to disk.booleanexists()Returns true if configured checkpoinjt file exists on disk.voidpause()Pauses checkpoint thread.static voidprintEveList(List lst, int tCnt) Prints the list of Process Events in the order that they were produced.static voidprintStats(ProcessTrace prT) Prints the stats.voidRenames previous checkpoint file.Retrieves the checkpoint from the filesystem.voidresume()Resumes checkpoint thread.voidrun()Starts the checkpoint thread and runs until the cpe tells it to stop.voidstop()Stops the checkpoint thread.
-
Field Details
-
fileName
The file name. -
stop
private volatile boolean stopThe stop. -
checkpointFrequency
private long checkpointFrequencyThe checkpoint frequency. -
pause
private boolean pauseThe pause. -
lockForPause
The lock for pause. -
cpm
The cpm. -
synchPointFileName
The synch point file name.
-
-
Constructor Details
-
Checkpoint
Initialize the checkpoint with a reference to controlling cpe, the file where the checkpoint is to be stored, and the frequency of checkpoints.- Parameters:
aCpm- the a cpmaFilename- the a filenameaCheckpointFrequency- the a checkpoint frequency
-
-
Method Details
-
stop
public void stop()Stops the checkpoint thread. -
run
public void run()Starts the checkpoint thread and runs until the cpe tells it to stop. -
delete
public void delete()Deletes checkpoint file from the filesystem. -
pause
public void pause()Pauses checkpoint thread. -
resume
public void resume()Resumes checkpoint thread. -
doCheckpoint
public void doCheckpoint()Serializes checkpoint information to disk. It retrieves data to checkpoint from the CPEEngine. -
rename
Renames previous checkpoint file.- Parameters:
aFilename- - checkpoint file to rename
-
printStats
Prints the stats.- Parameters:
prT- the pr T
-
printEveList
Prints the list of Process Events in the order that they were produced.- Parameters:
lst- List of ProcessEventtCnt- depth of this List in the Process Trace hierarchy
-
exists
public boolean exists()Returns true if configured checkpoinjt file exists on disk.- Returns:
- - true if file exists, false otherwise
-
restoreFromCheckpoint
Retrieves the checkpoint from the filesystem.- Returns:
- - desirialized object containing recovery information.
- Throws:
IOException- -
-