]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.acorn/src/org/simantics/acorn/lru/ClusterStreamChunk.java
Fixing problems in the database unit testing environment with Acorn
[simantics/platform.git] / bundles / org.simantics.acorn / src / org / simantics / acorn / lru / ClusterStreamChunk.java
index 12d4d55b8cb20f92b79721d76d8df5ba3061ab3b..3fa5e327f918b039c0ddb0dc9adea85b1a3999ff 100644 (file)
@@ -9,7 +9,6 @@ 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;
@@ -37,14 +36,14 @@ public class ClusterStreamChunk extends LRUObject<String, ClusterStreamChunk> im
        
        // Stub
        public ClusterStreamChunk(ClusterManager manager, LRU<String, ClusterStreamChunk> 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<String, ClusterStreamChunk> 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);
        }
@@ -60,8 +59,6 @@ public class ClusterStreamChunk extends LRUObject<String, ClusterStreamChunk> 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());