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=b2a30953cca9e0bff26e72dc69a788139e52a817;hpb=ca40974f87c9db00eb77aaf1acc1e9937b37261b;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 b2a30953c..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(); @@ -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)) {