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%2Finternal%2FUndoClusterUpdateProcessor.java;h=e75e2e0ceae71ad77da44d013442b6f10a996e11;hp=8b3e4f066a4e53a6033bc4c9fc8892aacee3f6eb;hb=33b349001037197a526a49e5820f0317dc74d934;hpb=18211711f14cc26e828f7c35420eabde871a336a diff --git a/bundles/org.simantics.acorn/src/org/simantics/acorn/internal/UndoClusterUpdateProcessor.java b/bundles/org.simantics.acorn/src/org/simantics/acorn/internal/UndoClusterUpdateProcessor.java index 8b3e4f066..e75e2e0ce 100644 --- a/bundles/org.simantics.acorn/src/org/simantics/acorn/internal/UndoClusterUpdateProcessor.java +++ b/bundles/org.simantics.acorn/src/org/simantics/acorn/internal/UndoClusterUpdateProcessor.java @@ -13,17 +13,21 @@ import org.simantics.acorn.lru.ClusterChangeSet.Entry; import org.simantics.acorn.lru.ClusterChangeSet.Type; import org.simantics.db.exception.DatabaseException; import org.simantics.db.service.ClusterUID; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class UndoClusterUpdateProcessor extends ClusterUpdateProcessorBase { - + + private static final Logger LOGGER = LoggerFactory.getLogger(UndoClusterUpdateProcessor.class); + public final static boolean DEBUG = false; final private ClusterChangeSet ccs; - + private int oldValuesIndex = 0; private int statementMaskIndex = 0; - - final public List entries = new ArrayList(); + + final public List entries = new ArrayList<>(); public UndoClusterUpdateProcessor(ClusterManager client, ClusterStreamChunk chunk, ClusterChangeSet ccs) throws DatabaseException { super(client, readOperation(client, chunk, ccs)); @@ -31,27 +35,8 @@ public class UndoClusterUpdateProcessor extends ClusterUpdateProcessorBase { } private static byte[] readOperation(ClusterManager manager, ClusterStreamChunk chunk, ClusterChangeSet ccs) throws AcornAccessVerificationException, IllegalAcornStateException { - -// ClusterStreamChunk chunk; -// manager.streamLRU.acquireMutex(); -// try { -// chunk = ccs.getChunk(manager); -// } catch (Throwable t) { -// throw new IllegalStateException(t); -// } finally { -// manager.streamLRU.releaseMutex(); -// } -// -// chunk.acquireMutex(); -// try { -// chunk.ve - chunk.makeResident(); - return chunk.getOperation(ccs.chunkOffset); -// } catch (Throwable t) { -// throw new IllegalStateException(t); -// } finally { -// chunk.releaseMutex(); -// } + chunk.makeResident(); + return chunk.getOperation(ccs.chunkOffset); } @Override @@ -110,5 +95,10 @@ public class UndoClusterUpdateProcessor extends ClusterUpdateProcessorBase { } } - + + @Override + void setImmutable(boolean value) { + LOGGER.error("Attempted to undo `setImmutable({})` cluster operation for cluster {} which is not supported.", value, ccs.cuid); + } + }