|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.archive.crawler.framework.Checkpointer
public class Checkpointer
Runs checkpointing. Also keeps history of crawl checkpoints Generally used by CrawlController only but also has static utility methods classes that need to participate in a checkpoint can use.
Nested Class Summary | |
---|---|
class |
Checkpointer.CheckpointingThread
Thread to run the checkpointing. |
Field Summary | |
---|---|
static java.text.DecimalFormat |
INDEX_FORMAT
|
Constructor Summary | |
---|---|
Checkpointer(CrawlController cc,
java.io.File checkpointDir)
Create a new CheckpointContext with the given store directory |
|
Checkpointer(CrawlController cc,
java.lang.String prefix)
Create a new CheckpointContext with the given store directory |
Method Summary | |
---|---|
void |
checkpoint()
Run a checkpoint of the crawler. |
protected void |
checkpointFailed()
|
protected void |
checkpointFailed(java.lang.Exception e)
Note that a checkpoint failed |
protected void |
checkpointFailed(java.lang.String message)
|
(package private) void |
cleanup()
|
protected void |
clearCheckpointInProgressDirectory()
|
protected java.io.File |
createCheckpointInProgressDirectory()
|
static java.lang.String |
formatCheckpointName(java.lang.String prefix,
int index)
|
java.io.File |
getCheckpointInProgressDirectory()
|
protected CrawlController |
getController()
|
int |
getNextCheckpoint()
|
java.lang.String |
getNextCheckpointName()
|
java.util.List |
getPredecessorCheckpoints()
|
protected void |
initialize(CrawlController cc,
java.lang.String prefix)
|
boolean |
isAtBeginning()
|
protected boolean |
isCheckpointErrors()
|
boolean |
isCheckpointFailed()
|
boolean |
isCheckpointing()
|
void |
recover(CrawlController cc)
Call when recovering from a checkpoint. |
protected void |
setCheckpointErrors(boolean checkpointErrors)
|
protected void |
writeValidity()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.text.DecimalFormat INDEX_FORMAT
Constructor Detail |
---|
public Checkpointer(CrawlController cc, java.io.File checkpointDir)
cc
- CrawlController instance thats hosting this Checkpointer.checkpointDir
- Where to store checkpoint.public Checkpointer(CrawlController cc, java.lang.String prefix)
cc
- CrawlController instance thats hosting this Checkpointer.prefix
- Prefix for checkpoint label.Method Detail |
---|
protected void initialize(CrawlController cc, java.lang.String prefix)
void cleanup()
public int getNextCheckpoint()
public void checkpoint()
protected java.io.File createCheckpointInProgressDirectory()
protected void clearCheckpointInProgressDirectory()
protected CrawlController getController()
public java.lang.String getNextCheckpointName()
public static java.lang.String formatCheckpointName(java.lang.String prefix, int index)
protected void writeValidity()
public java.io.File getCheckpointInProgressDirectory()
public boolean isCheckpointing()
protected void checkpointFailed(java.lang.Exception e)
e
- Exception checkpoint failed on.protected void checkpointFailed(java.lang.String message)
protected void checkpointFailed()
public boolean isCheckpointFailed()
public boolean isAtBeginning()
public void recover(CrawlController cc)
cc
- CrawlController instance.public java.util.List getPredecessorCheckpoints()
protected boolean isCheckpointErrors()
protected void setCheckpointErrors(boolean checkpointErrors)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |