public class CheckpointService extends Object implements org.springframework.context.Lifecycle, org.springframework.context.ApplicationContextAware, HasValidator
Modifier and Type | Field and Description |
---|---|
protected org.springframework.context.support.AbstractApplicationContext |
appCtx |
protected Checkpoint |
checkpointInProgress |
protected long |
checkpointIntervalMinutes |
protected ConfigPath |
checkpointsDir |
protected TimerTask |
checkpointTask |
protected CrawlController |
controller |
protected boolean |
forgetAllButLatest |
protected boolean |
isRunning |
protected Checkpoint |
lastCheckpoint |
protected CrawlStatSnapshot |
lastCheckpointSnapshot |
protected int |
nextCheckpointNumber
Next overall series checkpoint number
|
protected Checkpoint |
recoveryCheckpoint |
protected Timer |
timer
service for auto-checkpoint tasks at an interval
|
protected static org.springframework.validation.Validator |
VALIDATOR |
Constructor and Description |
---|
CheckpointService()
Create a new Checkpointer
|
Modifier and Type | Method and Description |
---|---|
protected void |
checkpointFailed(Exception e)
Note that a checkpoint failed
|
protected void |
checkpointFailed(String message) |
List<File> |
findAvailableCheckpointDirectories()
Returns a list of available, valid (contains 'valid' file)
checkpoint directories, as File instances, with the more
recently-written appearing first.
|
long |
getCheckpointIntervalMinutes() |
ConfigPath |
getCheckpointsDir() |
CrawlController |
getCrawlController() |
boolean |
getForgetAllButLatest() |
int |
getNextCheckpointNumber() |
Checkpoint |
getRecoveryCheckpoint() |
org.springframework.validation.Validator |
getValidator() |
boolean |
hasAvailableCheckpoints() |
boolean |
isCheckpointing() |
boolean |
isRunning() |
String |
requestCrawlCheckpoint()
Run a checkpoint of the crawler
|
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
void |
setCheckpointIntervalMinutes(long interval)
Period at which to create automatic checkpoints; -1 means
no auto checkpointing.
|
void |
setCheckpointsDir(ConfigPath checkpointsDir)
Checkpoints directory
|
void |
setCrawlController(CrawlController controller) |
void |
setForgetAllButLatest(boolean forgetAllButLatest)
True to save only the latest checkpoint, false to save all of them.
|
void |
setRecoveryCheckpoint(Checkpoint checkpoint) |
void |
setRecoveryCheckpointByName(String selectedCheckpoint)
Given the name of a valid checkpoint subdirectory in the checkpoints
directory, create a Checkpoint instance, and insert it into all
Checkpointable beans.
|
protected void |
setupCheckpointTask()
Setup checkpointTask according to current interval.
|
void |
start() |
void |
stop() |
protected int nextCheckpointNumber
protected Checkpoint checkpointInProgress
protected Checkpoint lastCheckpoint
protected CrawlStatSnapshot lastCheckpointSnapshot
protected Timer timer
protected TimerTask checkpointTask
protected ConfigPath checkpointsDir
protected long checkpointIntervalMinutes
protected boolean forgetAllButLatest
protected Checkpoint recoveryCheckpoint
protected CrawlController controller
protected org.springframework.context.support.AbstractApplicationContext appCtx
protected boolean isRunning
protected static org.springframework.validation.Validator VALIDATOR
public ConfigPath getCheckpointsDir()
public void setCheckpointsDir(ConfigPath checkpointsDir)
public long getCheckpointIntervalMinutes()
public void setCheckpointIntervalMinutes(long interval)
public boolean getForgetAllButLatest()
public void setForgetAllButLatest(boolean forgetAllButLatest)
public void setRecoveryCheckpoint(Checkpoint checkpoint)
public Checkpoint getRecoveryCheckpoint()
public CrawlController getCrawlController()
public void setCrawlController(CrawlController controller)
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
setApplicationContext
in interface org.springframework.context.ApplicationContextAware
org.springframework.beans.BeansException
public void start()
start
in interface org.springframework.context.Lifecycle
protected void setupCheckpointTask()
public boolean isRunning()
isRunning
in interface org.springframework.context.Lifecycle
public void stop()
stop
in interface org.springframework.context.Lifecycle
public int getNextCheckpointNumber()
public String requestCrawlCheckpoint() throws IllegalStateException
IllegalStateException
public boolean isCheckpointing()
protected void checkpointFailed(Exception e)
e
- Exception checkpoint failed on.protected void checkpointFailed(String message)
public boolean hasAvailableCheckpoints()
public List<File> findAvailableCheckpointDirectories()
public void setRecoveryCheckpointByName(String selectedCheckpoint)
selectedCheckpoint
- public org.springframework.validation.Validator getValidator()
getValidator
in interface HasValidator
Copyright © 2003-2014 Internet Archive. All Rights Reserved.