Skip to content
Snippets Groups Projects
Commit 6bc5311c authored by brinn's avatar brinn
Browse files

DMV-8: Recovery after partial deletion can damage data

This is kind of a hack to resolve the partial deletion situation that introduces another status file.

SVN: 1567
parent 3636224c
No related branches found
No related tags found
No related merge requests found
...@@ -24,7 +24,13 @@ package ch.systemsx.cisd.common; ...@@ -24,7 +24,13 @@ package ch.systemsx.cisd.common;
public class Constants public class Constants
{ {
/** String that indicates a marker file */
public static final String MARKER_PREFIX = ".MARKER_";
/** The prefix of marker files that indicate that the processing of some path is finished. */ /** The prefix of marker files that indicate that the processing of some path is finished. */
public static final String IS_FINISHED_PREFIX = ".is_finished_"; public static final String IS_FINISHED_PREFIX = MARKER_PREFIX + "is_finished_";
/** The prefix of marker files that indicate that the processing of some path is finished. */
public static final String DELETION_IN_PROGRESS_PREFIX = MARKER_PREFIX + "deletion_in_progress_";
} }
...@@ -26,6 +26,7 @@ import java.util.TimerTask; ...@@ -26,6 +26,7 @@ import java.util.TimerTask;
import org.apache.log4j.Level; import org.apache.log4j.Level;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import ch.systemsx.cisd.common.Constants;
import ch.systemsx.cisd.common.exceptions.ConfigurationFailureException; import ch.systemsx.cisd.common.exceptions.ConfigurationFailureException;
import ch.systemsx.cisd.common.logging.ISimpleLogger; import ch.systemsx.cisd.common.logging.ISimpleLogger;
import ch.systemsx.cisd.common.logging.LogCategory; import ch.systemsx.cisd.common.logging.LogCategory;
...@@ -202,7 +203,10 @@ public final class DirectoryScanningTimerTask extends TimerTask implements ISelf ...@@ -202,7 +203,10 @@ public final class DirectoryScanningTimerTask extends TimerTask implements ISelf
{ // Guard: skip faulty paths. { // Guard: skip faulty paths.
return; return;
} }
if (isMarker(path))
{
return;
}
try try
{ {
final boolean handledOK = handler.handle(path); final boolean handledOK = handler.handle(path);
...@@ -220,6 +224,11 @@ public final class DirectoryScanningTimerTask extends TimerTask implements ISelf ...@@ -220,6 +224,11 @@ public final class DirectoryScanningTimerTask extends TimerTask implements ISelf
} }
} }
private static boolean isMarker(File path)
{
return path.getName().startsWith(Constants.MARKER_PREFIX);
}
private void addToFaultyPaths(File path) private void addToFaultyPaths(File path)
{ {
faultyPaths.add(path); faultyPaths.add(path);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment