Class Checkpoint
- java.lang.Object
-
- org.apache.uima.collection.impl.cpm.Checkpoint
-
-
Constructor Summary
Constructors Constructor Description Checkpoint(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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
delete()
Deletes checkpoint file from the filesystemvoid
doCheckpoint()
Serializes checkpoint information to disk.boolean
exists()
Returns true if configured checkpoinjt file exists on diskvoid
pause()
Pauses checkpoint threadstatic void
printEveList(List lst, int tCnt)
Prints the list of Process Events in the order that they were produced.static void
printStats(ProcessTrace prT)
void
rename(String aFilename)
Renames previous checkpoint file.Object
restoreFromCheckpoint()
Retrieves the checkpoint from the filesystem.void
resume()
Resumes checkpoint threadvoid
run()
Starts the checkpoint thread and runs until the cpe tells it to stopvoid
start()
Start the threadvoid
stop()
Stops the checkpoint thread
-
-
-
Constructor Detail
-
Checkpoint
public Checkpoint(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.- Parameters:
aCpm
-aFilename
-aCheckpointFrequency
-
-
-
Method Detail
-
start
public void start()
Start the thread
-
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
public void rename(String aFilename)
Renames previous checkpoint file.- Parameters:
aFilename
- - checkpoint file to rename
-
printStats
public static void printStats(ProcessTrace prT)
-
printEveList
public static void printEveList(List lst, int tCnt)
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
public Object restoreFromCheckpoint() throws IOException
Retrieves the checkpoint from the filesystem.- Returns:
- - desirialized object containing recovery information.
- Throws:
IOException
- -
-
-