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

SP-45, BIS-21 small refactoring

SVN: 25401
parent de316dd6
No related branches found
No related tags found
No related merge requests found
......@@ -312,7 +312,12 @@ public class DataSetStorageAlgorithmRunner<T extends DataSetInformation>
postRegistration();
return storeAfterRegistration(RecoveryStage.PRECOMMIT);
if (false == commitAndStore())
{
return false;
}
return storeAfterRegistration();
// confirm storage in AS
......@@ -335,35 +340,33 @@ public class DataSetStorageAlgorithmRunner<T extends DataSetInformation>
+ registrationId.toString() + ")");
}
// FIXME: only temporary - extract this knowledge a leve higher
/**
* Execute the post-registration part of the storage process
*/
public boolean storeAfterRegistration(DataSetStorageRecoveryInfo.RecoveryStage stage)
public boolean commitAndStore()
{
if (stage.before(RecoveryStage.STORAGE_COMPLETED))
if (commitStorageProcessors() == false)
{
// checkpoint - post-registration-hook executed
if (commitStorageProcessors() == false)
{
return false;
}
return false;
}
// COMMITED
// COMMITED
if (storeCommitedDatasets() == false)
{
return false;
}
if (storeCommitedDatasets() == false)
{
return false;
}
if (shouldUseAutoRecovery())
{
storageRecoveryManager.checkpointStoredStateBeforeStorageConfirmation(this);
}
if (shouldUseAutoRecovery())
{
storageRecoveryManager.checkpointStoredStateBeforeStorageConfirmation(this);
}
return true;
}
/**
* Execute the post-registration part of the storage process
*/
public boolean storeAfterRegistration()
{
cleanPrecommitDirectory();
boolean confirmStorageSucceeded = confirmStorageInApplicationServer();
......
......@@ -392,7 +392,16 @@ public class JythonTopLevelDataSetHandlerV2<T extends DataSetInformation> extend
runner.postRegistration();
}
boolean success = runner.storeAfterRegistration(recoveryStage);
boolean success = true;
if (recoveryStage.before(RecoveryStage.STORAGE_COMPLETED))
{
success = runner.commitAndStore();
}
if (success)
{
success = runner.storeAfterRegistration();
}
if (success)
{
logger.registerSuccess();
......
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