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.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 gnu.trove.list.array.TByteArrayList;
public class ClusterStreamChunk extends LRUObject<String, ClusterStreamChunk> implements Persistable {
import gnu.trove.list.array.TByteArrayList;
public class ClusterStreamChunk extends LRUObject<String, ClusterStreamChunk> implements Persistable {
- public ClusterStreamChunk(ClusterManager manager, LRU<String, ClusterStreamChunk> LRU, Path readDir, String id, int offset, int length) {
+ 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);
this.manager = manager;
LRU.map(this);
}
// Creation
super(LRU, id, readDir, "clusterStream", offset, length, false, false);
this.manager = manager;
LRU.map(this);
}
// Creation
- public ClusterStreamChunk(ClusterManager manager, LRU<String, ClusterStreamChunk> LRU, String id) {
+ public ClusterStreamChunk(ClusterManager manager, LRU<String, ClusterStreamChunk> LRU, String id) throws AcornAccessVerificationException {
super(LRU, id, LRU.getDirectory(), "clusterStream", true, true);
this.manager = manager;
LRU.insert(this, accessTime);
super(LRU, id, LRU.getDirectory(), "clusterStream", true, true);
this.manager = manager;
LRU.insert(this, accessTime);
- if(op == null) throw new IllegalStateException("Cluster Update Operation " + ccsId + " was not found.");
- if(op.ccs == null) throw new IllegalStateException("Cluster ChangeSet " + ccsId + " was not found.");
+ if(op == null) throw new IllegalAcornStateException("Cluster Update Operation " + ccsId + " was not found.");
+ if(op.ccs == null) throw new IllegalAcornStateException("Cluster ChangeSet " + ccsId + " was not found.");
// This cluster and CCS can still be under preparation => wait
clusters.clusterLRU.ensureUpdates(proc.getClusterUID());
// This cluster and CCS can still be under preparation => wait
clusters.clusterLRU.ensureUpdates(proc.getClusterUID());
if(!super.canBePersisted()) return false;
if(!isCommitted()) return false;
for(ClusterUpdateOperation op : operations) {
if(!super.canBePersisted()) return false;
if(!isCommitted()) return false;
for(ClusterUpdateOperation op : operations) {