X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.acorn%2Fsrc%2Forg%2Fsimantics%2Facorn%2FClusterManager.java;h=22629d4e64237ab63c6fc89a12f0754087254edb;hb=d09be9d2b8bf2e982ab7cf5760d39014e7ca4fa1;hp=51db52efc55a43108df3939b5bd23561700b6784;hpb=f23dc81afe57e77d20706a9a94002ce4c72f670d;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.acorn/src/org/simantics/acorn/ClusterManager.java b/bundles/org.simantics.acorn/src/org/simantics/acorn/ClusterManager.java index 51db52efc..22629d4e6 100644 --- a/bundles/org.simantics.acorn/src/org/simantics/acorn/ClusterManager.java +++ b/bundles/org.simantics.acorn/src/org/simantics/acorn/ClusterManager.java @@ -35,8 +35,12 @@ import org.simantics.db.service.ClusterSetsSupport; import org.simantics.db.service.ClusterUID; import org.simantics.utils.threads.logger.ITask; import org.simantics.utils.threads.logger.ThreadLogger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class ClusterManager { + + final static Logger LOGGER = LoggerFactory.getLogger(ClusterManager.class); private ArrayList currentChanges = new ArrayList(); @@ -70,7 +74,7 @@ public class ClusterManager { info.acquireMutex(); try { info.makeResident(); - return info.getCSSIds(); + return info.getCCSIds(); } finally { info.releaseMutex(); } @@ -143,12 +147,12 @@ public class ClusterManager { // 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("makeSnapshot"); + LOGGER.info("makeSnapshot"); // Schedule writing of all data to disk refreshHeadState(); @@ -163,17 +167,17 @@ public class ClusterManager { if (!safeToMakeSnapshot.get()) throw cause; + ClusterSetsSupport cssi = locator.getService(ClusterSetsSupport.class); + cssi.save(); + persistHeadState(); - + 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); + LOGGER.info(" -finished: amount of files is {}", amountOfFiles); workingDirectory = dbFolder.resolve(Integer.toString(mainState.headDir)); if (!Files.exists(workingDirectory)) {