Skip to content
Snippets Groups Projects
Commit 0e1a3fac authored by jakubs's avatar jakubs
Browse files

SP-45, BIS-21 specify the maximum try count

SVN: 25307
parent fb1716be
No related branches found
No related tags found
No related merge requests found
...@@ -154,6 +154,7 @@ public class TopLevelDataSetRegistratorGlobalState ...@@ -154,6 +154,7 @@ public class TopLevelDataSetRegistratorGlobalState
this.storageRecoveryManager = storageRecoveryManager; this.storageRecoveryManager = storageRecoveryManager;
this.storageRecoveryManager.setDropboxRecoveryStateDir(dropboxRecoveryStateDir); this.storageRecoveryManager.setDropboxRecoveryStateDir(dropboxRecoveryStateDir);
this.storageRecoveryManager.setRecoveryMarkerFilesDir(recoveryMarkerFilesDirectory); this.storageRecoveryManager.setRecoveryMarkerFilesDir(recoveryMarkerFilesDirectory);
this.storageRecoveryManager.setMaximumRertyCount(getMaximumRecoveryCount(threadParameters.getThreadProperties()));
// Initialize the DSS Registration Log Directory // Initialize the DSS Registration Log Directory
new DssRegistrationLogDirectoryHelper(dssRegistrationLogDir).initializeSubdirectories(); new DssRegistrationLogDirectoryHelper(dssRegistrationLogDir).initializeSubdirectories();
...@@ -305,6 +306,8 @@ public class TopLevelDataSetRegistratorGlobalState ...@@ -305,6 +306,8 @@ public class TopLevelDataSetRegistratorGlobalState
public static final String PRE_COMMIT_DIR = "pre-commit-dir"; public static final String PRE_COMMIT_DIR = "pre-commit-dir";
public static final String RECOVERY_MARKER_DIR = "recovery-marker-dir"; public static final String RECOVERY_MARKER_DIR = "recovery-marker-dir";
public static final String RECOVERY_MAX_RETRY_COUNT = "recovery-max-retry-count";
private static File getStagingDir(File storeRoot, String shareId, Properties threadProperties) private static File getStagingDir(File storeRoot, String shareId, Properties threadProperties)
{ {
...@@ -329,6 +332,11 @@ public class TopLevelDataSetRegistratorGlobalState ...@@ -329,6 +332,11 @@ public class TopLevelDataSetRegistratorGlobalState
"recovery-marker"); "recovery-marker");
} }
private static int getMaximumRecoveryCount(Properties threadProperties)
{
return PropertyUtils.getInt(threadProperties, RECOVERY_MAX_RETRY_COUNT, 50);
}
/** /**
* Get a directory local to the share, respecting the user override, if one is specified, and * Get a directory local to the share, respecting the user override, if one is specified, and
* defaulting to the defaultDirName. * defaulting to the defaultDirName.
......
...@@ -44,7 +44,9 @@ public class DataSetStorageRecoveryManager implements IDataSetStorageRecoveryMan ...@@ -44,7 +44,9 @@ public class DataSetStorageRecoveryManager implements IDataSetStorageRecoveryMan
private File dropboxRecoveryStateDir; private File dropboxRecoveryStateDir;
private File recoveryMarkerFilesDir; private File recoveryMarkerFilesDir;
private int maxRetryCount = 50;
public <T extends DataSetInformation> void checkpointPrecommittedState( public <T extends DataSetInformation> void checkpointPrecommittedState(
DataSetStorageAlgorithmRunner<T> runner) DataSetStorageAlgorithmRunner<T> runner)
{ {
...@@ -150,4 +152,13 @@ public class DataSetStorageRecoveryManager implements IDataSetStorageRecoveryMan ...@@ -150,4 +152,13 @@ public class DataSetStorageRecoveryManager implements IDataSetStorageRecoveryMan
this.recoveryMarkerFilesDir = recoveryMarkerFileDir; this.recoveryMarkerFilesDir = recoveryMarkerFileDir;
} }
public void setMaximumRertyCount(int maxRetryCount)
{
this.maxRetryCount = maxRetryCount;
}
public int getMaximumRertyCount()
{
return this.maxRetryCount;
}
} }
...@@ -70,4 +70,8 @@ public interface IDataSetStorageRecoveryManager ...@@ -70,4 +70,8 @@ public interface IDataSetStorageRecoveryManager
void setDropboxRecoveryStateDir(File dropboxRecoveryStateDir); void setDropboxRecoveryStateDir(File dropboxRecoveryStateDir);
void setRecoveryMarkerFilesDir(File recoveryMarkerFileDir); void setRecoveryMarkerFilesDir(File recoveryMarkerFileDir);
int getMaximumRertyCount();
void setMaximumRertyCount(int maxRetryCount);
} }
\ No newline at end of file
...@@ -213,6 +213,7 @@ public abstract class AbstractJythonDataSetHandlerTest extends AbstractFileSyste ...@@ -213,6 +213,7 @@ public abstract class AbstractJythonDataSetHandlerTest extends AbstractFileSyste
new File(workingDirectory, "jython-handler-test")); new File(workingDirectory, "jython-handler-test"));
one(storageRecoveryManager).setRecoveryMarkerFilesDir(new File( one(storageRecoveryManager).setRecoveryMarkerFilesDir(new File(
new File(workingDirectory, "recovery-marker"), "jython-handler-test")); new File(workingDirectory, "recovery-marker"), "jython-handler-test"));
one(storageRecoveryManager).setMaximumRertyCount(with(any(Integer.class)));
} }
}); });
} }
......
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