summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-12-16 04:10:14 (EST)
committerEike Stepper2007-12-16 04:10:14 (EST)
commit09574ecf8bbaee059f2d5709d812a4163c273e6b (patch)
tree4084c0d595f4d194c812d1d05937ecce40d2da49
parent218b2440b6989eb5985f9b54ceac366d5711d289 (diff)
downloadcdo-09574ecf8bbaee059f2d5709d812a4163c273e6b.zip
cdo-09574ecf8bbaee059f2d5709d812a4163c273e6b.tar.gz
cdo-09574ecf8bbaee059f2d5709d812a4163c273e6b.tar.bz2
[201266] Send the revision delta to the server
https://bugs.eclipse.org/bugs/show_bug.cgi?id=201266
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/MEMStoreAccessor.java28
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Repository.java16
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/RevisionManager.java74
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Session.java5
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/SessionManager.java6
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/StoreAccessor.java7
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CommitTransactionIndication.java37
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/InvalidationRequest.java16
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadChunkIndication.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadRevisionIndication.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreChunkReader.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreWriter.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AllTests.java1
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ContentAdapterTest.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/FetchRuleAnalyzerTest.java1
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/RandomDeadLockTest.java1
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/RevisionDeltaTest.java98
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/RevisionHolderTest.java2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOInvalidationNotification.java1
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOTransaction.java4
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOTransactionHandler.java5
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOView.java4
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/analyzer/CDOFeatureAnalyzer.java1
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/analyzer/CDOFetchRuleManager.java1
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOCallbackImpl.java1
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOInvalidationNotificationImpl.java9
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOLegacyImpl.java9
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDORevisionManagerImpl.java3
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStateMachine.java39
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStore.java37
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOTransactionImpl.java41
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java8
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/analyzer/CDOAbstractFeatureRuleAnalyzer.java1
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/analyzer/CDOAnalyzerFeatureInfo.java1
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/analyzer/CDOClusterOfFetchRule.java1
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/analyzer/CDOFeatureAnalyzerModelBased.java4
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/analyzer/CDOFeatureAnalyzerUI.java4
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/analyzer/CDOFetchFeatureInfo.java1
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/analyzer/CDOFetchRuleManagerThreadLocal.java1
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/analyzer/NOOPFeatureAnalyzer.java1
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/analyzer/NOOPFetchRuleManager.java4
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CommitTransactionRequest.java20
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/CrossReferencesPackageClosure.java2
43 files changed, 426 insertions, 81 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/MEMStoreAccessor.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/MEMStoreAccessor.java
index 1d1056a..ae72f08 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/MEMStoreAccessor.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/MEMStoreAccessor.java
@@ -13,10 +13,12 @@ package org.eclipse.emf.cdo.internal.server;
import org.eclipse.emf.cdo.internal.protocol.model.CDOPackageImpl;
import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
+import org.eclipse.emf.cdo.internal.protocol.revision.delta.CDORevisionDeltaImpl;
import org.eclipse.emf.cdo.protocol.CDOID;
import org.eclipse.emf.cdo.protocol.model.CDOClassRef;
import org.eclipse.emf.cdo.protocol.model.CDOFeature;
import org.eclipse.emf.cdo.protocol.model.CDOPackageInfo;
+import org.eclipse.emf.cdo.protocol.revision.CDODuplicateRevisionException;
import org.eclipse.emf.cdo.protocol.revision.CDORevision;
import org.eclipse.emf.cdo.server.ISession;
import org.eclipse.emf.cdo.server.IStoreChunkReader;
@@ -26,14 +28,18 @@ import org.eclipse.emf.cdo.server.IView;
import org.eclipse.net4j.util.io.CloseableIterator;
import org.eclipse.net4j.util.transaction.ITransaction;
+import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
+import java.util.List;
/**
* @author Simon McDuff
*/
public class MEMStoreAccessor extends StoreAccessor
{
+ List<CDORevisionImpl> listToCommit = new ArrayList<CDORevisionImpl>();
+
public MEMStoreAccessor(MEMStore store, ISession session)
{
super(store, session);
@@ -125,7 +131,29 @@ public class MEMStoreAccessor extends StoreAccessor
getStore().addRevision(revision);
}
+ @Override
+ public void writeRevisionDelta(CDORevisionDeltaImpl delta)
+ {
+ CDORevisionImpl revision2 = (CDORevisionImpl)getStore().getRevision(delta.getId());
+ if (delta.getOriginVersion() != revision2.getVersion())
+ {
+ throw new CDODuplicateRevisionException(revision2);
+ }
+
+ CDORevisionImpl newRevision = new CDORevisionImpl(revision2);
+ delta.applyChanges(newRevision);
+ listToCommit.add(newRevision);
+ }
+
+ @Override
+ public void release()
+ {
+ for (CDORevisionImpl rev : listToCommit)
+ getStore().addRevision(rev);
+ }
+
public void rollback(IView view, ITransaction<IStoreWriter> storeTransaction)
{
+ listToCommit.clear();
}
}
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Repository.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Repository.java
index 9d2a6a5..1d2c9c1 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Repository.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Repository.java
@@ -7,6 +7,7 @@
*
* Contributors:
* Eike Stepper - initial API and implementation
+ * Simon McDuff - https://bugs.eclipse.org/bugs/show_bug.cgi?id=201266
**************************************************************************/
package org.eclipse.emf.cdo.internal.server;
@@ -32,6 +33,8 @@ public class Repository extends Container<IRepositoryElement> implements IReposi
{
public static final String PROP_OVERRIDE_UUID = "overrideUUID";
+ public static final String PROP_SUPPORTING_REVISION_DELTAS = "supportingRevisionDeltas";
+
public static final String PROP_SUPPORTING_AUDITS = "supportingAudits";
public static final String PROP_VERIFYING_REVISIONS = "verifyingRevisions";
@@ -52,6 +55,8 @@ public class Repository extends Container<IRepositoryElement> implements IReposi
private Map<String, String> properties;
+ private Boolean supportingRevisionDeltas;
+
private Boolean supportingAudits;
private Boolean verifyingRevisions;
@@ -122,6 +127,17 @@ public class Repository extends Container<IRepositoryElement> implements IReposi
this.properties = properties;
}
+ public boolean isSupportingRevisionDeltas()
+ {
+ if (supportingRevisionDeltas == null)
+ {
+ String value = getProperties().get(PROP_SUPPORTING_REVISION_DELTAS);
+ supportingRevisionDeltas = value == null ? false : Boolean.valueOf(value);
+ }
+
+ return supportingRevisionDeltas;
+ }
+
public boolean isSupportingAudits()
{
if (supportingAudits == null)
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/RevisionManager.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/RevisionManager.java
index cb82b02..8189523 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/RevisionManager.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/RevisionManager.java
@@ -7,7 +7,8 @@
*
* Contributors:
* Eike Stepper - initial API and implementation
- * Simon McDuff - bug 210868
+ * Simon McDuff - https://bugs.eclipse.org/bugs/show_bug.cgi?id=201266
+ * Simon McDuff - https://bugs.eclipse.org/bugs/show_bug.cgi?id=210868
**************************************************************************/
package org.eclipse.emf.cdo.internal.server;
@@ -18,9 +19,12 @@ import org.eclipse.emf.cdo.internal.protocol.model.resource.CDOPathFeatureImpl;
import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionResolverImpl;
import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl.MoveableList;
+import org.eclipse.emf.cdo.internal.protocol.revision.delta.CDORevisionDeltaImpl;
import org.eclipse.emf.cdo.protocol.CDOID;
import org.eclipse.emf.cdo.protocol.model.CDOFeature;
+import org.eclipse.emf.cdo.protocol.revision.CDODuplicateRevisionException;
import org.eclipse.emf.cdo.protocol.revision.CDOReferenceProxy;
+import org.eclipse.emf.cdo.protocol.revision.CDORevision;
import org.eclipse.emf.cdo.server.IRevisionManager;
import org.eclipse.emf.cdo.server.IStoreChunkReader;
import org.eclipse.emf.cdo.server.IStoreReader;
@@ -63,6 +67,11 @@ public class RevisionManager extends CDORevisionResolverImpl implements IRevisio
storeTransaction.execute(new AddRevisionOperation(revision));
}
+ public void writeRevisionDelta(ITransaction<IStoreWriter> storeTransaction, CDORevisionDeltaImpl revision)
+ {
+ storeTransaction.execute(new WriteRevisionOperation(revision));
+ }
+
public CDOID resolveReferenceProxy(CDOReferenceProxy referenceProxy)
{
throw new UnsupportedOperationException("Reference proxies not supported on server side");
@@ -304,4 +313,67 @@ public class RevisionManager extends CDORevisionResolverImpl implements IRevisio
{
}
}
+
+ /**
+ * @author Simon McDuff
+ */
+ private final class WriteRevisionOperation implements ITransactionalOperation<IStoreWriter>
+ {
+ private CDORevisionDeltaImpl revisionDelta;
+
+ private CDORevisionImpl dirtyRevision = null;
+
+ private WriteRevisionOperation(CDORevisionDeltaImpl revisionDelta)
+ {
+ this.revisionDelta = revisionDelta;
+ CDORevisionImpl oldRevision = getRevisionByVersion(revisionDelta.getId(), CDORevision.UNCHUNKED, revisionDelta
+ .getOriginVersion(), true);
+ if (oldRevision == null)
+ {
+ if (!getRepository().isSupportingRevisionDeltas())
+ {
+ throw new IllegalArgumentException("Cannot retrieved origin revision");
+ }
+ }
+ else
+ {
+ dirtyRevision = new CDORevisionImpl(oldRevision);
+ revisionDelta.applyChanges(dirtyRevision);
+ }
+ }
+
+ public void phase1(IStoreWriter storeWriter) throws Exception
+ {
+ if (getRepository().isSupportingRevisionDeltas())
+ {
+ // Can throw an exception if duplicate
+ storeWriter.writeRevisionDelta(revisionDelta);
+ }
+ else
+ {
+ storeWriter.writeRevision(dirtyRevision);
+ }
+
+ // Look if we already have it in our cache revision
+ CDORevisionImpl currentVersion = getRevisionByVersion(revisionDelta.getId(), 0, revisionDelta.getDirtyVersion(),
+ false);
+
+ if (currentVersion != null)
+ {
+ throw new CDODuplicateRevisionException(currentVersion);
+ }
+ }
+
+ public void phase2(IStoreWriter storeWriter)
+ {
+ if (dirtyRevision != null)
+ {
+ addRevision(dirtyRevision);
+ }
+ }
+
+ public void undoPhase1(IStoreWriter storeWriter)
+ {
+ }
+ }
}
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Session.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Session.java
index cb7eaaa..6c4b629 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Session.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Session.java
@@ -7,6 +7,7 @@
*
* Contributors:
* Eike Stepper - initial API and implementation
+ * Simon McDuff - https://bugs.eclipse.org/bugs/show_bug.cgi?id=201266
**************************************************************************/
package org.eclipse.emf.cdo.internal.server;
@@ -158,11 +159,11 @@ public class Session extends Container<IView> implements ISession, CDOIDProvider
throw new ImplementationError("Invalid kind: " + kind);
}
- public void notifyInvalidation(long timeStamp, CDORevisionImpl[] dirtyObjects)
+ public void notifyInvalidation(long timeStamp, CDOID[] dirtyIDs)
{
try
{
- new InvalidationRequest(protocol.getChannel(), timeStamp, dirtyObjects).send();
+ new InvalidationRequest(protocol.getChannel(), timeStamp, dirtyIDs).send();
}
catch (Exception ex)
{
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/SessionManager.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/SessionManager.java
index 01d9f46..b86944d 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/SessionManager.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/SessionManager.java
@@ -7,13 +7,14 @@
*
* Contributors:
* Eike Stepper - initial API and implementation
+ * Simon McDuff - https://bugs.eclipse.org/bugs/show_bug.cgi?id=201266
* Simon McDuff - https://bugs.eclipse.org/bugs/show_bug.cgi?id=202725
**************************************************************************/
package org.eclipse.emf.cdo.internal.server;
-import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
import org.eclipse.emf.cdo.internal.server.bundle.OM;
import org.eclipse.emf.cdo.internal.server.protocol.CDOServerProtocol;
+import org.eclipse.emf.cdo.protocol.CDOID;
import org.eclipse.emf.cdo.server.ISession;
import org.eclipse.emf.cdo.server.ISessionManager;
import org.eclipse.emf.cdo.server.SessionCreationException;
@@ -26,7 +27,6 @@ import java.util.Map;
/**
* @author Eike Stepper
- * @author Simon McDuff
*/
public class SessionManager extends Container<ISession> implements ISessionManager
{
@@ -103,7 +103,7 @@ public class SessionManager extends Container<ISession> implements ISessionManag
}
}
- public void notifyInvalidation(long timeStamp, CDORevisionImpl[] dirtyObjects, Session excludedSession)
+ public void notifyInvalidation(long timeStamp, CDOID[] dirtyObjects, Session excludedSession)
{
for (Session session : getSessions())
{
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/StoreAccessor.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/StoreAccessor.java
index 1377b95..950afed 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/StoreAccessor.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/StoreAccessor.java
@@ -7,10 +7,12 @@
*
* Contributors:
* Eike Stepper - initial API and implementation
+ * Simon McDuff - https://bugs.eclipse.org/bugs/show_bug.cgi?id=201266
**************************************************************************/
package org.eclipse.emf.cdo.internal.server;
import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
+import org.eclipse.emf.cdo.internal.protocol.revision.delta.CDORevisionDeltaImpl;
import org.eclipse.emf.cdo.protocol.CDOID;
import org.eclipse.emf.cdo.protocol.model.CDOClass;
import org.eclipse.emf.cdo.server.ISession;
@@ -88,4 +90,9 @@ public abstract class StoreAccessor implements IStoreWriter
{
return store.getNextCDOID();
}
+
+ public void writeRevisionDelta(CDORevisionDeltaImpl delta)
+ {
+ throw new UnsupportedOperationException();
+ }
}
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CommitTransactionIndication.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CommitTransactionIndication.java
index 911d599..436f779 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CommitTransactionIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CommitTransactionIndication.java
@@ -7,6 +7,7 @@
*
* Contributors:
* Eike Stepper - initial API and implementation
+ * Simon McDuff - https://bugs.eclipse.org/bugs/show_bug.cgi?id=201266
**************************************************************************/
package org.eclipse.emf.cdo.internal.server.protocol;
@@ -14,6 +15,7 @@ import org.eclipse.emf.cdo.internal.protocol.CDOIDImpl;
import org.eclipse.emf.cdo.internal.protocol.CDOIDRangeImpl;
import org.eclipse.emf.cdo.internal.protocol.model.CDOPackageImpl;
import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
+import org.eclipse.emf.cdo.internal.protocol.revision.delta.CDORevisionDeltaImpl;
import org.eclipse.emf.cdo.internal.server.PackageManager;
import org.eclipse.emf.cdo.internal.server.Repository;
import org.eclipse.emf.cdo.internal.server.RevisionManager;
@@ -61,7 +63,9 @@ public class CommitTransactionIndication extends CDOServerIndication
private CDORevisionImpl[] newObjects;
- private CDORevisionImpl[] dirtyObjects;
+ private CDORevisionDeltaImpl[] dirtyObjects;
+
+ private CDOID[] dirtyIDs;
private Map<CDOID, CDOID> idMappings = new HashMap<CDOID, CDOID>();
@@ -116,7 +120,9 @@ public class CommitTransactionIndication extends CDOServerIndication
addPackages(storeTransaction, newPackages);
addRevisions(storeTransaction, newResources);
addRevisions(storeTransaction, newObjects);
- addRevisions(storeTransaction, dirtyObjects);
+ writeRevisions(storeTransaction, dirtyObjects);
+ // addRevisions(storeTransaction, dirtyObjects);
+
storeTransaction.commit();
}
catch (RuntimeException ex)
@@ -151,9 +157,9 @@ public class CommitTransactionIndication extends CDOServerIndication
}
writeIDMappings(out);
- if (dirtyObjects.length > 0)
+ if (dirtyIDs.length > 0)
{
- getSessionManager().notifyInvalidation(timeStamp, dirtyObjects, getSession());
+ getSessionManager().notifyInvalidation(timeStamp, dirtyIDs, getSession());
}
}
}
@@ -218,7 +224,8 @@ public class CommitTransactionIndication extends CDOServerIndication
return readRevisions(in, storeWriter, size);
}
- private CDORevisionImpl[] readDirtyObjects(ExtendedDataInputStream in, IStoreWriter storeWriter) throws IOException
+ private CDORevisionDeltaImpl[] readDirtyObjects(ExtendedDataInputStream in, IStoreWriter storeWriter)
+ throws IOException
{
int size = in.readInt();
if (PROTOCOL.isEnabled())
@@ -226,7 +233,16 @@ public class CommitTransactionIndication extends CDOServerIndication
PROTOCOL.format("Reading {0} dirty objects", size);
}
- return readRevisions(in, storeWriter, size);
+ RevisionManager revisionManager = sessionPackageManager.getRepository().getRevisionManager();
+ CDORevisionDeltaImpl[] deltas = new CDORevisionDeltaImpl[size];
+ dirtyIDs = new CDOID[size];
+ for (int i = 0; i < size; i++)
+ {
+ deltas[i] = new CDORevisionDeltaImpl(in, transactionPackageManager);
+ dirtyIDs[i] = deltas[i].getId();
+ }
+
+ return deltas;
}
private CDORevisionImpl[] readRevisions(ExtendedDataInputStream in, IStoreWriter storeWriter, int size)
@@ -259,6 +275,15 @@ public class CommitTransactionIndication extends CDOServerIndication
}
}
+ private void writeRevisions(ITransaction<IStoreWriter> storeTransaction, CDORevisionDeltaImpl[] deltas)
+ {
+ for (CDORevisionDeltaImpl delta : deltas)
+ {
+ delta.adjustReferences(idMappings);
+ getRevisionManager().writeRevisionDelta(storeTransaction, delta);
+ }
+ }
+
private void mapTemporaryID(CDORevisionImpl revision, IStoreWriter storeWriter)
{
CDOID oldID = revision.getID();
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/InvalidationRequest.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/InvalidationRequest.java
index 84a24d4..b0b2085 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/InvalidationRequest.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/InvalidationRequest.java
@@ -7,12 +7,13 @@
*
* Contributors:
* Eike Stepper - initial API and implementation
+ * Simon McDuff - https://bugs.eclipse.org/bugs/show_bug.cgi?id=201266
**************************************************************************/
package org.eclipse.emf.cdo.internal.server.protocol;
import org.eclipse.emf.cdo.internal.protocol.CDOIDImpl;
-import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
import org.eclipse.emf.cdo.internal.server.bundle.OM;
+import org.eclipse.emf.cdo.protocol.CDOID;
import org.eclipse.emf.cdo.protocol.CDOProtocolConstants;
import org.eclipse.net4j.IChannel;
@@ -31,13 +32,13 @@ public class InvalidationRequest extends Request
private long timeStamp;
- private CDORevisionImpl[] dirtyObjects;
+ private CDOID[] dirtyIDs;
- public InvalidationRequest(IChannel channel, long timeStamp, CDORevisionImpl[] dirtyObjects)
+ public InvalidationRequest(IChannel channel, long timeStamp, CDOID[] dirtyIDs)
{
super(channel);
this.timeStamp = timeStamp;
- this.dirtyObjects = dirtyObjects;
+ this.dirtyIDs = dirtyIDs;
}
@Override
@@ -56,17 +57,16 @@ public class InvalidationRequest extends Request
out.writeLong(timeStamp);
- int size = dirtyObjects.length;
+ int size = dirtyIDs.length;
if (PROTOCOL.isEnabled())
{
PROTOCOL.format("Writing {0} IDs", size);
}
out.writeInt(size);
- for (int i = 0; i < dirtyObjects.length; i++)
+ for (int i = 0; i < dirtyIDs.length; i++)
{
- CDORevisionImpl dirty = dirtyObjects[i];
- CDOIDImpl.write(out, dirty.getID());
+ CDOIDImpl.write(out, dirtyIDs[i]);
}
}
}
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadChunkIndication.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadChunkIndication.java
index fe24129..af5fa2c 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadChunkIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadChunkIndication.java
@@ -7,7 +7,7 @@
*
* Contributors:
* Eike Stepper - initial API and implementation
- * Simon McDuff - bug 210868
+ * Simon McDuff - https://bugs.eclipse.org/bugs/show_bug.cgi?id=210868
**************************************************************************/
package org.eclipse.emf.cdo.internal.server.protocol;
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadRevisionIndication.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadRevisionIndication.java
index 6a3b7a9..0ac5a8b 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadRevisionIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadRevisionIndication.java
@@ -48,7 +48,7 @@ public class LoadRevisionIndication extends CDOReadIndication
protected Map<CDOClass, CDOFetchRule> fetchRules = new HashMap<CDOClass, CDOFetchRule>();
- protected CDOID contextID = CDOIDNull.NULL;
+ protected CDOID contextID = CDOID.NULL;
protected int loadRevisionCollectionChunkSize = 1;
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreChunkReader.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreChunkReader.java
index 4581628..c7476c3 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreChunkReader.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreChunkReader.java
@@ -7,7 +7,7 @@
*
* Contributors:
* Eike Stepper - initial API and implementation
- * Simon McDuff - bug 210868
+ * Simon McDuff - https://bugs.eclipse.org/bugs/show_bug.cgi?id=210868
**************************************************************************/
package org.eclipse.emf.cdo.server;
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreWriter.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreWriter.java
index 6a16917..1db1998 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreWriter.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreWriter.java
@@ -7,6 +7,7 @@
*
* Contributors:
* Eike Stepper - initial API and implementation
+ * Simon McDuff - https://bugs.eclipse.org/bugs/show_bug.cgi?id=201266
**************************************************************************/
package org.eclipse.emf.cdo.server;
@@ -15,6 +16,7 @@ import org.eclipse.emf.cdo.internal.protocol.model.CDOClassProxy;
import org.eclipse.emf.cdo.internal.protocol.model.CDOFeatureImpl;
import org.eclipse.emf.cdo.internal.protocol.model.CDOPackageImpl;
import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
+import org.eclipse.emf.cdo.internal.protocol.revision.delta.CDORevisionDeltaImpl;
import org.eclipse.emf.cdo.protocol.CDOID;
import org.eclipse.emf.cdo.protocol.model.CDOClass;
import org.eclipse.emf.cdo.protocol.model.CDOFeature;
@@ -46,6 +48,8 @@ public interface IStoreWriter extends IStoreReader
public void writeRevision(CDORevisionImpl revision);
+ public void writeRevisionDelta(CDORevisionDeltaImpl delta);
+
public CDOID primeNewObject(CDOClass cdoClass);
public void rollback(IView view, ITransaction<IStoreWriter> storeTransaction);
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AllTests.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AllTests.java
index 980d211..21ad874 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AllTests.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AllTests.java
@@ -33,6 +33,7 @@ public class AllTests
suite.addTestSuite(ChunkingWithMEMTest.class);
suite.addTestSuite(RandomDeadLockTest.class);
suite.addTestSuite(PackageRegistryTest.class);
+ suite.addTestSuite(RevisionDeltaTest.class);
// TODO suite.addTestSuite(GeneratedEcoreTest.class);
// $JUnit-END$
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ContentAdapterTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ContentAdapterTest.java
index f6cb888..593cc5d 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ContentAdapterTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ContentAdapterTest.java
@@ -125,7 +125,7 @@ public class ContentAdapterTest extends AbstractCDOTest
public CDOID getContext()
{
- return CDOIDNull.NULL;
+ return CDOID.NULL;
}
public void clear()
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/FetchRuleAnalyzerTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/FetchRuleAnalyzerTest.java
index 903d861..40a6e18 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/FetchRuleAnalyzerTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/FetchRuleAnalyzerTest.java
@@ -38,7 +38,6 @@ import java.util.List;
/**
* @see https://bugs.eclipse.org/bugs/show_bug.cgi?id=202063
* @author Simon McDuff
- * @author Eike Stepper
*/
public class FetchRuleAnalyzerTest extends AbstractCDOTest
{
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/RandomDeadLockTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/RandomDeadLockTest.java
index 72a9991..c4d16fb 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/RandomDeadLockTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/RandomDeadLockTest.java
@@ -17,7 +17,6 @@ import org.eclipse.emf.cdo.CDOTransaction;
/**
* @see https://bugs.eclipse.org/bugs/show_bug.cgi?id=201366
* @author Simon McDuff
- * @author Eike Stepper
*/
public class RandomDeadLockTest extends AbstractCDOTest
{
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/RevisionDeltaTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/RevisionDeltaTest.java
new file mode 100644
index 0000000..1b349ac
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/RevisionDeltaTest.java
@@ -0,0 +1,98 @@
+/***************************************************************************
+ * Copyright (c) 2004 - 2007 Eike Stepper, Germany.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Simon McDuff - initial API and implementation
+ * Eike Stepper - maintenance
+ **************************************************************************/
+package org.eclipse.emf.cdo.tests;
+
+import org.eclipse.emf.cdo.CDOSession;
+import org.eclipse.emf.cdo.CDOTransaction;
+import org.eclipse.emf.cdo.eresource.CDOResource;
+import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
+import org.eclipse.emf.cdo.internal.protocol.revision.delta.CDOListFeatureDeltaImpl;
+import org.eclipse.emf.cdo.protocol.revision.delta.CDOAddFeatureDelta;
+import org.eclipse.emf.cdo.protocol.revision.delta.CDOClearFeatureDelta;
+import org.eclipse.emf.cdo.protocol.revision.delta.CDORevisionDelta;
+import org.eclipse.emf.cdo.protocol.revision.delta.CDOSetFeatureDelta;
+import org.eclipse.emf.cdo.tests.model1.Category;
+import org.eclipse.emf.cdo.tests.model1.Company;
+import org.eclipse.emf.cdo.tests.model1.Model1Factory;
+import org.eclipse.emf.cdo.tests.model1.Model1Package;
+import org.eclipse.emf.cdo.util.CDOUtil;
+
+import org.eclipse.emf.internal.cdo.InternalCDOObject;
+
+/**
+ * @see https://bugs.eclipse.org/bugs/show_bug.cgi?id=201266
+ * @author Simon McDuff
+ */
+public class RevisionDeltaTest extends AbstractCDOTest
+{
+ public void testBasicRevisionDelta() throws Exception
+ {
+ CDOSession session = CDOUtil.openSession(getConnector(), REPOSITORY_NAME);
+ session.getPackageRegistry().putEPackage(Model1Package.eINSTANCE);
+
+ CDOTransaction transaction = session.openTransaction();
+ CDOResource resource1 = transaction.createResource("/test1");
+
+ Company company1 = Model1Factory.eINSTANCE.createCompany();
+ Category category1 = Model1Factory.eINSTANCE.createCategory();
+
+ resource1.getContents().add(company1);
+ company1.getCategories().add(category1);
+
+ company1.setName("TEST");
+ CDORevisionImpl rev1 = getCopyCDORevision(company1);
+
+ // Test simple attributes
+ company1.setName("TEST3");
+ CDORevisionImpl rev2 = getCopyCDORevision(company1);
+
+ CDORevisionDelta revisionDelta = rev2.createDelta(rev1);
+ assertEquals(1, revisionDelta.getFeatureDeltas().size());
+ CDOSetFeatureDelta setDelta = (CDOSetFeatureDelta)revisionDelta.getFeatureDeltas().get(0);
+ assertEquals("TEST3", setDelta.getValue());
+
+ // Test List clear
+ company1.getCategories().clear();
+ CDORevisionImpl rev3 = getCopyCDORevision(company1);
+
+ CDORevisionDelta revisionDelta3 = rev3.createDelta(rev2);
+ assertEquals(1, revisionDelta3.getFeatureDeltas().size());
+ CDOListFeatureDeltaImpl delta3List = (CDOListFeatureDeltaImpl)revisionDelta3.getFeatureDeltas().get(0);
+
+ assertEquals(1, delta3List.getListChanges().size());
+ assertEquals(true, delta3List.getListChanges().get(0) instanceof CDOClearFeatureDelta);
+
+ // Test List Add
+ for (int i = 0; i < 5; i++)
+ {
+ Category category = Model1Factory.eINSTANCE.createCategory();
+ company1.getCategories().add(category);
+ }
+ CDORevisionImpl rev4 = getCopyCDORevision(company1);
+
+ CDORevisionDelta revisionDelta4 = rev4.createDelta(rev3);
+ assertEquals(1, revisionDelta4.getFeatureDeltas().size());
+ CDOListFeatureDeltaImpl delta4List = (CDOListFeatureDeltaImpl)revisionDelta4.getFeatureDeltas().get(0);
+
+ assertEquals(5, delta4List.getListChanges().size());
+ assertEquals(true, delta4List.getListChanges().get(0) instanceof CDOAddFeatureDelta);
+ transaction.rollback(true);
+
+ transaction.close();
+ session.close();
+ }
+
+ private CDORevisionImpl getCopyCDORevision(Object object)
+ {
+ return new CDORevisionImpl((CDORevisionImpl)((InternalCDOObject)object).cdoRevision());
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/RevisionHolderTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/RevisionHolderTest.java
index 2176a10..49471f5 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/RevisionHolderTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/RevisionHolderTest.java
@@ -18,8 +18,8 @@ import org.eclipse.emf.cdo.protocol.CDOID;
import org.eclipse.emf.cdo.protocol.model.CDOClass;
import org.eclipse.emf.cdo.protocol.revision.CDORevision;
import org.eclipse.emf.cdo.protocol.revision.CDORevisionData;
-import org.eclipse.emf.cdo.protocol.revision.CDORevisionDelta;
import org.eclipse.emf.cdo.protocol.revision.CDORevisionResolver;
+import org.eclipse.emf.cdo.protocol.revision.delta.CDORevisionDelta;
import org.eclipse.net4j.tests.AbstractOMTest;
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOInvalidationNotification.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOInvalidationNotification.java
index f099d7c..e2ff82f 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOInvalidationNotification.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOInvalidationNotification.java
@@ -15,7 +15,6 @@ import org.eclipse.emf.common.notify.Notification;
/**
* @author Simon McDuff
- * @author Eike Stepper
*/
public interface CDOInvalidationNotification extends Notification
{
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOTransaction.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOTransaction.java
index ee4a56b..f641012 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOTransaction.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOTransaction.java
@@ -7,6 +7,7 @@
*
* Contributors:
* Eike Stepper - initial API and implementation
+ * Simon McDuff - https://bugs.eclipse.org/bugs/show_bug.cgi?id=201266
**************************************************************************/
package org.eclipse.emf.cdo;
@@ -14,6 +15,7 @@ import org.eclipse.emf.cdo.eresource.CDOResource;
import org.eclipse.emf.cdo.protocol.CDOID;
import org.eclipse.emf.cdo.protocol.model.CDOClass;
import org.eclipse.emf.cdo.protocol.model.CDOPackage;
+import org.eclipse.emf.cdo.protocol.revision.delta.CDORevisionDelta;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EClass;
@@ -55,4 +57,6 @@ public interface CDOTransaction extends CDOView
public Map<CDOID, CDOObject> getNewObjects();
public Map<CDOID, CDOObject> getDirtyObjects();
+
+ public Map<CDOID, CDORevisionDelta> getRevisionDeltas();
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOTransactionHandler.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOTransactionHandler.java
index 8769fa5..2014c79 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOTransactionHandler.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOTransactionHandler.java
@@ -7,9 +7,12 @@
*
* Contributors:
* Eike Stepper - initial API and implementation
+ * Simon McDuff - https://bugs.eclipse.org/bugs/show_bug.cgi?id=201266
**************************************************************************/
package org.eclipse.emf.cdo;
+import org.eclipse.emf.cdo.protocol.revision.delta.CDOFeatureDelta;
+
/**
* @author Eike Stepper
*/
@@ -27,7 +30,7 @@ public interface CDOTransactionHandler
* <p>
* Note: This method will be called at most once per object until the associated transaction is committed.
*/
- public void modifyingObject(CDOTransaction transaction, CDOObject object);
+ public void modifyingObject(CDOTransaction transaction, CDOObject object, CDOFeatureDelta featureDelta);
/**
* Called by a <code>CDOTransaction</code> <b>before</b> it is being committed. The implementor of this method is
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOView.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOView.java
index 9b1b798..6ea8fb3 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOView.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOView.java
@@ -7,7 +7,8 @@
*
* Contributors:
* Eike Stepper - initial API and implementation
- * Simon McDuff - EMF invalidation notifications
+ * Simon McDuff - https://bugs.eclipse.org/bugs/show_bug.cgi?id=201266
+ * Simon McDuff - https://bugs.eclipse.org/bugs/show_bug.cgi?id=201997
**************************************************************************/
package org.eclipse.emf.cdo;
@@ -22,7 +23,6 @@ import org.eclipse.net4j.util.event.INotifier;
/**
* @author Eike Stepper
- * @author Simon McDuff
*/
public interface CDOView extends INotifier
{
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/analyzer/CDOFeatureAnalyzer.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/analyzer/CDOFeatureAnalyzer.java
index ff2230b..2c4c3ca 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/analyzer/CDOFeatureAnalyzer.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/analyzer/CDOFeatureAnalyzer.java
@@ -18,7 +18,6 @@ import org.eclipse.emf.internal.cdo.analyzer.NOOPFeatureAnalyzer;
/**
* @author Simon McDuff
- * @author Eike Stepper
*/
public interface CDOFeatureAnalyzer
{
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/analyzer/CDOFetchRuleManager.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/analyzer/CDOFetchRuleManager.java
index 17965be..2af0390 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/analyzer/CDOFetchRuleManager.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/analyzer/CDOFetchRuleManager.java
@@ -21,7 +21,6 @@ import java.util.List;
/**
* @author Simon McDuff
- * @author Eike Stepper
*/
public interface CDOFetchRuleManager
{
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOCallbackImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOCallbackImpl.java
index bee9cc8..8c1620d 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOCallbackImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOCallbackImpl.java
@@ -44,6 +44,7 @@ public class CDOCallbackImpl extends CDOLegacyImpl implements CDOCallback
CDOStateMachine.INSTANCE.write(this);
}
+ @Override
public boolean isAdapterForType(Object type)
{
return type == CDOCallbackImpl.class;
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOInvalidationNotificationImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOInvalidationNotificationImpl.java
index e651892..0f42bbd 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOInvalidationNotificationImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOInvalidationNotificationImpl.java
@@ -18,7 +18,6 @@ import org.eclipse.emf.ecore.EObject;
/**
* @author Simon McDuff
- * @author Eike Stepper
*/
public class CDOInvalidationNotificationImpl implements CDOInvalidationNotification
{
@@ -56,26 +55,22 @@ public class CDOInvalidationNotificationImpl implements CDOInvalidationNotificat
public boolean wasSet()
{
- // TODO Clarify return value or throw UOE
throw new UnsupportedOperationException();
}
public boolean isReset()
{
- // TODO Clarify return value or throw UOE
throw new UnsupportedOperationException();
}
public boolean isTouch()
{
- // TODO Clarify return value or throw UOE
- return false;
+ throw new UnsupportedOperationException();
}
public boolean merge(Notification notification)
{
- // TODO Clarify return value or throw UOE
- return false;
+ throw new UnsupportedOperationException();
}
public boolean getNewBooleanValue()
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOLegacyImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOLegacyImpl.java
index 0ad8d3c..9aa3653 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOLegacyImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOLegacyImpl.java
@@ -7,6 +7,7 @@
*
* Contributors:
* Eike Stepper - initial API and implementation
+ * Simon McDuff - https://bugs.eclipse.org/bugs/show_bug.cgi?id=201266
**************************************************************************/
package org.eclipse.emf.internal.cdo;
@@ -162,6 +163,14 @@ public abstract class CDOLegacyImpl extends CDOWrapperImpl implements Adapter.In
public void cdoInternalPreCommit()
{
transferInstanceToRevision();
+
+ CDORevisionManagerImpl revisionManager = view.getSession().getRevisionManager();
+ CDORevisionImpl revision = cdoRevision();
+ CDORevisionImpl originRevision = revisionManager.getRevisionByVersion(revision.getID(), CDORevision.UNCHUNKED,
+ revision.getVersion() - 1, false);
+
+ CDOTransactionImpl transaction = cdoView().toTransaction();
+ transaction.registerRevisionDelta(this.cdoRevision().createDelta(originRevision));
}
public void cdoInternalPostLoad()
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDORevisionManagerImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDORevisionManagerImpl.java
index 8fcd5c1..e2a8e77 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDORevisionManagerImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDORevisionManagerImpl.java
@@ -18,6 +18,7 @@ import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl.MoveableLi
import org.eclipse.emf.cdo.protocol.CDOID;
import org.eclipse.emf.cdo.protocol.model.CDOFeature;
import org.eclipse.emf.cdo.protocol.revision.CDOReferenceProxy;
+import org.eclipse.emf.cdo.protocol.revision.CDORevision;
import org.eclipse.emf.cdo.protocol.util.TransportException;
import org.eclipse.emf.internal.cdo.bundle.OM;
@@ -64,7 +65,7 @@ public class CDORevisionManagerImpl extends CDORevisionResolverImpl implements C
// Get appropriate chunk size
int chunkSize = session.getReferenceChunkSize();
- if (chunkSize == CDORevisionImpl.UNCHUNKED)
+ if (chunkSize == CDORevision.UNCHUNKED)
{
// Can happen if CDOSession.setReferenceChunkSize() was called meanwhile
chunkSize = Integer.MAX_VALUE;
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStateMachine.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStateMachine.java
index e839a36..f4bf273 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStateMachine.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStateMachine.java
@@ -1,3 +1,14 @@
+/***************************************************************************
+ * Copyright (c) 2004 - 2007 Eike Stepper, Germany.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ * Simon McDuff - https://bugs.eclipse.org/bugs/show_bug.cgi?id=201266
+ **************************************************************************/
package org.eclipse.emf.internal.cdo;
import org.eclipse.emf.cdo.CDOSession;
@@ -8,6 +19,7 @@ import org.eclipse.emf.cdo.internal.protocol.model.CDOClassImpl;
import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
import org.eclipse.emf.cdo.protocol.CDOID;
import org.eclipse.emf.cdo.protocol.revision.CDORevision;
+import org.eclipse.emf.cdo.protocol.revision.delta.CDOFeatureDelta;
import org.eclipse.emf.cdo.protocol.util.TransportException;
import org.eclipse.emf.cdo.util.CDOUtil;
import org.eclipse.emf.cdo.util.ServerException;
@@ -94,7 +106,7 @@ public final class CDOStateMachine extends FiniteStateMachine<CDOState, CDOEvent
init(CDOState.DIRTY, CDOEvent.ATTACH, FAIL);
init(CDOState.DIRTY, CDOEvent.DETACH, FAIL);
init(CDOState.DIRTY, CDOEvent.READ, IGNORE);
- init(CDOState.DIRTY, CDOEvent.WRITE, IGNORE);
+ init(CDOState.DIRTY, CDOEvent.WRITE, new RewriteTransition());
init(CDOState.DIRTY, CDOEvent.INVALIDATE, new ConflictTransition());
init(CDOState.DIRTY, CDOEvent.RELOAD, new ReloadTransition());
init(CDOState.DIRTY, CDOEvent.COMMIT, new CommitTransition());
@@ -151,8 +163,13 @@ public final class CDOStateMachine extends FiniteStateMachine<CDOState, CDOEvent
public void write(InternalCDOObject object)
{
+ write(object, null);
+ }
+
+ public void write(InternalCDOObject object, CDOFeatureDelta featureChange)
+ {
if (TRACER.isEnabled()) trace(object, CDOEvent.WRITE);
- process(object, CDOEvent.WRITE, null);
+ process(object, CDOEvent.WRITE, featureChange);
}
public void reload(InternalCDOObject... objects)
@@ -387,7 +404,7 @@ public final class CDOStateMachine extends FiniteStateMachine<CDOState, CDOEvent
*/
private final class WriteTransition implements ITransition<CDOState, CDOEvent, InternalCDOObject, Object>
{
- public void execute(InternalCDOObject object, CDOState state, CDOEvent event, Object NULL)
+ public void execute(InternalCDOObject object, CDOState state, CDOEvent event, Object featureChange)
{
// Copy revision
CDORevisionImpl revision = new CDORevisionImpl((CDORevisionImpl)object.cdoRevision());
@@ -396,13 +413,25 @@ public final class CDOStateMachine extends FiniteStateMachine<CDOState, CDOEvent
CDOViewImpl view = (CDOViewImpl)object.cdoView();
CDOTransactionImpl transaction = view.toTransaction();
- transaction.registerDirty(object);
-
+ transaction.registerDirty(object, (CDOFeatureDelta)featureChange);
changeState(object, CDOState.DIRTY);
}
}
/**
+ * @author Simon McDuff
+ */
+ private final class RewriteTransition implements ITransition<CDOState, CDOEvent, InternalCDOObject, Object>
+ {
+ public void execute(InternalCDOObject object, CDOState state, CDOEvent event, Object featureChange)
+ {
+ CDOViewImpl view = (CDOViewImpl)object.cdoView();
+ CDOTransactionImpl transaction = view.toTransaction();
+ transaction.registerFeatureDelta(object, (CDOFeatureDelta)featureChange);
+ }
+ }
+
+ /**
* @author Eike Stepper
*/
private final class ReloadTransition implements ITransition<CDOState, CDOEvent, InternalCDOObject, Object>
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStore.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStore.java
index 8eaf1cf..42f5aec 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStore.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStore.java
@@ -7,15 +7,24 @@
*
* Contributors:
* Eike Stepper - initial API and implementation
+ * Simon McDuff - https://bugs.eclipse.org/bugs/show_bug.cgi?id=201266
**************************************************************************/
package org.eclipse.emf.internal.cdo;
import org.eclipse.emf.cdo.internal.protocol.model.CDOFeatureImpl;
import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl.MoveableList;
+import org.eclipse.emf.cdo.internal.protocol.revision.delta.CDOAddFeatureDeltaImpl;
+import org.eclipse.emf.cdo.internal.protocol.revision.delta.CDOClearFeatureDeltaImpl;
+import org.eclipse.emf.cdo.internal.protocol.revision.delta.CDOContainerFeatureDeltaImpl;
+import org.eclipse.emf.cdo.internal.protocol.revision.delta.CDOMoveFeatureDeltaImpl;
+import org.eclipse.emf.cdo.internal.protocol.revision.delta.CDORemoveFeatureDeltaImpl;
+import org.eclipse.emf.cdo.internal.protocol.revision.delta.CDOSetFeatureDeltaImpl;
+import org.eclipse.emf.cdo.internal.protocol.revision.delta.CDOUnsetFeatureDeltaImpl;
import org.eclipse.emf.cdo.protocol.CDOID;
import org.eclipse.emf.cdo.protocol.model.CDOFeature;
import org.eclipse.emf.cdo.protocol.revision.CDOReferenceProxy;
+import org.eclipse.emf.cdo.protocol.revision.delta.CDOFeatureDelta;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
@@ -61,7 +70,8 @@ public final class CDOStore implements EStore
CDOID containerID = (CDOID)((CDOViewImpl)cdoObject.cdoView()).convertObjectToID(newContainer);
- CDORevisionImpl revision = getRevisionForWriting(cdoObject);
+ CDOContainerFeatureDeltaImpl delta = new CDOContainerFeatureDeltaImpl(containerID, newContainerFeatureID);
+ CDORevisionImpl revision = getRevisionForWriting(cdoObject, delta);
revision.setContainerID(containerID);
revision.setContainingFeature(newContainerFeatureID);
}
@@ -338,7 +348,8 @@ public final class CDOStore implements EStore
TRACER.format("set({0}, {1}, {2}, {3})", cdoObject, cdoFeature, index, value);
}
- CDORevisionImpl revision = getRevisionForWriting(cdoObject);
+ CDOSetFeatureDeltaImpl delta = new CDOSetFeatureDeltaImpl(cdoFeature, index, value);
+ CDORevisionImpl revision = getRevisionForWriting(cdoObject, delta);
if (cdoFeature.isReference())
{
Object oldValue = revision.get(cdoFeature, index);
@@ -351,11 +362,10 @@ public final class CDOStore implements EStore
{
handleContainmentAdd(cdoObject, cdoFeature, value);
}
-
- value = ((CDOViewImpl)cdoObject.cdoView()).convertObjectToID(value);
}
Object result = revision.set(cdoFeature, index, value);
+
if (cdoFeature.isReference())
{
result = ((CDOViewImpl)cdoObject.cdoView()).convertIDToObject(result);
@@ -373,7 +383,8 @@ public final class CDOStore implements EStore
TRACER.format("unset({0}, {1})", cdoObject, cdoFeature);
}
- CDORevisionImpl revision = getRevisionForWriting(cdoObject);
+ CDOUnsetFeatureDeltaImpl delta = new CDOUnsetFeatureDeltaImpl(cdoFeature);
+ CDORevisionImpl revision = getRevisionForWriting(cdoObject, delta);
revision.unset(cdoFeature);
}
@@ -396,7 +407,8 @@ public final class CDOStore implements EStore
value = ((CDOViewImpl)cdoObject.cdoView()).convertObjectToID(value);
}
- CDORevisionImpl revision = getRevisionForWriting(cdoObject);
+ CDOAddFeatureDeltaImpl delta = new CDOAddFeatureDeltaImpl(cdoFeature, index, value);
+ CDORevisionImpl revision = getRevisionForWriting(cdoObject, delta);
revision.add(cdoFeature, index, value);
}
@@ -409,7 +421,8 @@ public final class CDOStore implements EStore
TRACER.format("remove({0}, {1}, {2})", cdoObject, cdoFeature, index);
}
- CDORevisionImpl revision = getRevisionForWriting(cdoObject);
+ CDORemoveFeatureDeltaImpl delta = new CDORemoveFeatureDeltaImpl(cdoFeature, index);
+ CDORevisionImpl revision = getRevisionForWriting(cdoObject, delta);
Object result = revision.remove(cdoFeature, index);
if (cdoFeature.isReference())
{
@@ -433,7 +446,8 @@ public final class CDOStore implements EStore
TRACER.format("clear({0}, {1})", cdoObject, cdoFeature);
}
- CDORevisionImpl revision = getRevisionForWriting(cdoObject);
+ CDOClearFeatureDeltaImpl delta = new CDOClearFeatureDeltaImpl(cdoFeature);
+ CDORevisionImpl revision = getRevisionForWriting(cdoObject, delta);
revision.clear(cdoFeature);
}
@@ -446,7 +460,8 @@ public final class CDOStore implements EStore
TRACER.format("move({0}, {1}, {2}, {3})", cdoObject, cdoFeature, target, source);
}
- CDORevisionImpl revision = getRevisionForWriting(cdoObject);
+ CDOMoveFeatureDeltaImpl delta = new CDOMoveFeatureDeltaImpl(cdoFeature, target, source);
+ CDORevisionImpl revision = getRevisionForWriting(cdoObject, delta);
Object result = revision.move(cdoFeature, target, source);
if (cdoFeature.isReference())
{
@@ -495,9 +510,9 @@ public final class CDOStore implements EStore
return getRevision(cdoObject);
}
- private static CDORevisionImpl getRevisionForWriting(InternalCDOObject cdoObject)
+ private static CDORevisionImpl getRevisionForWriting(InternalCDOObject cdoObject, CDOFeatureDelta delta)
{
- CDOStateMachine.INSTANCE.write(cdoObject);
+ CDOStateMachine.INSTANCE.write(cdoObject, delta);
return getRevision(cdoObject);
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOTransactionImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOTransactionImpl.java
index 151e54f..eff78db 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOTransactionImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOTransactionImpl.java
@@ -7,6 +7,7 @@
*
* Contributors:
* Eike Stepper - initial API and implementation
+ * Simon McDuff - https://bugs.eclipse.org/bugs/show_bug.cgi?id=201266
**************************************************************************/
package org.eclipse.emf.internal.cdo;
@@ -20,8 +21,11 @@ import org.eclipse.emf.cdo.eresource.CDOResource;
import org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl;
import org.eclipse.emf.cdo.internal.protocol.CDOIDImpl;
import org.eclipse.emf.cdo.internal.protocol.model.CDOPackageImpl;
+import org.eclipse.emf.cdo.internal.protocol.revision.delta.CDORevisionDeltaImpl;
import org.eclipse.emf.cdo.protocol.CDOID;
import org.eclipse.emf.cdo.protocol.model.CDOPackage;
+import org.eclipse.emf.cdo.protocol.revision.delta.CDOFeatureDelta;
+import org.eclipse.emf.cdo.protocol.revision.delta.CDORevisionDelta;
import org.eclipse.emf.cdo.util.CDOUtil;
import org.eclipse.emf.common.util.URI;
@@ -72,6 +76,8 @@ public class CDOTransactionImpl extends CDOViewImpl implements CDOTransaction
private Map<CDOID, CDOObject> dirtyObjects = new HashMap<CDOID, CDOObject>();
+ private Map<CDOID, CDORevisionDelta> revisionDeltas = new HashMap<CDOID, CDORevisionDelta>();
+
private boolean dirty;
private boolean conflict;
@@ -150,6 +156,11 @@ public class CDOTransactionImpl extends CDOViewImpl implements CDOTransaction
return dirtyObjects;
}
+ public Map<CDOID, CDORevisionDelta> getRevisionDeltas()
+ {
+ return revisionDeltas;
+ }
+
public CDOID getNextTemporaryID()
{
long id = nextTemporaryID;
@@ -298,18 +309,39 @@ public class CDOTransactionImpl extends CDOViewImpl implements CDOTransaction
}
}
- public void registerDirty(InternalCDOObject object)
+ public void registerFeatureDelta(InternalCDOObject object, CDOFeatureDelta featureDelta)
{
- if (TRACER.isEnabled())
+ CDORevisionDeltaImpl revisionDelta = (CDORevisionDeltaImpl)revisionDeltas.get(object.cdoID());
+ if (revisionDelta == null)
{
- TRACER.format("Registering dirty object {0}", object);
+ revisionDelta = new CDORevisionDeltaImpl(object.cdoRevision());
+ revisionDeltas.put(object.cdoID(), revisionDelta);
}
+ revisionDelta.addFeatureDelta(featureDelta);
for (CDOTransactionHandler handler : getHandlers())
{
- handler.modifyingObject(this, object);
+ handler.modifyingObject(this, object, featureDelta);
+ }
+ }
+
+ public void registerRevisionDelta(CDORevisionDelta delta)
+ {
+ CDORevisionDelta changeSet = revisionDeltas.get(delta.getId());
+ if (changeSet == null)
+ {
+ revisionDeltas.put(delta.getId(), changeSet);
+ }
+ }
+
+ public void registerDirty(InternalCDOObject object, CDOFeatureDelta featureDelta)
+ {
+ if (TRACER.isEnabled())
+ {
+ TRACER.format("Registering dirty object {0}", object);
}
+ registerFeatureDelta(object, featureDelta);
register(dirtyObjects, object);
}
@@ -402,6 +434,7 @@ public class CDOTransactionImpl extends CDOViewImpl implements CDOTransaction
newResources.clear();
newObjects.clear();
dirtyObjects.clear();
+ revisionDeltas.clear();
dirty = false;
conflict = false;
nextTemporaryID = INITIAL_TEMPORARY_ID;
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java
index b20ce0e..64b3b9d 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java
@@ -7,9 +7,10 @@
*
* Contributors:
* Eike Stepper - initial API and implementation
- * Simon McDuff - EMF invalidation notifications,
- * IFeatureAnalyzer,
- * LoadRevisionCollectionChunk
+ * Simon McDuff - https://bugs.eclipse.org/bugs/show_bug.cgi?id=201265
+ * Simon McDuff - https://bugs.eclipse.org/bugs/show_bug.cgi?id=201266
+ * Simon McDuff - https://bugs.eclipse.org/bugs/show_bug.cgi?id=201997
+ * Simon McDuff - https://bugs.eclipse.org/bugs/show_bug.cgi?id=202064
**************************************************************************/
package org.eclipse.emf.internal.cdo;
@@ -64,7 +65,6 @@ import java.util.concurrent.ConcurrentMap;
/**
* @author Eike Stepper
- * @author Simon McDuff
*/
public class CDOViewImpl extends org.eclipse.net4j.internal.util.event.Notifier implements CDOView, CDOIDProvider,
Adapter.Internal
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/analyzer/CDOAbstractFeatureRuleAnalyzer.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/analyzer/CDOAbstractFeatureRuleAnalyzer.java
index a45c11e..72b2915 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/analyzer/CDOAbstractFeatureRuleAnalyzer.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/analyzer/CDOAbstractFeatureRuleAnalyzer.java
@@ -22,7 +22,6 @@ import org.eclipse.net4j.internal.util.om.trace.ContextTracer;
/**
* @author Simon McDuff
- * @author Eike Stepper
*/
public abstract class CDOAbstractFeatureRuleAnalyzer implements CDOFeatureAnalyzer, CDOFetchRuleManager
{
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/analyzer/CDOAnalyzerFeatureInfo.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/analyzer/CDOAnalyzerFeatureInfo.java
index e202fdc..ab32620 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/analyzer/CDOAnalyzerFeatureInfo.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/analyzer/CDOAnalyzerFeatureInfo.java
@@ -26,7 +26,6 @@ import java.util.Map;
/**
* @author Simon McDuff
- * @author Eike Stepper
*/
public class CDOAnalyzerFeatureInfo
{
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/analyzer/CDOClusterOfFetchRule.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/analyzer/CDOClusterOfFetchRule.java
index 803d30c..2c4c5be 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/analyzer/CDOClusterOfFetchRule.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/analyzer/CDOClusterOfFetchRule.java
@@ -16,7 +16,6 @@ import org.eclipse.emf.cdo.protocol.model.CDOFeature;
/**
* @author Simon McDuff
- * @author Eike Stepper
*/
public class CDOClusterOfFetchRule
{
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/analyzer/CDOFeatureAnalyzerModelBased.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/analyzer/CDOFeatureAnalyzerModelBased.java
index afda4ae..4369327 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/analyzer/CDOFeatureAnalyzerModelBased.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/analyzer/CDOFeatureAnalyzerModelBased.java
@@ -11,7 +11,6 @@
**************************************************************************/
package org.eclipse.emf.internal.cdo.analyzer;
-import org.eclipse.emf.cdo.internal.protocol.CDOIDNull;
import org.eclipse.emf.cdo.protocol.CDOID;
import org.eclipse.emf.cdo.protocol.analyzer.CDOFetchRule;
import org.eclipse.emf.cdo.protocol.model.CDOFeature;
@@ -24,7 +23,6 @@ import java.util.List;
/**
* @author Simon McDuff
- * @author Eike Stepper
*/
public class CDOFeatureAnalyzerModelBased extends CDOAbstractFeatureRuleAnalyzer
{
@@ -50,7 +48,7 @@ public class CDOFeatureAnalyzerModelBased extends CDOAbstractFeatureRuleAnalyzer
public CDOID getContext()
{
- return CDOIDNull.NULL;
+ return CDOID.NULL;
}
public List<CDOFetchRule> getFetchRules(Collection<CDOID> ids)
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/analyzer/CDOFeatureAnalyzerUI.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/analyzer/CDOFeatureAnalyzerUI.java
index bc52914..bb68698 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/analyzer/CDOFeatureAnalyzerUI.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/analyzer/CDOFeatureAnalyzerUI.java
@@ -11,7 +11,6 @@
**************************************************************************/
package org.eclipse.emf.internal.cdo.analyzer;
-import org.eclipse.emf.cdo.internal.protocol.CDOIDNull;
import org.eclipse.emf.cdo.protocol.CDOID;
import org.eclipse.emf.cdo.protocol.analyzer.CDOFetchRule;
import org.eclipse.emf.cdo.protocol.model.CDOClass;
@@ -27,7 +26,6 @@ import java.util.Map;
/**
* @author Simon McDuff
- * @author Eike Stepper
*/
public class CDOFeatureAnalyzerUI extends CDOAbstractFeatureRuleAnalyzer
{
@@ -53,7 +51,7 @@ public class CDOFeatureAnalyzerUI extends CDOAbstractFeatureRuleAnalyzer
{
if (this.lastTraverseFeature.isMany())
{
- return CDOIDNull.NULL;
+ return CDOID.NULL;
}
return lastTraverseCDOObject.cdoID();
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/analyzer/CDOFetchFeatureInfo.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/analyzer/CDOFetchFeatureInfo.java
index 7d71f4f..42a22ef 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/analyzer/CDOFetchFeatureInfo.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/analyzer/CDOFetchFeatureInfo.java
@@ -16,7 +16,6 @@ import org.eclipse.emf.cdo.protocol.model.CDOFeature;
/**
* @author Simon McDuff
- * @author Eike Stepper
*/
public class CDOFetchFeatureInfo
{
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/analyzer/CDOFetchRuleManagerThreadLocal.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/analyzer/CDOFetchRuleManagerThreadLocal.java
index b7b7407..e2d8eb1 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/analyzer/CDOFetchRuleManagerThreadLocal.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/analyzer/CDOFetchRuleManagerThreadLocal.java
@@ -20,7 +20,6 @@ import java.util.List;
/**
* @author Simon McDuff
- * @author Eike Stepper
*/
public class CDOFetchRuleManagerThreadLocal implements CDOFetchRuleManager
{
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/analyzer/NOOPFeatureAnalyzer.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/analyzer/NOOPFeatureAnalyzer.java
index dbd06ac..dc4672e 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/analyzer/NOOPFeatureAnalyzer.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/analyzer/NOOPFeatureAnalyzer.java
@@ -18,7 +18,6 @@ import org.eclipse.emf.internal.cdo.InternalCDOObject;
/**
* @author Simon McDuff
- * @author Eike Stepper
*/
public class NOOPFeatureAnalyzer implements CDOFeatureAnalyzer
{
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/analyzer/NOOPFetchRuleManager.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/analyzer/NOOPFetchRuleManager.java
index 067a75f..583f627 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/analyzer/NOOPFetchRuleManager.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/analyzer/NOOPFetchRuleManager.java
@@ -12,7 +12,6 @@
package org.eclipse.emf.internal.cdo.analyzer;
import org.eclipse.emf.cdo.analyzer.CDOFetchRuleManager;
-import org.eclipse.emf.cdo.internal.protocol.CDOIDNull;
import org.eclipse.emf.cdo.protocol.CDOID;
import org.eclipse.emf.cdo.protocol.analyzer.CDOFetchRule;
@@ -21,7 +20,6 @@ import java.util.List;
/**
* @author Simon McDuff
- * @author Eike Stepper
*/
public class NOOPFetchRuleManager implements CDOFetchRuleManager
{
@@ -31,7 +29,7 @@ public class NOOPFetchRuleManager implements CDOFetchRuleManager
public CDOID getContext()
{
- return CDOIDNull.NULL;
+ return CDOID.NULL;
}
public List<CDOFetchRule> getFetchRules(Collection<CDOID> ids)
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CommitTransactionRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CommitTransactionRequest.java
index 5381d3b..e8d8717 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CommitTransactionRequest.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CommitTransactionRequest.java
@@ -7,6 +7,7 @@
*
* Contributors:
* Eike Stepper - initial API and implementation
+ * Simon McDuff - https://bugs.eclipse.org/bugs/show_bug.cgi?id=201266
**************************************************************************/
package org.eclipse.emf.internal.cdo.protocol;
@@ -16,11 +17,13 @@ import org.eclipse.emf.cdo.internal.protocol.CDOIDImpl;
import org.eclipse.emf.cdo.internal.protocol.CDOIDRangeImpl;
import org.eclipse.emf.cdo.internal.protocol.model.CDOPackageImpl;
import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
+import org.eclipse.emf.cdo.internal.protocol.revision.delta.CDORevisionDeltaImpl;
import org.eclipse.emf.cdo.protocol.CDOID;
import org.eclipse.emf.cdo.protocol.CDOIDRange;
import org.eclipse.emf.cdo.protocol.CDOProtocolConstants;
import org.eclipse.emf.cdo.protocol.model.CDOPackage;
import org.eclipse.emf.cdo.protocol.revision.CDORevision;
+import org.eclipse.emf.cdo.protocol.revision.delta.CDORevisionDelta;
import org.eclipse.emf.internal.cdo.CDOTransactionImpl;
import org.eclipse.emf.internal.cdo.InternalCDOObject;
@@ -64,7 +67,7 @@ public class CommitTransactionRequest extends CDOClientRequest<CommitTransaction
writeNewPackages(out);
writeNewResources(out);
writeNewObjects(out);
- writeDirtyObjects(out);
+ writeRevisionDeltas(out);
}
@Override
@@ -159,6 +162,21 @@ public class CommitTransactionRequest extends CDOClientRequest<CommitTransaction
writeRevisions(out, dirtyObjects);
}
+ private void writeRevisionDeltas(ExtendedDataOutputStream out) throws IOException
+ {
+ Collection<CDORevisionDelta> revisionDeltas = transaction.getRevisionDeltas().values();
+ if (PROTOCOL.isEnabled())
+ {
+ PROTOCOL.format("Writing {0} revision deltas", revisionDeltas.size());
+ }
+
+ out.writeInt(revisionDeltas.size());
+ for (CDORevisionDelta revisionDelta : revisionDeltas)
+ {
+ ((CDORevisionDeltaImpl)revisionDelta).write(out, transaction);
+ }
+ }
+
private void writeRevisions(ExtendedDataOutputStream out, Collection<?> objects) throws IOException
{
out.writeInt(objects.size());
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/CrossReferencesPackageClosure.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/CrossReferencesPackageClosure.java
index b56dbea..6998d77 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/CrossReferencesPackageClosure.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/CrossReferencesPackageClosure.java
@@ -27,6 +27,7 @@ public class CrossReferencesPackageClosure extends PackageClosure
{
}
+ @Override
public Set<EPackage> calculate(EPackage ePackage)
{
Set<EPackage> visited = new HashSet<EPackage>();
@@ -34,6 +35,7 @@ public class CrossReferencesPackageClosure extends PackageClosure
return visited;
}
+ @Override
protected void collectContents(EPackage ePackage, Set<EPackage> visited)
{
visited.add(ePackage);