summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-09-03 06:07:35 (EDT)
committerEike Stepper2007-09-03 06:07:35 (EDT)
commit07efade9da0b69feed8375afbd11930bf95fe1a8 (patch)
treee91ad9bd89e84e3016aa0c9bb9bc2fd40e0de42c
parent5368723bff0dab3646e52200b739a3d7a622cb55 (diff)
downloadcdo-07efade9da0b69feed8375afbd11930bf95fe1a8.zip
cdo-07efade9da0b69feed8375afbd11930bf95fe1a8.tar.gz
cdo-07efade9da0b69feed8375afbd11930bf95fe1a8.tar.bz2
[201265] Handling large collections by loading CDOIDs in chunks
https://bugs.eclipse.org/bugs/show_bug.cgi?id=201265
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IMapping.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreAccessor.java22
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/NoMapping.java6
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/RootMapping.java10
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ValueMapping.java10
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/RevisionManager.java30
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CDOReadIndication.java3
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CDOServerIndication.java11
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CDOServerProtocol.java6
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CommitTransactionIndication.java7
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadChunkIndication.java7
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadPackageIndication.java7
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadRevisionByTimeIndication.java57
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadRevisionByVersionIndication.java58
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadRevisionIndication.java35
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/ResourceIDIndication.java7
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/ResourcePathIndication.java7
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreReader.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/TDD.java2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOAuditImpl.java2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDORevisionManagerImpl.java101
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CDOClientRequest.java11
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CommitTransactionRequest.java8
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LoadChunkRequest.java8
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LoadPackageRequest.java8
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LoadRevisionByTimeRequest.java56
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LoadRevisionByVersionRequest.java56
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LoadRevisionRequest.java25
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/ResourceIDRequest.java8
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/ResourcePathRequest.java8
30 files changed, 481 insertions, 103 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IMapping.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IMapping.java
index fdc9463..2e6eefa 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IMapping.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IMapping.java
@@ -32,5 +32,7 @@ public interface IMapping
public void readRevision(IDBStoreAccessor storeAccessor, CDORevisionImpl revision);
- public void readRevision(IDBStoreAccessor storeAccessor, CDORevisionImpl revision, long timeStamp);
+ public void readRevisionByTime(IDBStoreAccessor storeAccessor, CDORevisionImpl revision, long timeStamp);
+
+ public void readRevisionByVersion(IDBStoreAccessor storeAccessor, CDORevisionImpl revision, int version);
}
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreAccessor.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreAccessor.java
index 2fdd059..e3f7436 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreAccessor.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreAccessor.java
@@ -427,11 +427,11 @@ public class DBStoreAccessor implements IDBStoreAccessor
return revision;
}
- public CDORevision readRevision(CDOID id, long timeStamp)
+ public CDORevision readRevisionByTime(CDOID id, long timeStamp)
{
if (TRACER.isEnabled())
{
- TRACER.format("Selecting revision: {0}, {1,date} {1,time}", id, timeStamp);
+ TRACER.format("Selecting revision: {0}, timestamp={1,date} {1,time}", id, timeStamp);
}
IRevisionManager revisionManager = store.getRepository().getRevisionManager();
@@ -439,7 +439,23 @@ public class DBStoreAccessor implements IDBStoreAccessor
CDORevisionImpl revision = new CDORevisionImpl(revisionManager, cdoClass, id);
IMapping mapping = ClassServerInfo.getMapping(cdoClass);
- mapping.readRevision(this, revision, timeStamp);
+ mapping.readRevisionByTime(this, revision, timeStamp);
+ return revision;
+ }
+
+ public CDORevision readRevisionByVersion(CDOID id, int version)
+ {
+ if (TRACER.isEnabled())
+ {
+ TRACER.format("Selecting revision: {0}, version={1}", id, version);
+ }
+
+ IRevisionManager revisionManager = store.getRepository().getRevisionManager();
+ CDOClassImpl cdoClass = getObjectType(id);
+ CDORevisionImpl revision = new CDORevisionImpl(revisionManager, cdoClass, id);
+
+ IMapping mapping = ClassServerInfo.getMapping(cdoClass);
+ mapping.readRevisionByVersion(this, revision, version);
return revision;
}
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/NoMapping.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/NoMapping.java
index f7897d4..e6163ec 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/NoMapping.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/NoMapping.java
@@ -55,7 +55,11 @@ public class NoMapping implements IMapping
{
}
- public void readRevision(IDBStoreAccessor storeAccessor, CDORevisionImpl revision, long timeStamp)
+ public void readRevisionByTime(IDBStoreAccessor storeAccessor, CDORevisionImpl revision, long timeStamp)
+ {
+ }
+
+ public void readRevisionByVersion(IDBStoreAccessor storeAccessor, CDORevisionImpl revision, int version)
{
}
}
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/RootMapping.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/RootMapping.java
index 60071fe..4e2cd8d 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/RootMapping.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/RootMapping.java
@@ -48,9 +48,15 @@ public class RootMapping extends Mapping
throw new UnsupportedOperationException("Not yet implemented");
}
- public void readRevision(IDBStoreAccessor storeAccessor, CDORevisionImpl revision, long timeStamp)
+ public void readRevisionByTime(IDBStoreAccessor storeAccessor, CDORevisionImpl revision, long timeStamp)
{
- // TODO Implement method RootMapping.readRevision()
+ // TODO Implement method RootMapping.readRevisionByTime()
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
+ public void readRevisionByVersion(IDBStoreAccessor storeAccessor, CDORevisionImpl revision, int version)
+ {
+ // TODO Implement method RootMapping.readRevisionByVersion()
throw new UnsupportedOperationException("Not yet implemented");
}
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ValueMapping.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ValueMapping.java
index a43b6bf..fe71a55 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ValueMapping.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ValueMapping.java
@@ -70,10 +70,10 @@ public abstract class ValueMapping extends Mapping
public void readRevision(IDBStoreAccessor storeAccessor, CDORevisionImpl revision)
{
- readRevision(storeAccessor, revision, NO_TIMESTAMP);
+ readRevisionByTime(storeAccessor, revision, NO_TIMESTAMP);
}
- public void readRevision(IDBStoreAccessor storeAccessor, CDORevisionImpl revision, long timeStamp)
+ public void readRevisionByTime(IDBStoreAccessor storeAccessor, CDORevisionImpl revision, long timeStamp)
{
if (attributeMappings != null)
{
@@ -86,6 +86,12 @@ public abstract class ValueMapping extends Mapping
}
}
+ public void readRevisionByVersion(IDBStoreAccessor storeAccessor, CDORevisionImpl revision, int version)
+ {
+ // TODO Implement method ValueMapping.readRevisionByVersion()
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
protected void writeAttributes(IDBStoreAccessor storeAccessor, CDORevisionImpl revision)
{
StringBuilder builder = new StringBuilder();
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 5328dc3..0b9d958 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
@@ -22,6 +22,8 @@ import org.eclipse.emf.cdo.server.IStoreWriter;
import org.eclipse.net4j.util.transaction.ITransaction;
import org.eclipse.net4j.util.transaction.ITransactionalOperation;
+import java.util.List;
+
/**
* @author Eike Stepper
*/
@@ -52,6 +54,12 @@ public class RevisionManager extends CDORevisionResolverImpl implements IRevisio
throw new UnsupportedOperationException("Reference proxies not supported on server side");
}
+ public List<Integer> analyzeReferenceRanges(List<Object> list)
+ {
+ // There are currently no reference proxies on server side
+ return null;
+ }
+
@Override
protected CDORevisionImpl verifyRevision(CDORevisionImpl revision)
{
@@ -70,19 +78,33 @@ public class RevisionManager extends CDORevisionResolverImpl implements IRevisio
{
IStoreReader storeReader = StoreUtil.getReader();
CDORevisionImpl revision = (CDORevisionImpl)storeReader.readRevision(id);
- repository.getTypeManager().registerObjectType(revision.getID(), revision.getCDOClass().createClassRef());
+ registerObjectType(revision);
return revision;
}
@Override
- protected CDORevisionImpl loadRevision(CDOID id, int referenceChunk, long timeStamp)
+ protected CDORevisionImpl loadRevisionByTime(CDOID id, int referenceChunk, long timeStamp)
{
IStoreReader storeReader = StoreUtil.getReader();
- CDORevisionImpl revision = (CDORevisionImpl)storeReader.readRevision(id, timeStamp);
- repository.getTypeManager().registerObjectType(revision.getID(), revision.getCDOClass().createClassRef());
+ CDORevisionImpl revision = (CDORevisionImpl)storeReader.readRevisionByTime(id, timeStamp);
+ registerObjectType(revision);
+ return revision;
+ }
+
+ @Override
+ protected CDORevisionImpl loadRevisionByVersion(CDOID id, int referenceChunk, int version)
+ {
+ IStoreReader storeReader = StoreUtil.getReader();
+ CDORevisionImpl revision = (CDORevisionImpl)storeReader.readRevisionByVersion(id, version);
+ registerObjectType(revision);
return revision;
}
+ private void registerObjectType(CDORevisionImpl revision)
+ {
+ repository.getTypeManager().registerObjectType(revision.getID(), revision.getCDOClass().createClassRef());
+ }
+
/**
* @author Eike Stepper
*/
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CDOReadIndication.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CDOReadIndication.java
index 00ddcca..ce5cd94 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CDOReadIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CDOReadIndication.java
@@ -22,9 +22,8 @@ import org.eclipse.net4j.stream.BufferOutputStream;
*/
public abstract class CDOReadIndication extends CDOServerIndication
{
- public CDOReadIndication(short signalID)
+ public CDOReadIndication()
{
- super(signalID);
}
@Override
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CDOServerIndication.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CDOServerIndication.java
index a3b8f55..2c15595 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CDOServerIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CDOServerIndication.java
@@ -25,17 +25,8 @@ import org.eclipse.net4j.signal.IndicationWithResponse;
*/
public abstract class CDOServerIndication extends IndicationWithResponse
{
- private short signalID;
-
- public CDOServerIndication(short signalID)
- {
- this.signalID = signalID;
- }
-
- @Override
- protected short getSignalID()
+ public CDOServerIndication()
{
- return signalID;
}
protected PackageManager getPackageManager()
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CDOServerProtocol.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CDOServerProtocol.java
index e681846..6107638 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CDOServerProtocol.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CDOServerProtocol.java
@@ -65,6 +65,12 @@ public class CDOServerProtocol extends SignalProtocol
case CDOProtocolConstants.SIGNAL_LOAD_REVISION:
return new LoadRevisionIndication();
+ case CDOProtocolConstants.SIGNAL_LOAD_REVISION_BY_TIME:
+ return new LoadRevisionByTimeIndication();
+
+ case CDOProtocolConstants.SIGNAL_LOAD_REVISION_BY_VERSION:
+ return new LoadRevisionByVersionIndication();
+
case CDOProtocolConstants.SIGNAL_LOAD_CHUNK:
return new LoadChunkIndication();
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 a2e55ad..fa777f1 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
@@ -74,7 +74,12 @@ public class CommitTransactionIndication extends CDOServerIndication
public CommitTransactionIndication()
{
- super(CDOProtocolConstants.SIGNAL_COMMIT_TRANSACTION);
+ }
+
+ @Override
+ protected short getSignalID()
+ {
+ return CDOProtocolConstants.SIGNAL_COMMIT_TRANSACTION;
}
@Override
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 1db68e8..6e44567 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
@@ -44,7 +44,12 @@ public class LoadChunkIndication extends CDOReadIndication
public LoadChunkIndication()
{
- super(CDOProtocolConstants.SIGNAL_LOAD_CHUNK);
+ }
+
+ @Override
+ protected short getSignalID()
+ {
+ return CDOProtocolConstants.SIGNAL_LOAD_CHUNK;
}
@Override
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadPackageIndication.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadPackageIndication.java
index 531d067..bf62427 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadPackageIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadPackageIndication.java
@@ -33,7 +33,12 @@ public class LoadPackageIndication extends CDOReadIndication
public LoadPackageIndication()
{
- super(CDOProtocolConstants.SIGNAL_LOAD_PACKAGE);
+ }
+
+ @Override
+ protected short getSignalID()
+ {
+ return CDOProtocolConstants.SIGNAL_LOAD_PACKAGE;
}
@Override
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadRevisionByTimeIndication.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadRevisionByTimeIndication.java
new file mode 100644
index 0000000..89a9393
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadRevisionByTimeIndication.java
@@ -0,0 +1,57 @@
+/***************************************************************************
+ * 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
+ **************************************************************************/
+package org.eclipse.emf.cdo.internal.server.protocol;
+
+import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
+import org.eclipse.emf.cdo.internal.server.bundle.OM;
+import org.eclipse.emf.cdo.protocol.CDOProtocolConstants;
+
+import org.eclipse.net4j.internal.util.om.trace.ContextTracer;
+import org.eclipse.net4j.util.io.ExtendedDataInputStream;
+
+import java.io.IOException;
+
+/**
+ * @author Eike Stepper
+ */
+public class LoadRevisionByTimeIndication extends LoadRevisionIndication
+{
+ private static final ContextTracer PROTOCOL = new ContextTracer(OM.DEBUG_PROTOCOL, LoadRevisionByTimeIndication.class);
+
+ private long timeStamp;
+
+ public LoadRevisionByTimeIndication()
+ {
+ }
+
+ @Override
+ protected short getSignalID()
+ {
+ return CDOProtocolConstants.SIGNAL_LOAD_REVISION_BY_TIME;
+ }
+
+ @Override
+ protected void indicating(ExtendedDataInputStream in) throws IOException
+ {
+ super.indicating(in);
+ timeStamp = in.readLong();
+ if (PROTOCOL.isEnabled())
+ {
+ PROTOCOL.format("Read timeStamp: {0}", timeStamp);
+ }
+ }
+
+ @Override
+ protected CDORevisionImpl getRevision()
+ {
+ return getRevisionManager().getRevisionByTime(id, referenceChunk, timeStamp);
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadRevisionByVersionIndication.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadRevisionByVersionIndication.java
new file mode 100644
index 0000000..d55aabd
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadRevisionByVersionIndication.java
@@ -0,0 +1,58 @@
+/***************************************************************************
+ * 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
+ **************************************************************************/
+package org.eclipse.emf.cdo.internal.server.protocol;
+
+import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
+import org.eclipse.emf.cdo.internal.server.bundle.OM;
+import org.eclipse.emf.cdo.protocol.CDOProtocolConstants;
+
+import org.eclipse.net4j.internal.util.om.trace.ContextTracer;
+import org.eclipse.net4j.util.io.ExtendedDataInputStream;
+
+import java.io.IOException;
+
+/**
+ * @author Eike Stepper
+ */
+public class LoadRevisionByVersionIndication extends LoadRevisionIndication
+{
+ private static final ContextTracer PROTOCOL = new ContextTracer(OM.DEBUG_PROTOCOL,
+ LoadRevisionByVersionIndication.class);
+
+ private int version;
+
+ public LoadRevisionByVersionIndication()
+ {
+ }
+
+ @Override
+ protected short getSignalID()
+ {
+ return CDOProtocolConstants.SIGNAL_LOAD_REVISION_BY_VERSION;
+ }
+
+ @Override
+ protected void indicating(ExtendedDataInputStream in) throws IOException
+ {
+ super.indicating(in);
+ version = in.readInt();
+ if (PROTOCOL.isEnabled())
+ {
+ PROTOCOL.format("Read version: {0}", version);
+ }
+ }
+
+ @Override
+ protected CDORevisionImpl getRevision()
+ {
+ return getRevisionManager().getRevisionByVersion(id, referenceChunk, version);
+ }
+}
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 6d282e5..b7cdda4 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
@@ -29,19 +29,24 @@ public class LoadRevisionIndication extends CDOReadIndication
{
private static final ContextTracer PROTOCOL = new ContextTracer(OM.DEBUG_PROTOCOL, LoadRevisionIndication.class);
- private CDORevisionImpl revision;
+ protected CDOID id;
- private int referenceChunk;
+ protected int referenceChunk;
public LoadRevisionIndication()
{
- super(CDOProtocolConstants.SIGNAL_LOAD_REVISION);
+ }
+
+ @Override
+ protected short getSignalID()
+ {
+ return CDOProtocolConstants.SIGNAL_LOAD_REVISION;
}
@Override
protected void indicating(ExtendedDataInputStream in) throws IOException
{
- CDOID id = CDOIDImpl.read(in);
+ id = CDOIDImpl.read(in);
if (id.isTemporary())
{
id = CDOIDImpl.create(-id.getValue());
@@ -65,27 +70,17 @@ public class LoadRevisionIndication extends CDOReadIndication
referenceChunk = CDORevisionImpl.UNCHUNKED;
}
-
- boolean historical = in.readBoolean();
- if (historical)
- {
- long timeStamp = in.readLong();
- if (PROTOCOL.isEnabled())
- {
- PROTOCOL.format("Read timeStamp: {0}", timeStamp);
- }
-
- revision = getRevisionManager().getRevision(id, referenceChunk, timeStamp);
- }
- else
- {
- revision = getRevisionManager().getRevision(id, referenceChunk);
- }
}
@Override
protected void responding(ExtendedDataOutputStream out) throws IOException
{
+ CDORevisionImpl revision = getRevision();
revision.write(out, getSession(), referenceChunk);
}
+
+ protected CDORevisionImpl getRevision()
+ {
+ return getRevisionManager().getRevision(id, referenceChunk);
+ }
}
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/ResourceIDIndication.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/ResourceIDIndication.java
index bf311fc..86a3356 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/ResourceIDIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/ResourceIDIndication.java
@@ -32,7 +32,12 @@ public class ResourceIDIndication extends CDOReadIndication
public ResourceIDIndication()
{
- super(CDOProtocolConstants.SIGNAL_RESOURCE_ID);
+ }
+
+ @Override
+ protected short getSignalID()
+ {
+ return CDOProtocolConstants.SIGNAL_RESOURCE_ID;
}
@Override
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/ResourcePathIndication.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/ResourcePathIndication.java
index 06719e3..89187ef 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/ResourcePathIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/ResourcePathIndication.java
@@ -32,7 +32,12 @@ public class ResourcePathIndication extends CDOReadIndication
public ResourcePathIndication()
{
- super(CDOProtocolConstants.SIGNAL_RESOURCE_PATH);
+ }
+
+ @Override
+ protected short getSignalID()
+ {
+ return CDOProtocolConstants.SIGNAL_RESOURCE_PATH;
}
@Override
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreReader.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreReader.java
index 397809d..f7199cd 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreReader.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreReader.java
@@ -54,7 +54,9 @@ public interface IStoreReader extends IStoreAccessor
public CDORevision readRevision(CDOID id);
- public CDORevision readRevision(CDOID id, long timeStamp);
+ public CDORevision readRevisionByTime(CDOID id, long timeStamp);
+
+ public CDORevision readRevisionByVersion(CDOID id, int version);
public CDOID readResourceID(String path);
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/TDD.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/TDD.java
index 5f7051f..401089e 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/TDD.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/TDD.java
@@ -22,7 +22,7 @@ public class TDD
{
private static final AbstractOMTest test = new ChunkingTest();
- private static final String METHOD_NAME = "testReadNative";
+ private static final String METHOD_NAME = "testWriteNative";
public static void main(String[] args) throws Throwable
{
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOAuditImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOAuditImpl.java
index 9a27231..65a6540 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOAuditImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOAuditImpl.java
@@ -46,7 +46,7 @@ public class CDOAuditImpl extends CDOViewImpl implements CDOAudit
{
CDOSessionImpl session = getSession();
CDORevisionResolver revisionManager = session.getRevisionManager();
- return (CDORevisionImpl)revisionManager.getRevision(id, session.getReferenceChunkSize(), timeStamp);
+ return (CDORevisionImpl)revisionManager.getRevisionByTime(id, session.getReferenceChunkSize(), timeStamp);
}
@Override
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 d972dca..4da63ff 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
@@ -23,8 +23,13 @@ import org.eclipse.net4j.IChannel;
import org.eclipse.net4j.signal.IFailOverStrategy;
import org.eclipse.emf.internal.cdo.protocol.LoadChunkRequest;
+import org.eclipse.emf.internal.cdo.protocol.LoadRevisionByTimeRequest;
+import org.eclipse.emf.internal.cdo.protocol.LoadRevisionByVersionRequest;
import org.eclipse.emf.internal.cdo.protocol.LoadRevisionRequest;
+import java.util.ArrayList;
+import java.util.List;
+
/**
* @author Eike Stepper
*/
@@ -122,34 +127,102 @@ public class CDORevisionManagerImpl extends CDORevisionResolverImpl implements C
}
}
- @Override
- protected CDORevisionImpl loadRevision(CDOID id, int referenceChunk)
+ public List<Integer> analyzeReferenceRanges(List<Object> list)
{
- try
+ List<Integer> ranges = new ArrayList<Integer>(0);
+ int range = 0; // Not in range
+ int lastIndex = -1; // Not in proxy range
+ for (Object value : list)
{
- IFailOverStrategy failOverStrategy = session.getFailOverStrategy();
- IChannel channel = session.getChannel();
- LoadRevisionRequest request = new LoadRevisionRequest(channel, id, referenceChunk);
- return failOverStrategy.send(request);
+ if (lastIndex == -1)
+ {
+ // Not in proxy range
+ if (value instanceof CDOReferenceProxy)
+ {
+ if (range != 0)
+ {
+ ranges.add(range);
+ range = 0;
+ }
+
+ CDOReferenceProxy proxy = (CDOReferenceProxy)value;
+ lastIndex = proxy.getIndex();
+ --range;
+ }
+ else
+ {
+ ++range; // One more non-proxy
+ }
+ }
+ else
+ {
+ // In proxy range
+ if (value instanceof CDOReferenceProxy)
+ {
+ CDOReferenceProxy proxy = (CDOReferenceProxy)value;
+ int index = proxy.getIndex();
+ if (index == lastIndex + 1)
+ {
+ --range;
+ }
+ else
+ {
+ ranges.add(range);
+ range = -1;
+ }
+
+ lastIndex = index;
+ }
+ else
+ {
+ if (range != 0)
+ {
+ ranges.add(range);
+ range = 1;
+ }
+
+ lastIndex = -1;
+ }
+ }
}
- catch (RuntimeException ex)
+
+ if (range != 0)
{
- throw ex;
+ ranges.add(range);
}
- catch (Exception ex)
+
+ int size = ranges.size();
+ if (size == 0 || size == 1 && ranges.get(0) > 0)
{
- throw new TransportException(ex);
+ return null;
}
+
+ return ranges;
+ }
+
+ @Override
+ protected CDORevisionImpl loadRevision(CDOID id, int referenceChunk)
+ {
+ return sendLoadRequest(new LoadRevisionRequest(session.getChannel(), id, referenceChunk));
}
@Override
- protected CDORevisionImpl loadRevision(CDOID id, int referenceChunk, long timeStamp)
+ protected CDORevisionImpl loadRevisionByTime(CDOID id, int referenceChunk, long timeStamp)
+ {
+ return sendLoadRequest(new LoadRevisionByTimeRequest(session.getChannel(), id, referenceChunk, timeStamp));
+ }
+
+ @Override
+ protected CDORevisionImpl loadRevisionByVersion(CDOID id, int referenceChunk, int version)
+ {
+ return sendLoadRequest(new LoadRevisionByVersionRequest(session.getChannel(), id, referenceChunk, version));
+ }
+
+ private CDORevisionImpl sendLoadRequest(LoadRevisionRequest request)
{
try
{
IFailOverStrategy failOverStrategy = session.getFailOverStrategy();
- IChannel channel = session.getChannel();
- LoadRevisionRequest request = new LoadRevisionRequest(channel, id, referenceChunk, timeStamp);
return failOverStrategy.send(request);
}
catch (RuntimeException ex)
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CDOClientRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CDOClientRequest.java
index 1f73a7d..d48d85f 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CDOClientRequest.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CDOClientRequest.java
@@ -22,18 +22,9 @@ import org.eclipse.emf.internal.cdo.CDOSessionImpl;
*/
public abstract class CDOClientRequest<RESULT> extends RequestWithConfirmation<RESULT>
{
- private short signalID;
-
- public CDOClientRequest(IChannel channel, short signalID)
+ public CDOClientRequest(IChannel channel)
{
super(channel);
- this.signalID = signalID;
- }
-
- @Override
- protected short getSignalID()
- {
- return signalID;
}
protected CDORevisionResolverImpl getRevisionManager()
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 bc1b7a3..abd245d 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
@@ -44,11 +44,17 @@ public class CommitTransactionRequest extends CDOClientRequest<CommitTransaction
public CommitTransactionRequest(IChannel channel, final CDOTransactionImpl transaction)
{
- super(channel, CDOProtocolConstants.SIGNAL_COMMIT_TRANSACTION);
+ super(channel);
this.transaction = transaction;
}
@Override
+ protected short getSignalID()
+ {
+ return CDOProtocolConstants.SIGNAL_COMMIT_TRANSACTION;
+ }
+
+ @Override
protected void requesting(ExtendedDataOutputStream out) throws IOException
{
out.writeInt(transaction.getViewID());
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LoadChunkRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LoadChunkRequest.java
index af66cea..1158b4c 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LoadChunkRequest.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LoadChunkRequest.java
@@ -47,7 +47,7 @@ public class LoadChunkRequest extends CDOClientRequest<CDOID>
public LoadChunkRequest(IChannel channel, CDORevisionImpl revision, CDOFeature feature, int accessIndex,
int fromIndex, int toIndex)
{
- super(channel, CDOProtocolConstants.SIGNAL_LOAD_CHUNK);
+ super(channel);
this.revision = revision;
this.feature = feature;
this.accessIndex = accessIndex;
@@ -56,6 +56,12 @@ public class LoadChunkRequest extends CDOClientRequest<CDOID>
}
@Override
+ protected short getSignalID()
+ {
+ return CDOProtocolConstants.SIGNAL_LOAD_CHUNK;
+ }
+
+ @Override
protected void requesting(ExtendedDataOutputStream out) throws IOException
{
if (PROTOCOL.isEnabled()) PROTOCOL.format("Writing revision ID: {0}", revision.getID());
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LoadPackageRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LoadPackageRequest.java
index ac2c0a1..f5e60a6 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LoadPackageRequest.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LoadPackageRequest.java
@@ -28,11 +28,17 @@ public class LoadPackageRequest extends CDOClientRequest<Object>
public LoadPackageRequest(IChannel channel, CDOPackageImpl cdoPackage)
{
- super(channel, CDOProtocolConstants.SIGNAL_LOAD_PACKAGE);
+ super(channel);
this.cdoPackage = cdoPackage;
}
@Override
+ protected short getSignalID()
+ {
+ return CDOProtocolConstants.SIGNAL_LOAD_PACKAGE;
+ }
+
+ @Override
protected void requesting(ExtendedDataOutputStream out) throws IOException
{
out.writeString(cdoPackage.getPackageURI());
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LoadRevisionByTimeRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LoadRevisionByTimeRequest.java
new file mode 100644
index 0000000..4eb81f0
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LoadRevisionByTimeRequest.java
@@ -0,0 +1,56 @@
+/***************************************************************************
+ * 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
+ **************************************************************************/
+package org.eclipse.emf.internal.cdo.protocol;
+
+import org.eclipse.emf.cdo.protocol.CDOID;
+import org.eclipse.emf.cdo.protocol.CDOProtocolConstants;
+
+import org.eclipse.net4j.IChannel;
+import org.eclipse.net4j.internal.util.om.trace.ContextTracer;
+import org.eclipse.net4j.util.io.ExtendedDataOutputStream;
+
+import org.eclipse.emf.internal.cdo.bundle.OM;
+
+import java.io.IOException;
+
+/**
+ * @author Eike Stepper
+ */
+public class LoadRevisionByTimeRequest extends LoadRevisionRequest
+{
+ private static final ContextTracer PROTOCOL = new ContextTracer(OM.DEBUG_PROTOCOL, LoadRevisionByTimeRequest.class);
+
+ private long timeStamp;
+
+ public LoadRevisionByTimeRequest(IChannel channel, CDOID id, int referenceChunk, long timeStamp)
+ {
+ super(channel, id, referenceChunk);
+ this.timeStamp = timeStamp;
+ }
+
+ @Override
+ protected short getSignalID()
+ {
+ return CDOProtocolConstants.SIGNAL_LOAD_REVISION_BY_TIME;
+ }
+
+ @Override
+ protected void requesting(ExtendedDataOutputStream out) throws IOException
+ {
+ super.requesting(out);
+ if (PROTOCOL.isEnabled())
+ {
+ PROTOCOL.format("Writing timeStamp: {0}", timeStamp);
+ }
+
+ out.writeLong(timeStamp);
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LoadRevisionByVersionRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LoadRevisionByVersionRequest.java
new file mode 100644
index 0000000..93417bf
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LoadRevisionByVersionRequest.java
@@ -0,0 +1,56 @@
+/***************************************************************************
+ * 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
+ **************************************************************************/
+package org.eclipse.emf.internal.cdo.protocol;
+
+import org.eclipse.emf.cdo.protocol.CDOID;
+import org.eclipse.emf.cdo.protocol.CDOProtocolConstants;
+
+import org.eclipse.net4j.IChannel;
+import org.eclipse.net4j.internal.util.om.trace.ContextTracer;
+import org.eclipse.net4j.util.io.ExtendedDataOutputStream;
+
+import org.eclipse.emf.internal.cdo.bundle.OM;
+
+import java.io.IOException;
+
+/**
+ * @author Eike Stepper
+ */
+public class LoadRevisionByVersionRequest extends LoadRevisionRequest
+{
+ private static final ContextTracer PROTOCOL = new ContextTracer(OM.DEBUG_PROTOCOL, LoadRevisionByVersionRequest.class);
+
+ private int version;
+
+ public LoadRevisionByVersionRequest(IChannel channel, CDOID id, int referenceChunk, int version)
+ {
+ super(channel, id, referenceChunk);
+ this.version = version;
+ }
+
+ @Override
+ protected short getSignalID()
+ {
+ return CDOProtocolConstants.SIGNAL_LOAD_REVISION_BY_VERSION;
+ }
+
+ @Override
+ protected void requesting(ExtendedDataOutputStream out) throws IOException
+ {
+ super.requesting(out);
+ if (PROTOCOL.isEnabled())
+ {
+ PROTOCOL.format("Writing version: {0}", version);
+ }
+
+ out.writeInt(version);
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LoadRevisionRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LoadRevisionRequest.java
index 6ad052b..b02fb43 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LoadRevisionRequest.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LoadRevisionRequest.java
@@ -36,21 +36,19 @@ public class LoadRevisionRequest extends CDOClientRequest<CDORevisionImpl>
private CDOID id;
- private Long timeStamp;
-
private int referenceChunk;
public LoadRevisionRequest(IChannel channel, CDOID id, int referenceChunk)
{
- super(channel, CDOProtocolConstants.SIGNAL_LOAD_REVISION);
+ super(channel);
this.id = id;
this.referenceChunk = referenceChunk;
}
- public LoadRevisionRequest(IChannel channel, CDOID id, int referenceChunk, long timeStamp)
+ @Override
+ protected short getSignalID()
{
- this(channel, id, referenceChunk);
- this.timeStamp = timeStamp;
+ return CDOProtocolConstants.SIGNAL_LOAD_REVISION;
}
@Override
@@ -82,21 +80,6 @@ public class LoadRevisionRequest extends CDOClientRequest<CDORevisionImpl>
out.writeInt(referenceChunk);
}
-
- if (timeStamp != null)
- {
- if (PROTOCOL.isEnabled())
- {
- PROTOCOL.format("Writing timeStamp: {0}", timeStamp);
- }
-
- out.writeBoolean(true);
- out.writeLong(timeStamp);
- }
- else
- {
- out.writeBoolean(false);
- }
}
@Override
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/ResourceIDRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/ResourceIDRequest.java
index 624ffe8..7aa6d83 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/ResourceIDRequest.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/ResourceIDRequest.java
@@ -34,11 +34,17 @@ public class ResourceIDRequest extends CDOClientRequest<CDOID>
public ResourceIDRequest(IChannel channel, String path)
{
- super(channel, CDOProtocolConstants.SIGNAL_RESOURCE_ID);
+ super(channel);
this.path = path;
}
@Override
+ protected short getSignalID()
+ {
+ return CDOProtocolConstants.SIGNAL_RESOURCE_ID;
+ }
+
+ @Override
protected void requesting(ExtendedDataOutputStream out) throws IOException
{
if (PROTOCOL.isEnabled())
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/ResourcePathRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/ResourcePathRequest.java
index 0a42734..82c3aa5 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/ResourcePathRequest.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/ResourcePathRequest.java
@@ -34,11 +34,17 @@ public class ResourcePathRequest extends CDOClientRequest<String>
public ResourcePathRequest(IChannel channel, CDOID id)
{
- super(channel, CDOProtocolConstants.SIGNAL_RESOURCE_PATH);
+ super(channel);
this.id = id;
}
@Override
+ protected short getSignalID()
+ {
+ return CDOProtocolConstants.SIGNAL_RESOURCE_PATH;
+ }
+
+ @Override
protected void requesting(ExtendedDataOutputStream out) throws IOException
{
if (PROTOCOL.isEnabled())