mirror of
https://github.com/internetarchive/heritrix3.git
synced 2026-11-15 10:20:47 +00:00
[HER-1800] H3: Incomplete checkpoint listed in combo box
* Checkpoint.java
remove previous attempt to use Lifecycle to catch error
* Checkpointable.java
@Autowired(required=false) annotation for setRecoveryCheckpoint
* CheckpointService.java
HasValidator implementation for post-build validity check; also check at launch (probably redundant)
* CheckpointValidator.java
ensure validity stamp exists on any present Checkpoint
This commit is contained in:
1 parent
99ce106a9d
commit
d12d078a07
4 files changed
+74
-21
No files matched your search
@@ -31,14 +31,13 @@ import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.beans.factory.annotation.Required;
|
||||
import org.springframework.context.Lifecycle;
|
||||
|
||||
/**
|
||||
* Represents a single checkpoint, by its name and main store directory.
|
||||
*
|
||||
* @contributor gojomo
|
||||
*/
|
||||
public class Checkpoint implements InitializingBean, Lifecycle {
|
||||
public class Checkpoint implements InitializingBean {
|
||||
private final static Logger LOGGER =
|
||||
Logger.getLogger(Checkpoint.class.getName());
|
||||
|
||||
@@ -92,24 +91,6 @@ public class Checkpoint implements InitializingBean, Lifecycle {
|
||||
shortName = name.substring(0, name.indexOf("-"));
|
||||
}
|
||||
|
||||
boolean isRunning = false;
|
||||
public boolean isRunning() {
|
||||
return isRunning;
|
||||
}
|
||||
public void start() {
|
||||
if(isRunning) {
|
||||
return;
|
||||
}
|
||||
isRunning = true;
|
||||
if(!Checkpoint.hasValidStamp(checkpointDir.getFile())) {
|
||||
throw new RuntimeException("checkpoint '"+checkpointDir.getFile().getAbsolutePath()+"' missing validity stamp file");
|
||||
}
|
||||
}
|
||||
public void stop() {
|
||||
isRunning = false;
|
||||
}
|
||||
|
||||
|
||||
public void setSuccess(boolean b) {
|
||||
success = b;
|
||||
}
|
||||
|
||||
@@ -21,6 +21,8 @@ package org.archive.checkpointing;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
|
||||
/**
|
||||
* Interface for objects that can checkpoint their state, possibly
|
||||
@@ -72,5 +74,6 @@ public interface Checkpointable {
|
||||
*
|
||||
* @param recoveryCheckpoint Checkpoint
|
||||
*/
|
||||
@Autowired(required=false)
|
||||
void setRecoveryCheckpoint(Checkpoint recoveryCheckpoint);
|
||||
}
|
||||
Reference in new issue
Block a user