Performance improvement. Also fix the order of saving cluster sets and
persisting head state. This (luckily) worked correctly earlier as well,
since the cluster sets were saved after each change.
refs #6904
Change-Id: I67f238f8060672a99160a85bdbd2703d94fa275b
// Cluster files are always there
// Nothing has been written => no need to do anything
long amountOfFiles = countFiles(workingDirectory);
// Cluster files are always there
// Nothing has been written => no need to do anything
long amountOfFiles = countFiles(workingDirectory);
- if(!fullSave && amountOfFiles < 3) {
+ if(!fullSave && amountOfFiles == 0) {
// System.err.println("amountOfFiles < 3");
return false;
}
// System.err.println("amountOfFiles < 3");
return false;
}
if (!safeToMakeSnapshot.get())
throw cause;
if (!safeToMakeSnapshot.get())
throw cause;
+ ClusterSetsSupport cssi = locator.getService(ClusterSetsSupport.class);
+ cssi.save();
+
if (fullSave)
mainState.save(dbFolder);
if (fullSave)
mainState.save(dbFolder);
- ClusterSetsSupport cssi = locator.getService(ClusterSetsSupport.class);
- cssi.save();
-
amountOfFiles = countFiles(workingDirectory);
System.err.println(" -finished: amount of files is " + amountOfFiles);
amountOfFiles = countFiles(workingDirectory);
System.err.println(" -finished: amount of files is " + amountOfFiles);
else if (Type.Read == type)
throw new ValidationException("Illegal transaction type.");
// Note that even if we do cancel the cluster sets are not restored.
else if (Type.Read == type)
throw new ValidationException("Illegal transaction type.");
// Note that even if we do cancel the cluster sets are not restored.
- try {
- session.getService(ClusterSetsSupport.class).save();
- } catch (Exception e) {
- e.printStackTrace();
- Logger.defaultLogError("Failed to save cluster sets.", e);
- }
graphSession.undoContext.cancelCommit();
endTransaction(true);
if (DEBUG)
graphSession.undoContext.cancelCommit();
endTransaction(true);
if (DEBUG)