X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.acorn%2Fsrc%2Forg%2Fsimantics%2Facorn%2Flru%2FClusterStreamChunk.java;h=3fa5e327f918b039c0ddb0dc9adea85b1a3999ff;hp=57d6f6a04b5d387c2c0b31ca2fd6cafab845dd4c;hb=e5c006a3e29dcb1f29ae5bcc21ac28573bd37648;hpb=1956b6ed85e1df65c4df58e6cb0ac6aa296e6939 diff --git a/bundles/org.simantics.acorn/src/org/simantics/acorn/lru/ClusterStreamChunk.java b/bundles/org.simantics.acorn/src/org/simantics/acorn/lru/ClusterStreamChunk.java index 57d6f6a04..3fa5e327f 100644 --- a/bundles/org.simantics.acorn/src/org/simantics/acorn/lru/ClusterStreamChunk.java +++ b/bundles/org.simantics.acorn/src/org/simantics/acorn/lru/ClusterStreamChunk.java @@ -9,18 +9,20 @@ import org.simantics.acorn.ClusterManager; import org.simantics.acorn.Persistable; import org.simantics.acorn.exception.AcornAccessVerificationException; import org.simantics.acorn.exception.IllegalAcornStateException; -import org.simantics.acorn.internal.ClusterChange; import org.simantics.acorn.internal.UndoClusterUpdateProcessor; import org.simantics.compressions.CompressionCodec; import org.simantics.compressions.Compressions; import org.simantics.db.exception.DatabaseException; import org.simantics.db.service.Bytes; import org.simantics.utils.datastructures.Pair; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import gnu.trove.list.array.TByteArrayList; public class ClusterStreamChunk extends LRUObject implements Persistable { + private static final Logger LOGGER = LoggerFactory.getLogger(ClusterStreamChunk.class); // 500KB is a fine chunk private static int MAX_CHUNK_SIZE = 500*1024; @@ -34,14 +36,14 @@ public class ClusterStreamChunk extends LRUObject im // Stub public ClusterStreamChunk(ClusterManager manager, LRU LRU, Path readDir, String id, int offset, int length) throws AcornAccessVerificationException { - super(LRU, id, readDir, "clusterStream", offset, length, false, false); + super(LRU, manager.getFileCache(), id, readDir, "clusterStream", offset, length, false, false); this.manager = manager; LRU.map(this); } // Creation public ClusterStreamChunk(ClusterManager manager, LRU LRU, String id) throws AcornAccessVerificationException { - super(LRU, id, LRU.getDirectory(), "clusterStream", true, true); + super(LRU, manager.getFileCache(), id, LRU.getDirectory(), "clusterStream", true, true); this.manager = manager; LRU.insert(this, accessTime); } @@ -57,8 +59,6 @@ public class ClusterStreamChunk extends LRUObject im if(op.ccs == null) throw new IllegalAcornStateException("Cluster ChangeSet " + ccsId + " was not found."); UndoClusterUpdateProcessor proc = new UndoClusterUpdateProcessor(clusters, this, op.ccs); - if(proc.version != ClusterChange.VERSION) - return null; // This cluster and CCS can still be under preparation => wait clusters.clusterLRU.ensureUpdates(proc.getClusterUID()); @@ -296,5 +296,9 @@ public class ClusterStreamChunk extends LRUObject im protected boolean overwrite() { return false; } - + + @Override + public Logger getLogger() { + return LOGGER; + } } \ No newline at end of file