diff options
author | Eike Stepper | 2017-01-30 16:51:56 +0000 |
---|---|---|
committer | Eike Stepper | 2017-01-30 16:51:56 +0000 |
commit | f3cc80821ac2c25c9ed892dcd194c232784b985c (patch) | |
tree | faa404f7e98b7da37e12a82356df5f14ad4dbfa4 | |
parent | 5299e1447b063ffd15f67613032fd7e7651594ad (diff) | |
download | cdo-f3cc80821ac2c25c9ed892dcd194c232784b985c.tar.gz cdo-f3cc80821ac2c25c9ed892dcd194c232784b985c.tar.xz cdo-f3cc80821ac2c25c9ed892dcd194c232784b985c.zip |
[511324] Support VarInt and VarLong serialization
https://bugs.eclipse.org/bugs/show_bug.cgi?id=511324
131 files changed, 869 insertions, 453 deletions
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDReference.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDReference.java index e57e2654dc..cff9e2a6a1 100644 --- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDReference.java +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDReference.java @@ -55,7 +55,7 @@ public class CDOIDReference implements CDOReference<CDOID> String featureName = in.readString(); sourceFeature = eClass.getEStructuralFeature(featureName); - sourceIndex = in.readInt(); + sourceIndex = in.readXInt(); } public void write(CDODataOutput out) throws IOException @@ -64,7 +64,7 @@ public class CDOIDReference implements CDOReference<CDOID> out.writeCDOID(sourceID); out.writeCDOClassifierRef(sourceFeature.getEContainingClass()); out.writeString(sourceFeature.getName()); - out.writeInt(sourceIndex); + out.writeXInt(sourceIndex); } public CDOID getTargetObject() diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDUtil.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDUtil.java index 40b5fa5ce0..cf1a3abaf0 100644 --- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDUtil.java +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDUtil.java @@ -502,7 +502,7 @@ public final class CDOIDUtil return CDOID.NULL; case TEMP_OBJECT: - return CDOIDTempObjectImpl.create(in.readInt()); + return CDOIDTempObjectImpl.create(in.readXInt()); case EXTERNAL_OBJECT: return CDOIDExternalImpl.create(in.readString()); diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/protocol/CDODataInput.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/protocol/CDODataInput.java index 3538b61d90..960874a3ca 100644 --- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/protocol/CDODataInput.java +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/protocol/CDODataInput.java @@ -57,6 +57,16 @@ import java.io.IOException; */ public interface CDODataInput extends ExtendedDataInput { + /** + * @since 4.6 + */ + public int readXInt() throws IOException; + + /** + * @since 4.6 + */ + public long readXLong() throws IOException; + // ///////////////////////////////////////////////////////////////////////////////////////////////// public CDOPackageUnit readCDOPackageUnit(ResourceSet resourceSet) throws IOException; diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/protocol/CDODataOutput.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/protocol/CDODataOutput.java index 4ddd8ccbcb..9d20239352 100644 --- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/protocol/CDODataOutput.java +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/protocol/CDODataOutput.java @@ -59,6 +59,16 @@ import java.io.IOException; */ public interface CDODataOutput extends ExtendedDataOutput { + /** + * @since 4.6 + */ + public void writeXInt(int v) throws IOException; + + /** + * @since 4.6 + */ + public void writeXLong(long v) throws IOException; + public CDOPackageRegistry getPackageRegistry(); public CDOIDProvider getIDProvider(); diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/protocol/CDOProtocol.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/protocol/CDOProtocol.java index 110b7c6a73..dca772e607 100644 --- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/protocol/CDOProtocol.java +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/protocol/CDOProtocol.java @@ -77,12 +77,12 @@ public interface CDOProtocol extends CDOProtocolConstants public CommitNotificationInfo(CDODataInput in) throws IOException { - senderID = in.readInt(); + senderID = in.readXInt(); commitInfo = in.readCDOCommitInfo(); clearResourcePathCache = in.readBoolean(); securityImpact = in.readByte(); - int size = in.readInt(); + int size = in.readXInt(); if (size != 0) { newPermissions = CDOIDUtil.createMap(); @@ -104,7 +104,7 @@ public interface CDOProtocol extends CDOProtocolConstants public void write(CDODataOutput out) throws IOException { - out.writeInt(senderID); + out.writeXInt(senderID); out.writeCDOCommitInfo(commitInfo); out.writeBoolean(clearResourcePathCache); out.writeByte(securityImpact); // Must come after writeCDOCommitInfo() @@ -112,12 +112,12 @@ public interface CDOProtocol extends CDOProtocolConstants // Must come after writeCDOCommitInfo() if (newPermissions == null) { - out.writeInt(0); + out.writeXInt(0); } else { int size = newPermissions.size(); - out.writeInt(size); + out.writeXInt(size); for (Map.Entry<CDOID, CDOPermission> entry : newPermissions.entrySet()) { diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/protocol/CDOProtocolConstants.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/protocol/CDOProtocolConstants.java index d2818675c0..58c16ad06d 100644 --- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/protocol/CDOProtocolConstants.java +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/protocol/CDOProtocolConstants.java @@ -14,6 +14,8 @@ */ package org.eclipse.emf.cdo.common.protocol; +import org.eclipse.net4j.util.om.OMPlatform; + /** * Symbolic protocol constants commonly used in CDO. * @@ -53,6 +55,11 @@ public interface CDOProtocolConstants // public static final int PROTOCOL_VERSION = 18; // Password change protocol // public static final int PROTOCOL_VERSION = 17; // Last update for make query fail in sequence + /** + * @since 4.6 + */ + public static final boolean X_COMPRESSION = OMPlatform.INSTANCE.isProperty("org.eclipse.emf.cdo.common.protocol.X_COMPRESSION", true); + // ////////////////////////////////////////////////////////////////////// // Signal IDs diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/CDOFetchRule.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/CDOFetchRule.java index 5bcf7a429b..1690347e81 100644 --- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/CDOFetchRule.java +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/CDOFetchRule.java @@ -42,10 +42,10 @@ public final class CDOFetchRule public CDOFetchRule(CDODataInput in, CDOPackageRegistry packageManager) throws IOException { eClass = (EClass)in.readCDOClassifierRefAndResolve(); - int size = in.readInt(); + int size = in.readXInt(); for (int i = 0; i < size; i++) { - int featureID = in.readInt(); + int featureID = in.readXInt(); EStructuralFeature feature = eClass.getEStructuralFeature(featureID); features.add(feature); } @@ -54,10 +54,10 @@ public final class CDOFetchRule public void write(CDODataOutput out) throws IOException { out.writeCDOClassifierRef(eClass); - out.writeInt(features.size()); + out.writeXInt(features.size()); for (EStructuralFeature feature : features) { - out.writeInt(feature.getFeatureID()); + out.writeXInt(feature.getFeatureID()); } } diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/CDOQueryInfoImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/CDOQueryInfoImpl.java index c14f4ec5ec..9537815f62 100644 --- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/CDOQueryInfoImpl.java +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/CDOQueryInfoImpl.java @@ -66,14 +66,14 @@ public class CDOQueryInfoImpl implements CDOQueryInfo //$FALL-THROUGH$ } - maxResults = in.readInt(); + maxResults = in.readXInt(); if (in.readBoolean()) { changeSetData = in.readCDOChangeSetData(); } - int size = in.readInt(); + int size = in.readXInt(); for (int i = 0; i < size; i++) { String key = in.readString(); @@ -98,7 +98,7 @@ public class CDOQueryInfoImpl implements CDOQueryInfo out.writeString(queryLanguage); out.writeString(queryString); out.writeCDORevisionOrPrimitiveOrClassifier(context); - out.writeInt(maxResults); + out.writeXInt(maxResults); if (changeSetData != null) { @@ -110,7 +110,7 @@ public class CDOQueryInfoImpl implements CDOQueryInfo out.writeBoolean(false); } - out.writeInt(parameters.size()); + out.writeXInt(parameters.size()); for (Entry<String, Object> entry : parameters.entrySet()) { out.writeString(entry.getKey()); diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/id/CDOIDObjectLongImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/id/CDOIDObjectLongImpl.java index da63413137..c7209c359b 100644 --- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/id/CDOIDObjectLongImpl.java +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/id/CDOIDObjectLongImpl.java @@ -58,7 +58,7 @@ public final class CDOIDObjectLongImpl extends AbstractCDOID implements Internal @Override public void write(CDODataOutput out) throws IOException { - out.writeLong(value); + out.writeXLong(value); } public String toURIFragment() @@ -129,7 +129,7 @@ public final class CDOIDObjectLongImpl extends AbstractCDOID implements Internal public static CDOIDObjectLongImpl create(CDODataInput in) throws IOException { - long value = in.readLong(); + long value = in.readXLong(); return create(value); } diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/id/CDOIDObjectLongWithClassifierImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/id/CDOIDObjectLongWithClassifierImpl.java index 0e621622d6..c0f5bf8ba0 100644 --- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/id/CDOIDObjectLongWithClassifierImpl.java +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/id/CDOIDObjectLongWithClassifierImpl.java @@ -69,7 +69,7 @@ public final class CDOIDObjectLongWithClassifierImpl extends AbstractCDOID imple @Override public void write(CDODataOutput out) throws IOException { - out.writeLong(value); + out.writeXLong(value); out.writeCDOClassifierRef(classifierRef); } @@ -138,7 +138,7 @@ public final class CDOIDObjectLongWithClassifierImpl extends AbstractCDOID imple public static CDOIDObjectLongWithClassifierImpl create(CDODataInput in) throws IOException { - long value = in.readLong(); + long value = in.readXLong(); CDOClassifierRef classifierRef = in.readCDOClassifierRef(); return create(value, classifierRef); } diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/id/CDOIDTempObjectImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/id/CDOIDTempObjectImpl.java index b26e8e1585..a45c03398d 100644 --- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/id/CDOIDTempObjectImpl.java +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/id/CDOIDTempObjectImpl.java @@ -57,7 +57,7 @@ public final class CDOIDTempObjectImpl extends AbstractCDOID implements CDOIDTem @Override public void write(CDODataOutput out) throws IOException { - out.writeInt(value); + out.writeXInt(value); } public String toURIFragment() @@ -126,7 +126,7 @@ public final class CDOIDTempObjectImpl extends AbstractCDOID implements CDOIDTem public static CDOIDTempObjectImpl create(CDODataInput in) throws IOException { - int value = in.readInt(); + int value = in.readXInt(); return create(value); } diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOPackageUnitImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOPackageUnitImpl.java index 0f3dd9e67a..ac632400cb 100644 --- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOPackageUnitImpl.java +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOPackageUnitImpl.java @@ -271,8 +271,8 @@ public class CDOPackageUnitImpl implements InternalCDOPackageUnit } out.writeCDOPackageUnitType(originalType); - out.writeLong(timeStamp); - out.writeInt(packageInfos.length); + out.writeXLong(timeStamp); + out.writeXInt(packageInfos.length); for (InternalCDOPackageInfo packageInfo : packageInfos) { out.writeCDOPackageInfo(packageInfo); @@ -310,8 +310,8 @@ public class CDOPackageUnitImpl implements InternalCDOPackageUnit } originalType = in.readCDOPackageUnitType(); - timeStamp = in.readLong(); - packageInfos = new InternalCDOPackageInfo[in.readInt()]; + timeStamp = in.readXLong(); + packageInfos = new InternalCDOPackageInfo[in.readXInt()]; for (int i = 0; i < packageInfos.length; i++) { packageInfos[i] = (InternalCDOPackageInfo)in.readCDOPackageInfo(); diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOTypeImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOTypeImpl.java index c183289f01..ec169d099e 100644 --- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOTypeImpl.java +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOTypeImpl.java @@ -162,12 +162,12 @@ public abstract class CDOTypeImpl implements CDOType { public void writeValue(CDODataOutput out, Object value) throws IOException { - out.writeInt((Integer)(value == null ? getDefaultValue() : value)); + out.writeXInt((Integer)(value == null ? getDefaultValue() : value)); } public Integer readValue(CDODataInput in) throws IOException { - return in.readInt(); + return in.readXInt(); } }; @@ -175,12 +175,12 @@ public abstract class CDOTypeImpl implements CDOType { public void writeValue(CDODataOutput out, Object value) throws IOException { - out.writeLong((Long)(value == null ? getDefaultValue() : value)); + out.writeXLong((Long)(value == null ? getDefaultValue() : value)); } public Long readValue(CDODataInput in) throws IOException { - return in.readLong(); + return in.readXLong(); } }; @@ -204,7 +204,7 @@ public abstract class CDOTypeImpl implements CDOType { BigDecimal bigDecimal = (BigDecimal)value; out.writeByteArray(bigDecimal.unscaledValue().toByteArray()); - out.writeInt(bigDecimal.scale()); + out.writeXInt(bigDecimal.scale()); } @Override @@ -212,7 +212,7 @@ public abstract class CDOTypeImpl implements CDOType { byte[] array = in.readByteArray(); BigInteger unscaled = new BigInteger(array); - int scale = in.readInt(); + int scale = in.readXInt(); return new BigDecimal(unscaled, scale); } }; @@ -309,13 +309,13 @@ public abstract class CDOTypeImpl implements CDOType @Override protected void doWriteValue(CDODataOutput out, Object value) throws IOException { - out.writeLong(((Date)value).getTime()); + out.writeXLong(((Date)value).getTime()); } @Override protected Date doReadValue(CDODataInput in) throws IOException { - return new Date(in.readLong()); + return new Date(in.readXLong()); } }; @@ -354,13 +354,13 @@ public abstract class CDOTypeImpl implements CDOType @Override protected void doWriteValue(CDODataOutput out, Object value) throws IOException { - out.writeInt((Integer)value); + out.writeXInt((Integer)value); } @Override protected Integer doReadValue(CDODataInput in) throws IOException { - return in.readInt(); + return in.readXInt(); } }; @@ -369,13 +369,13 @@ public abstract class CDOTypeImpl implements CDOType @Override protected void doWriteValue(CDODataOutput out, Object value) throws IOException { - out.writeLong((Long)value); + out.writeXLong((Long)value); } @Override protected Long doReadValue(CDODataInput in) throws IOException { - return in.readLong(); + return in.readXLong(); } }; @@ -659,13 +659,13 @@ public abstract class CDOTypeImpl implements CDOType @Override public void doWriteValue(CDODataOutput out, Object value) throws IOException { - out.writeInt((Integer)value); + out.writeXInt((Integer)value); } @Override public Integer doReadValue(CDODataInput in) throws IOException { - return in.readInt(); + return in.readXInt(); } @Override @@ -705,14 +705,14 @@ public abstract class CDOTypeImpl implements CDOType } out.writeCDOClassifierRef(eEnum); - out.writeInt(((Enumerator)value).getValue()); + out.writeXInt(((Enumerator)value).getValue()); } @Override protected Object doReadValue(CDODataInput in) throws IOException { EEnum eEnum = (EEnum)in.readCDOClassifierRefAndResolve(); - int ordinal = in.readInt(); + int ordinal = in.readXInt(); EEnumLiteral literal = eEnum.getEEnumLiteral(ordinal); if (literal == null) @@ -814,7 +814,7 @@ public abstract class CDOTypeImpl implements CDOType protected void doWriteValue(CDODataOutput out, Object value) throws IOException { Object[] objects = (Object[])value; - out.writeInt(objects.length); + out.writeXInt(objects.length); for (Object object : objects) { writeTypeAndValue(out, object); @@ -824,7 +824,7 @@ public abstract class CDOTypeImpl implements CDOType @Override protected Object[] doReadValue(CDODataInput in) throws IOException { - int size = in.readInt(); + int size = in.readXInt(); Object[] objects = new Object[size]; for (int i = 0; i < size; i++) { @@ -864,7 +864,7 @@ public abstract class CDOTypeImpl implements CDOType { @SuppressWarnings("unchecked") Map<Object, Object> map = (Map<Object, Object>)value; - out.writeInt(map.size()); + out.writeXInt(map.size()); for (Entry<Object, Object> entry : map.entrySet()) { @@ -877,7 +877,7 @@ public abstract class CDOTypeImpl implements CDOType protected Map<Object, Object> doReadValue(CDODataInput in) throws IOException { Map<Object, Object> result = new HashMap<Object, Object>(); - int size = in.readInt(); + int size = in.readXInt(); for (int i = 0; i < size; i++) { Object key = readTypeAndValue(in); @@ -896,7 +896,7 @@ public abstract class CDOTypeImpl implements CDOType { @SuppressWarnings("unchecked") Set<Object> set = (Set<Object>)value; - out.writeInt(set.size()); + out.writeXInt(set.size()); for (Object element : set) { writeTypeAndValue(out, element); @@ -907,7 +907,7 @@ public abstract class CDOTypeImpl implements CDOType protected Set<Object> doReadValue(CDODataInput in) throws IOException { Set<Object> result = new HashSet<Object>(); - int size = in.readInt(); + int size = in.readXInt(); for (int i = 0; i < size; i++) { Object element = readTypeAndValue(in); @@ -925,7 +925,7 @@ public abstract class CDOTypeImpl implements CDOType { @SuppressWarnings("unchecked") List<Object> list = (List<Object>)value; - out.writeInt(list.size()); + out.writeXInt(list.size()); for (Object element : list) { writeTypeAndValue(out, element); @@ -936,7 +936,7 @@ public abstract class CDOTypeImpl implements CDOType protected List<Object> doReadValue(CDODataInput in) throws IOException { List<Object> result = new ArrayList<Object>(); - int size = in.readInt(); + int size = in.readXInt(); for (int i = 0; i < size; i++) { Object element = readTypeAndValue(in); diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOContainerFeatureDeltaImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOContainerFeatureDeltaImpl.java index 495b9b97ff..251bf1c49a 100644 --- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOContainerFeatureDeltaImpl.java +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOContainerFeatureDeltaImpl.java @@ -53,7 +53,7 @@ public class CDOContainerFeatureDeltaImpl extends CDOFeatureDeltaImpl implements public CDOContainerFeatureDeltaImpl(CDODataInput in, EClass eClass) throws IOException { super(CONTAINER_FEATURE); - newContainerFeatureID = in.readInt(); + newContainerFeatureID = in.readXInt(); newContainerID = in.readCDOID(); newResourceID = in.readCDOID(); } @@ -117,8 +117,8 @@ public class CDOContainerFeatureDeltaImpl extends CDOFeatureDeltaImpl implements @Override public void write(CDODataOutput out, EClass eClass) throws IOException { - out.writeInt(getType().ordinal()); - out.writeInt(newContainerFeatureID); + out.writeXInt(getType().ordinal()); + out.writeXInt(newContainerFeatureID); out.writeCDOID(out.getIDProvider().provideCDOID(newContainerID)); out.writeCDOID(newResourceID); } diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOFeatureDeltaImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOFeatureDeltaImpl.java index 95cc363c11..e4de3054b2 100644 --- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOFeatureDeltaImpl.java +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOFeatureDeltaImpl.java @@ -41,15 +41,15 @@ public abstract class CDOFeatureDeltaImpl implements InternalCDOFeatureDelta public CDOFeatureDeltaImpl(CDODataInput in, EClass eClass) throws IOException { - int featureID = in.readInt(); + int featureID = in.readXInt(); feature = eClass.getEStructuralFeature(featureID); CheckUtil.checkState(feature, "feature"); } public void write(CDODataOutput out, EClass eClass) throws IOException { - out.writeInt(getType().ordinal()); - out.writeInt(eClass.getFeatureID(feature)); + out.writeXInt(getType().ordinal()); + out.writeXInt(eClass.getFeatureID(feature)); } public EStructuralFeature getFeature() diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOListFeatureDeltaImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOListFeatureDeltaImpl.java index 1e1ebc6c5a..2bc3417f5b 100644 --- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOListFeatureDeltaImpl.java +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOListFeatureDeltaImpl.java @@ -66,8 +66,8 @@ public class CDOListFeatureDeltaImpl extends CDOFeatureDeltaImpl implements CDOL public CDOListFeatureDeltaImpl(CDODataInput in, EClass eClass) throws IOException { super(in, eClass); - originSize = in.readInt(); - int size = in.readInt(); + originSize = in.readXInt(); + int size = in.readXInt(); for (int i = 0; i < size; i++) { listChanges.add(in.readCDOFeatureDelta(eClass)); @@ -135,8 +135,8 @@ public class CDOListFeatureDeltaImpl extends CDOFeatureDeltaImpl implements CDOL public void write(CDODataOutput out, EClass eClass) throws IOException { super.write(out, eClass); - out.writeInt(originSize); - out.writeInt(listChanges.size()); + out.writeXInt(originSize); + out.writeXInt(listChanges.size()); for (CDOFeatureDelta featureDelta : listChanges) { out.writeCDOFeatureDelta(eClass, featureDelta); diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOMoveFeatureDeltaImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOMoveFeatureDeltaImpl.java index 674c965828..595435a398 100644 --- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOMoveFeatureDeltaImpl.java +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOMoveFeatureDeltaImpl.java @@ -55,8 +55,8 @@ public class CDOMoveFeatureDeltaImpl extends CDOFeatureDeltaImpl implements CDOM public CDOMoveFeatureDeltaImpl(CDODataInput in, EClass eClass) throws IOException { super(in, eClass); - newPosition = in.readInt(); - oldPosition = in.readInt(); + newPosition = in.readXInt(); + oldPosition = in.readXInt(); value = UNKNOWN_VALUE; } @@ -64,8 +64,8 @@ public class CDOMoveFeatureDeltaImpl extends CDOFeatureDeltaImpl implements CDOM public void write(CDODataOutput out, EClass eClass) throws IOException { super.write(out, eClass); - out.writeInt(newPosition); - out.writeInt(oldPosition); + out.writeXInt(newPosition); + out.writeXInt(oldPosition); } public int getNewPosition() diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDORevisionDeltaImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDORevisionDeltaImpl.java index c1b76c5239..4755d5df13 100644 --- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDORevisionDeltaImpl.java +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDORevisionDeltaImpl.java @@ -145,14 +145,14 @@ public class CDORevisionDeltaImpl implements InternalCDORevisionDelta eClass = (EClass)in.readCDOClassifierRefAndResolve(); id = in.readCDOID(); branch = in.readCDOBranch(); - version = in.readInt(); + version = in.readXInt(); if (version < 0) { version = -version; target = in.readCDORevisable(); } - int size = in.readInt(); + int size = in.readXInt(); for (int i = 0; i < size; i++) { CDOFeatureDelta featureDelta = in.readCDOFeatureDelta(eClass); @@ -167,15 +167,15 @@ public class CDORevisionDeltaImpl implements InternalCDORevisionDelta out.writeCDOBranch(branch); if (target == null) { - out.writeInt(version); + out.writeXInt(version); } else { - out.writeInt(-version); + out.writeXInt(-version); out.writeCDORevisable(target); } - out.writeInt(featureDeltas.size()); + out.writeXInt(featureDeltas.size()); for (CDOFeatureDelta featureDelta : featureDeltas.values()) { out.writeCDOFeatureDelta(eClass, featureDelta); diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOSingleValueFeatureDeltaImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOSingleValueFeatureDeltaImpl.java index 6cd42fe3ac..99bb4e4f01 100644 --- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOSingleValueFeatureDeltaImpl.java +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOSingleValueFeatureDeltaImpl.java @@ -49,7 +49,7 @@ public abstract class CDOSingleValueFeatureDeltaImpl extends CDOFeatureDeltaImpl public CDOSingleValueFeatureDeltaImpl(CDODataInput in, EClass eClass) throws IOException { super(in, eClass); - index = in.readInt(); + index = in.readXInt(); value = readValue(in, eClass); } @@ -57,7 +57,7 @@ public abstract class CDOSingleValueFeatureDeltaImpl extends CDOFeatureDeltaImpl public void write(CDODataOutput out, EClass eClass) throws IOException { super.write(out, eClass); - out.writeInt(index); + out.writeXInt(index); writeValue(out, eClass); } @@ -82,7 +82,7 @@ public abstract class CDOSingleValueFeatureDeltaImpl extends CDOFeatureDeltaImpl valueToWrite = entry.getValue(); int featureID = eClass.getFeatureID(feature); - out.writeInt(featureID); + out.writeXInt(featureID); } if (valueToWrite != null && feature instanceof EReference) @@ -98,7 +98,7 @@ public abstract class CDOSingleValueFeatureDeltaImpl extends CDOFeatureDeltaImpl EStructuralFeature feature = getFeature(); if (FeatureMapUtil.isFeatureMap(feature)) { - int featureID = in.readInt(); + int featureID = in.readXInt(); feature = eClass.getEStructuralFeature(featureID); Object innerValue = in.readCDOFeatureValue(feature); return CDORevisionUtil.createFeatureMapEntry(feature, innerValue); diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/branch/InternalCDOBranchManager.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/branch/InternalCDOBranchManager.java index 4de94fb33e..132846c00d 100644 --- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/branch/InternalCDOBranchManager.java +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/branch/InternalCDOBranchManager.java @@ -145,15 +145,15 @@ public interface InternalCDOBranchManager extends CDOBranchManager, ILifecycle public BranchInfo(CDODataInput in) throws IOException { name = in.readString(); - baseBranchID = in.readInt(); - baseTimeStamp = in.readLong(); + baseBranchID = in.readXInt(); + baseTimeStamp = in.readXLong(); } public void write(CDODataOutput out) throws IOException { out.writeString(name); - out.writeInt(baseBranchID); - out.writeLong(baseTimeStamp); + out.writeXInt(baseBranchID); + out.writeXLong(baseTimeStamp); } public String getName() @@ -208,16 +208,16 @@ public interface InternalCDOBranchManager extends CDOBranchManager, ILifecycle public SubBranchInfo(CDODataInput in) throws IOException { - id = in.readInt(); + id = in.readXInt(); name = in.readString(); - baseTimeStamp = in.readLong(); + baseTimeStamp = in.readXLong(); } public void write(CDODataOutput out) throws IOException { - out.writeInt(id); + out.writeXInt(id); out.writeString(name); - out.writeLong(baseTimeStamp); + out.writeXLong(baseTimeStamp); } public int getID() diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/protocol/CDODataInputImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/protocol/CDODataInputImpl.java index 95c5848d88..0082a814f3 100644 --- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/protocol/CDODataInputImpl.java +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/protocol/CDODataInputImpl.java @@ -120,6 +120,26 @@ public abstract class CDODataInputImpl extends ExtendedDataInput.Delegating impl super(delegate); } + public int readXInt() throws IOException + { + if (isXCompression()) + { + return readVarInt(); + } + + return readInt(); + } + + public long readXLong() throws IOException + { + if (isXCompression()) + { + return readVarLong(); + } + + return readLong(); + } + public CDOPackageUnit readCDOPackageUnit(ResourceSet resourceSet) throws IOException { InternalCDOPackageUnit packageUnit = (InternalCDOPackageUnit)CDOModelUtil.createPackageUnit(); @@ -129,7 +149,7 @@ public abstract class CDODataInputImpl extends ExtendedDataInput.Delegating impl public CDOPackageUnit[] readCDOPackageUnits(ResourceSet resourceSet) throws IOException { - int size = readInt(); + int size = readXInt(); if (TRACER.isEnabled()) { TRACER.format("Reading {0} package units", size); //$NON-NLS-1$ @@ -186,7 +206,7 @@ public abstract class CDODataInputImpl extends ExtendedDataInput.Delegating impl public CDOBranch readCDOBranch() throws IOException { - int branchID = readInt(); + int branchID = readXInt(); CDOBranch branch = getBranchManager().getBranch(branchID); if (branch == null) { @@ -199,20 +219,20 @@ public abstract class CDODataInputImpl extends ExtendedDataInput.Delegating impl public CDOBranchPoint readCDOBranchPoint() throws IOException { CDOBranch branch = readCDOBranch(); - long timeStamp = readLong(); + long timeStamp = readXLong(); return branch.getPoint(timeStamp); } public CDOBranchVersion readCDOBranchVersion() throws IOException { CDOBranch branch = readCDOBranch(); - int version = readInt(); + int version = readXInt(); return branch.getVersion(version); } public CDOChangeSetData readCDOChangeSetData() throws IOException { - int size1 = readInt(); + int size1 = readXInt(); List<CDOIDAndVersion> newObjects = new ArrayList<CDOIDAndVersion>(size1); for (int i = 0; i < size1; i++) { @@ -221,7 +241,7 @@ public abstract class CDODataInputImpl extends ExtendedDataInput.Delegating impl newObjects.add(data); } - int size2 = readInt(); + int size2 = readXInt(); List<CDORevisionKey> changedObjects = new ArrayList<CDORevisionKey>(size2); for (int i = 0; i < size2; i++) { @@ -230,12 +250,12 @@ public abstract class CDODataInputImpl extends ExtendedDataInput.Delegating impl changedObjects.add(data); } - int size3 = readInt(); + int size3 = readXInt(); List<CDOIDAndVersion> detachedObjects = new ArrayList<CDOIDAndVersion>(size3); for (int i = 0; i < size3; i++) { CDOID id = readCDOID(); - int version = readInt(); + int version = readXInt(); boolean isCDORevisionKey = readBoolean(); CDOIDAndVersion data; if (isCDORevisionKey) @@ -260,7 +280,7 @@ public abstract class CDODataInputImpl extends ExtendedDataInput.Delegating impl ResourceSet resourceSet = new ResourceSetImpl(); resourceSet.setPackageRegistry(packageRegistry); - int size = readInt(); + int size = readXInt(); List<CDOPackageUnit> newPackageUnits = new ArrayList<CDOPackageUnit>(size); for (int i = 0; i < size; i++) { @@ -276,8 +296,8 @@ public abstract class CDODataInputImpl extends ExtendedDataInput.Delegating impl public CDOCommitInfo readCDOCommitInfo() throws IOException { InternalCDOCommitInfoManager commitInfoManager = (InternalCDOCommitInfoManager)getCommitInfoManager(); - long timeStamp = readLong(); - long previousTimeStamp = readLong(); + long timeStamp = readXLong(); + long previousTimeStamp = readXLong(); if (readBoolean()) { @@ -306,7 +326,7 @@ public abstract class CDODataInputImpl extends ExtendedDataInput.Delegating impl Operation operation = readEnum(Operation.class); LockType lockType = readCDOLockType(); - int n = readInt(); + int n = readXInt(); CDOLockState[] lockStates = new CDOLockState[n]; for (int i = 0; i < n; i++) { @@ -320,11 +340,11 @@ public abstract class CDODataInputImpl extends ExtendedDataInput.Delegating impl { String durableLockingID = readString(); CDOBranch branch = readCDOBranch(); - long timestamp = readLong(); + long timestamp = readXLong(); String userID = readString(); boolean readOnly = readBoolean(); - int nLockStates = readInt(); + int nLockStates = readXInt(); Map<CDOID, LockGrade> locks = CDOIDUtil.createMap(); for (int i = 0; i < nLockStates; i++) { @@ -338,8 +358,8 @@ public abstract class CDODataInputImpl extends ExtendedDataInput.Delegating impl public CDOLockOwner readCDOLockOwner() throws IOException { - int session = readInt(); - int view = readInt(); + int session = readXInt(); + int view = readXInt(); String lockAreaID = readString(); boolean isDurableView = readBoolean(); return new CDOLockOwnerImpl(session, view, lockAreaID, isDurableView); @@ -360,7 +380,7 @@ public abstract class CDODataInputImpl extends ExtendedDataInput.Delegating impl InternalCDOLockState lockState = new CDOLockStateImpl(target); - int nReadLockOwners = readInt(); + int nReadLockOwners = readXInt(); for (int i = 0; i < nReadLockOwners; i++) { CDOLockOwner lockOwner = readCDOLockOwner(); @@ -402,7 +422,7 @@ public abstract class CDODataInputImpl extends ExtendedDataInput.Delegating impl public CDOIDAndVersion readCDOIDAndVersion() throws IOException { CDOID id = readCDOID(); - int version = readInt(); + int version = readXInt(); return new CDOIDAndVersionImpl(id, version); } @@ -417,7 +437,7 @@ public abstract class CDODataInputImpl extends ExtendedDataInput.Delegating impl { CDOID id = readCDOID(); CDOBranch branch = readCDOBranch(); - int version = readInt(); + int version = readXInt(); return CDORevisionUtil.createRevisionKey(id, branch, version); } @@ -448,20 +468,20 @@ public abstract class CDODataInputImpl extends ExtendedDataInput.Delegating impl public CDORevisable readCDORevisable() throws IOException { CDOBranch branch = readCDOBranch(); - int version = readInt(); - long timeStamp = readLong(); - long revised = readLong(); + int version = readXInt(); + long timeStamp = readXLong(); + long revised = readXLong(); return CDORevisionUtil.createRevisable(branch, version, timeStamp, revised); } public CDOList readCDOList(EClass owner, EStructuralFeature feature) throws IOException { int referenceChunk; - int size = readInt(); + int size = readXInt(); if (size < 0) { size = -size; - referenceChunk = readInt(); + referenceChunk = readXInt(); if (TRACER.isEnabled()) { TRACER.format("Read feature {0}: size={1}, referenceChunk={2}", feature.getName(), size, referenceChunk); //$NON-NLS-1$ @@ -537,7 +557,7 @@ public abstract class CDODataInputImpl extends ExtendedDataInput.Delegating impl else { EClass eClass = (EClass)readCDOClassifierRefAndResolve(); - innerFeature = eClass.getEStructuralFeature(readInt()); + innerFeature = eClass.getEStructuralFeature(readXInt()); } type = CDOModelUtil.getType(innerFeature.getEType()); @@ -579,7 +599,7 @@ public abstract class CDODataInputImpl extends ExtendedDataInput.Delegating impl public CDOFeatureDelta readCDOFeatureDelta(EClass owner) throws IOException { - int typeOrdinal = readInt(); + int typeOrdinal = readXInt(); CDOFeatureDelta.Type type = CDOFeatureDelta.Type.values()[typeOrdinal]; switch (type) { @@ -629,6 +649,14 @@ public abstract class CDODataInputImpl extends ExtendedDataInput.Delegating impl return readCDORevisionOrPrimitive(); } + /** + * @since 4.6 + */ + protected boolean isXCompression() + { + return false; + } + protected StringIO getPackageURICompressor() { return StringIO.DIRECT; diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/protocol/CDODataOutputImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/protocol/CDODataOutputImpl.java index b6f2ac22e2..5ef8f75f55 100644 --- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/protocol/CDODataOutputImpl.java +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/protocol/CDODataOutputImpl.java @@ -88,6 +88,30 @@ public class CDODataOutputImpl extends ExtendedDataOutput.Delegating implements super(delegate); } + public void writeXInt(int v) throws IOException + { + if (isXCompression()) + { + writeVarInt(v); + } + else + { + writeInt(v); + } + } + + public void writeXLong(long v) throws IOException + { + if (isXCompression()) + { + writeVarLong(v); + } + else + { + writeLong(v); + } + } + public void writeCDOPackageUnit(CDOPackageUnit packageUnit, boolean withPackages) throws IOException { ((InternalCDOPackageUnit)packageUnit).write(this, withPackages); @@ -96,7 +120,7 @@ public class CDODataOutputImpl extends ExtendedDataOutput.Delegating implements public void writeCDOPackageUnits(CDOPackageUnit... packageUnits) throws IOException { int size = packageUnits.length; - writeInt(size); + writeXInt(size); if (TRACER.isEnabled()) { TRACER.format("Writing {0} package units", size); //$NON-NLS-1$ @@ -140,25 +164,25 @@ public class CDODataOutputImpl extends ExtendedDataOutput.Delegating implements public void writeCDOBranch(CDOBranch branch) throws IOException { - writeInt(branch.getID()); + writeXInt(branch.getID()); } public void writeCDOBranchPoint(CDOBranchPoint branchPoint) throws IOException { writeCDOBranch(branchPoint.getBranch()); - writeLong(branchPoint.getTimeStamp()); + writeXLong(branchPoint.getTimeStamp()); } public void writeCDOBranchVersion(CDOBranchVersion branchVersion) throws IOException { writeCDOBranch(branchVersion.getBranch()); - writeInt(branchVersion.getVersion()); + writeXInt(branchVersion.getVersion()); } public void writeCDOChangeSetData(CDOChangeSetData changeSetData) throws IOException { Collection<CDOIDAndVersion> newObjects = changeSetData.getNewObjects(); - writeInt(newObjects.size()); + writeXInt(newObjects.size()); for (CDOIDAndVersion data : newObjects) { if (data instanceof CDORevision) @@ -174,7 +198,7 @@ public class CDODataOutputImpl extends ExtendedDataOutput.Delegating implements } Collection<CDORevisionKey> changedObjects = changeSetData.getChangedObjects(); - writeInt(changedObjects.size()); + writeXInt(changedObjects.size()); for (CDORevisionKey data : changedObjects) { if (data instanceof CDORevisionDelta) @@ -190,13 +214,13 @@ public class CDODataOutputImpl extends ExtendedDataOutput.Delegating implements } Collection<CDOIDAndVersion> detachedObjects = changeSetData.getDetachedObjects(); - writeInt(detachedObjects.size()); + writeXInt(detachedObjects.size()); for (CDOIDAndVersion data : detachedObjects) { writeCDOID(data.getID()); boolean isCDORevisionKey = data instanceof CDORevisionKey; int version = data.getVersion(); - writeInt(version); + writeXInt(version); writeBoolean(isCDORevisionKey); if (isCDORevisionKey) { @@ -209,7 +233,7 @@ public class CDODataOutputImpl extends ExtendedDataOutput.Delegating implements public void writeCDOCommitData(CDOCommitData commitData) throws IOException { Collection<CDOPackageUnit> newPackageUnits = commitData.getNewPackageUnits(); - writeInt(newPackageUnits.size()); + writeXInt(newPackageUnits.size()); for (CDOPackageUnit data : newPackageUnits) { writeCDOPackageUnit(data, false); @@ -220,8 +244,8 @@ public class CDODataOutputImpl extends ExtendedDataOutput.Delegating implements public void writeCDOCommitInfo(CDOCommitInfo commitInfo) throws IOException { - writeLong(commitInfo.getTimeStamp()); - writeLong(commitInfo.getPreviousTimeStamp()); + writeXLong(commitInfo.getTimeStamp()); + writeXLong(commitInfo.getPreviousTimeStamp()); CDOBranch branch = commitInfo.getBranch(); if (branch != null) @@ -255,7 +279,7 @@ public class CDODataOutputImpl extends ExtendedDataOutput.Delegating implements writeCDOLockType(lockChangeInfo.getLockType()); CDOLockState[] lockStates = lockChangeInfo.getLockStates(); - writeInt(lockStates.length); + writeXInt(lockStates.length); for (CDOLockState lockState : lockStates) { writeCDOLockState(lockState); @@ -267,11 +291,11 @@ public class CDODataOutputImpl extends ExtendedDataOutput.Delegating implements { writeString(lockArea.getDurableLockingID()); writeCDOBranch(lockArea.getBranch()); - writeLong(lockArea.getTimeStamp()); + writeXLong(lockArea.getTimeStamp()); writeString(lockArea.getUserID()); writeBoolean(lockArea.isReadOnly()); - writeInt(lockArea.getLocks().size()); + writeXInt(lockArea.getLocks().size()); for (Map.Entry<CDOID, LockGrade> entry : lockArea.getLocks().entrySet()) { writeCDOID(entry.getKey()); @@ -281,8 +305,8 @@ public class CDODataOutputImpl extends ExtendedDataOutput.Delegating implements public void writeCDOLockOwner(CDOLockOwner lockOwner) throws IOException { - writeInt(lockOwner.getSessionID()); - writeInt(lockOwner.getViewID()); + writeXInt(lockOwner.getSessionID()); + writeXInt(lockOwner.getViewID()); writeString(lockOwner.getDurableLockingID()); writeBoolean(lockOwner.isDurableView()); } @@ -306,7 +330,7 @@ public class CDODataOutputImpl extends ExtendedDataOutput.Delegating implements } Set<CDOLockOwner> readLockOwners = lockState.getReadLockOwners(); - writeInt(readLockOwners.size()); + writeXInt(readLockOwners.size()); for (CDOLockOwner readLockOwner : readLockOwners) { writeCDOLockOwner(readLockOwner); @@ -353,7 +377,7 @@ public class CDODataOutputImpl extends ExtendedDataOutput.Delegating implements public void writeCDOIDAndVersion(CDOIDAndVersion idAndVersion) throws IOException { writeCDOID(idAndVersion.getID()); - writeInt(idAndVersion.getVersion()); + writeXInt(idAndVersion.getVersion()); } public void writeCDOIDAndBranch(CDOIDAndBranch idAndBranch) throws IOException @@ -366,7 +390,7 @@ public class CDODataOutputImpl extends ExtendedDataOutput.Delegating implements { writeCDOID(revisionKey.getID()); writeCDOBranch(revisionKey.getBranch()); - writeInt(revisionKey.getVersion()); + writeXInt(revisionKey.getVersion()); } public void writeCDORevision(CDORevision revision, int referenceChunk) throws IOException @@ -390,9 +414,9 @@ public class CDODataOutputImpl extends ExtendedDataOutput.Delegating implements public void writeCDORevisable(CDORevisable revisable) throws IOException { writeCDOBranch(revisable.getBranch()); - writeInt(revisable.getVersion()); - writeLong(revisable.getTimeStamp()); - writeLong(revisable.getRevised()); + writeXInt(revisable.getVersion()); + writeXLong(revisable.getTimeStamp()); + writeXLong(revisable.getRevised()); } public void writeCDOList(EClass owner, EStructuralFeature feature, CDOList list, int referenceChunk) throws IOException @@ -424,8 +448,8 @@ public class CDODataOutputImpl extends ExtendedDataOutput.Delegating implements TRACER.format("Writing feature {0}: size={1}, referenceChunk={2}", feature.getName(), size, referenceChunk); //$NON-NLS-1$ } - writeInt(-size); - writeInt(referenceChunk); + writeXInt(-size); + writeXInt(referenceChunk); size = referenceChunk; } else @@ -435,7 +459,7 @@ public class CDODataOutputImpl extends ExtendedDataOutput.Delegating implements TRACER.format("Writing feature {0}: size={1}", feature.getName(), size); //$NON-NLS-1$ } - writeInt(size); + writeXInt(size); } CDOIDProvider idProvider = getIDProvider(); @@ -467,7 +491,7 @@ public class CDODataOutputImpl extends ExtendedDataOutput.Delegating implements writeCDOClassifierRef(eClass); int featureID = eClass.getFeatureID(innerFeature); - writeInt(featureID); + writeXInt(featureID); } } @@ -577,6 +601,14 @@ public class CDODataOutputImpl extends ExtendedDataOutput.Delegating implements return null; } + /** + * @since 4.6 + */ + protected boolean isXCompression() + { + return false; + } + protected StringIO getPackageURICompressor() { return StringIO.DIRECT; diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/BaseCDORevision.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/BaseCDORevision.java index 8a53547797..4579c6fe91 100644 --- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/BaseCDORevision.java +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/BaseCDORevision.java @@ -212,15 +212,15 @@ public abstract class BaseCDORevision extends AbstractCDORevision id = in.readCDOID(); branchPoint = in.readCDOBranchPoint(); - version = in.readInt(); + version = in.readXInt(); if (!id.isTemporary()) { - revised = in.readLong(); + revised = in.readXLong(); } resourceID = in.readCDOID(); containerID = in.readCDOID(); - containingFeatureID = in.readInt(); + containingFeatureID = in.readXInt(); if (TRACER.isEnabled()) { @@ -368,15 +368,15 @@ public abstract class BaseCDORevision extends AbstractCDORevision out.writeCDOClassifierRef(classRef); out.writeCDOID(id); out.writeCDOBranchPoint(branchPoint); - out.writeInt(getVersion()); + out.writeXInt(getVersion()); if (!id.isTemporary()) { - out.writeLong(revised); + out.writeXLong(revised); } out.writeCDOID(resourceID); out.writeCDOID(out.getIDProvider().provideCDOID(containerID)); - out.writeInt(containingFeatureID); + out.writeXInt(containingFeatureID); } /** diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/RevisionInfo.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/RevisionInfo.java index 9034629c7a..9d35c9064e 100644 --- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/RevisionInfo.java +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/RevisionInfo.java @@ -247,7 +247,7 @@ public abstract class RevisionInfo PointerCDORevision pointer = (PointerCDORevision)revision; out.writeByte(POINTER_RESULT); out.writeCDOClassifierRef(pointer.getEClass()); - out.writeLong(pointer.getRevised()); + out.writeXLong(pointer.getRevised()); CDOBranchVersion target = pointer.getTarget(); if (target instanceof InternalCDORevision) @@ -264,9 +264,9 @@ public abstract class RevisionInfo DetachedCDORevision detached = (DetachedCDORevision)revision; out.writeByte(DETACHED_RESULT); out.writeCDOClassifierRef(detached.getEClass()); - out.writeLong(detached.getTimeStamp()); - out.writeLong(detached.getRevised()); - out.writeInt(detached.getVersion()); + out.writeXLong(detached.getTimeStamp()); + out.writeXLong(detached.getRevised()); + out.writeXInt(detached.getVersion()); } else { @@ -286,7 +286,7 @@ public abstract class RevisionInfo case POINTER_RESULT: { EClassifier classifier = in.readCDOClassifierRefAndResolve(); - long revised = in.readLong(); + long revised = in.readXLong(); InternalCDORevision target = readResult(in, id, branch); // If target is null and we are in a Available RevisionInfo it means that we can use // availableBranchVersion/result as target @@ -300,9 +300,9 @@ public abstract class RevisionInfo case DETACHED_RESULT: { EClassifier classifier = in.readCDOClassifierRefAndResolve(); - long timeStamp = in.readLong(); - long revised = in.readLong(); - int version = in.readInt(); + long timeStamp = in.readXLong(); + long revised = in.readXLong(); + int version = in.readXInt(); return new DetachedCDORevision((EClass)classifier, id, branch, version, timeStamp, revised); } diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CDOClientIndication.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CDOClientIndication.java index 7dd70adde6..4151df55c6 100644 --- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CDOClientIndication.java +++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CDOClientIndication.java @@ -16,6 +16,7 @@ import org.eclipse.emf.cdo.common.commit.CDOCommitInfoManager; import org.eclipse.emf.cdo.common.lob.CDOLobStore; import org.eclipse.emf.cdo.common.model.CDOPackageRegistry; import org.eclipse.emf.cdo.common.protocol.CDODataInput; +import org.eclipse.emf.cdo.common.protocol.CDOProtocolConstants; import org.eclipse.emf.cdo.common.revision.CDOListFactory; import org.eclipse.emf.cdo.common.revision.CDORevisionFactory; import org.eclipse.emf.cdo.internal.common.revision.CDOListWithElementProxiesImpl; @@ -73,6 +74,17 @@ public abstract class CDOClientIndication extends Indication indicating(new CDODataInputImpl(in) { + public CDOPackageRegistry getPackageRegistry() + { + return session.getPackageRegistry(); + } + + @Override + protected boolean isXCompression() + { + return CDOProtocolConstants.X_COMPRESSION; + } + @Override protected StringIO getPackageURICompressor() { @@ -85,11 +97,6 @@ public abstract class CDOClientIndication extends Indication return CDOListWithElementProxiesImpl.FACTORY; } - public CDOPackageRegistry getPackageRegistry() - { - return session.getPackageRegistry(); - } - @Override protected CDOBranchManager getBranchManager() { diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CDOClientRequest.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CDOClientRequest.java index efd048894b..2bc0c974eb 100644 --- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CDOClientRequest.java +++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CDOClientRequest.java @@ -18,6 +18,7 @@ import org.eclipse.emf.cdo.common.lob.CDOLobStore; import org.eclipse.emf.cdo.common.model.CDOPackageRegistry; import org.eclipse.emf.cdo.common.protocol.CDODataInput; import org.eclipse.emf.cdo.common.protocol.CDODataOutput; +import org.eclipse.emf.cdo.common.protocol.CDOProtocolConstants; import org.eclipse.emf.cdo.common.revision.CDOListFactory; import org.eclipse.emf.cdo.common.revision.CDORevisionFactory; import org.eclipse.emf.cdo.internal.common.revision.CDOListWithElementProxiesImpl; @@ -84,6 +85,12 @@ public abstract class CDOClientRequest<RESULT> extends RequestWithConfirmation<R } @Override + protected boolean isXCompression() + { + return CDOProtocolConstants.X_COMPRESSION; + } + + @Override protected StringIO getPackageURICompressor() { return getProtocol().getPackageURICompressor(); @@ -102,6 +109,12 @@ public abstract class CDOClientRequest<RESULT> extends RequestWithConfirmation<R } @Override + protected boolean isXCompression() + { + return CDOProtocolConstants.X_COMPRESSION; + } + + @Override protected StringIO getPackageURICompressor() { return getProtocol().getPackageURICompressor(); diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CDOClientRequestWithMonitoring.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CDOClientRequestWithMonitoring.java index e140683c95..19cb08e3b7 100644 --- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CDOClientRequestWithMonitoring.java +++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CDOClientRequestWithMonitoring.java @@ -21,6 +21,7 @@ import org.eclipse.emf.cdo.common.lob.CDOLobStore; import org.eclipse.emf.cdo.common.model.CDOPackageRegistry; import org.eclipse.emf.cdo.common.protocol.CDODataInput; import org.eclipse.emf.cdo.common.protocol.CDODataOutput; +import org.eclipse.emf.cdo.common.protocol.CDOProtocolConstants; import org.eclipse.emf.cdo.common.revision.CDOListFactory; import org.eclipse.emf.cdo.common.revision.CDORevisionFactory; import org.eclipse.emf.cdo.internal.common.revision.CDOListWithElementProxiesImpl; @@ -110,6 +111,12 @@ public abstract class CDOClientRequestWithMonitoring<RESULT> extends RequestWith } @Override + protected boolean isXCompression() + { + return CDOProtocolConstants.X_COMPRESSION; + } + + @Override protected StringIO getPackageURICompressor() { return getProtocol().getPackageURICompressor(); @@ -123,15 +130,21 @@ public abstract class CDOClientRequestWithMonitoring<RESULT> extends RequestWith confirmationStream = in; return confirming(new CDODataInputImpl(in) { + public CDOPackageRegistry getPackageRegistry() + { + return getSession().getPackageRegistry(); + } + @Override - protected StringIO getPackageURICompressor() + protected boolean isXCompression() { - return getProtocol().getPackageURICompressor(); + return CDOProtocolConstants.X_COMPRESSION; } - public CDOPackageRegistry getPackageRegistry() + @Override + protected StringIO getPackageURICompressor() { - return getSession().getPackageRegistry(); + return getProtocol().getPackageURICompressor(); } @Override diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CDOTimeRequest.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CDOTimeRequest.java index 3f914932ee..dd3f1a0d99 100644 --- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CDOTimeRequest.java +++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CDOTimeRequest.java @@ -59,13 +59,13 @@ public abstract class CDOTimeRequest<RESULT> extends CDOClientRequest<RESULT> TRACER.format("Confirmed: {0}", CDOCommonUtil.formatTimeStamp(repositoryTimeResult.getConfirmed())); //$NON-NLS-1$ } - repositoryTimeResult.setIndicated(in.readLong()); + repositoryTimeResult.setIndicated(in.readXLong()); if (TRACER.isEnabled()) { TRACER.format("Read indicated: {0}", CDOCommonUtil.formatTimeStamp(repositoryTimeResult.getIndicated())); //$NON-NLS-1$ } - repositoryTimeResult.setResponded(in.readLong()); + repositoryTimeResult.setResponded(in.readXLong()); if (TRACER.isEnabled()) { TRACER.format("Read responded: {0}", CDOCommonUtil.formatTimeStamp(repositoryTimeResult.getResponded())); //$NON-NLS-1$ diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/ChangeSubscriptionRequest.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/ChangeSubscriptionRequest.java index aadfcca86a..c7e32791ce 100644 --- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/ChangeSubscriptionRequest.java +++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/ChangeSubscriptionRequest.java @@ -59,9 +59,9 @@ public class ChangeSubscriptionRequest extends CDOClientRequest<Boolean> TRACER.trace("View " + viewID + " subscribing to " + ids.size()); //$NON-NLS-1$ //$NON-NLS-2$ } - out.writeInt(viewID); + out.writeXInt(viewID); out.writeBoolean(clear); - out.writeInt(subscribeMode ? ids.size() : -ids.size()); + out.writeXInt(subscribeMode ? ids.size() : -ids.size()); for (CDOID id : ids) { out.writeCDOID(id); diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CloseViewRequest.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CloseViewRequest.java index d8068aa5cc..890e7d3fec 100644 --- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CloseViewRequest.java +++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CloseViewRequest.java @@ -32,7 +32,7 @@ public class CloseViewRequest extends CDOClientRequest<Boolean> @Override protected void requesting(CDODataOutput out) throws IOException { - out.writeInt(viewID); + out.writeXInt(viewID); } @Override diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CommitTransactionRequest.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CommitTransactionRequest.java index 8a9d60e37f..57c5b4db62 100644 --- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CommitTransactionRequest.java +++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CommitTransactionRequest.java @@ -148,7 +148,7 @@ public class CommitTransactionRequest extends CDOClientRequestWithMonitoring<Com protected void requestingTransactionInfo(CDODataOutput out) throws IOException { - out.writeInt(viewID); + out.writeXInt(viewID); } protected void requestingCommit(CDODataOutput out) throws IOException @@ -158,17 +158,17 @@ public class CommitTransactionRequest extends CDOClientRequestWithMonitoring<Com List<CDORevisionKey> changedObjects = commitData.getChangedObjects(); List<CDOIDAndVersion> detachedObjects = commitData.getDetachedObjects(); - out.writeLong(getLastUpdateTime()); - out.writeInt(commitNumber); + out.writeXLong(getLastUpdateTime()); + out.writeXInt(commitNumber); out.writeString(commitComment); CDOBranchUtil.writeBranchPointOrNull(out, commitMergeSource); - out.writeInt(locksOnNewObjects.size()); - out.writeInt(idsToUnlock.size()); - out.writeInt(newPackageUnits.size()); - out.writeInt(newObjects.size()); - out.writeInt(changedObjects.size()); - out.writeInt(detachedObjects.size()); + out.writeXInt(locksOnNewObjects.size()); + out.writeXInt(idsToUnlock.size()); + out.writeXInt(newPackageUnits.size()); + out.writeXInt(newObjects.size()); + out.writeXInt(changedObjects.size()); + out.writeXInt(detachedObjects.size()); if (TRACER.isEnabled()) { @@ -263,13 +263,13 @@ public class CommitTransactionRequest extends CDOClientRequestWithMonitoring<Com CDOBranch branch = ((CDORevisionKey)detachedObject).getBranch(); if (branch != transactionBranch) { - out.writeInt(-version); + out.writeXInt(-version); out.writeCDOBranch(branch); continue; } } - out.writeInt(version); + out.writeXInt(version); } } @@ -361,9 +361,9 @@ public class CommitTransactionRequest extends CDOClientRequestWithMonitoring<Com result.setRollbackReason(in.readByte()); result.setRollbackMessage(in.readString()); result.setBranchPoint(in.readCDOBranchPoint()); - result.setPreviousTimeStamp(in.readLong()); + result.setPreviousTimeStamp(in.readXLong()); - int size = in.readInt(); + int size = in.readXInt(); if (size != 0) { List<CDOObjectReference> xRefs = new ArrayList<CDOObjectReference>(size); @@ -385,7 +385,7 @@ public class CommitTransactionRequest extends CDOClientRequestWithMonitoring<Com result.setIDProvider(transaction); result.setClearResourcePathCache(clearResourcePathCache); result.setBranchPoint(in.readCDOBranchPoint()); - result.setPreviousTimeStamp(in.readLong()); + result.setPreviousTimeStamp(in.readXLong()); result.setSecurityImpact(in.readByte()); return result; } @@ -415,7 +415,7 @@ public class CommitTransactionRequest extends CDOClientRequestWithMonitoring<Com protected void confirmingNewLockStates(CDODataInput in, CommitTransactionResult result) throws IOException { - int n = in.readInt(); + int n = in.readXInt(); CDOLockState[] newLockStates = new CDOLockState[n]; for (int i = 0; i < n; i++) @@ -430,7 +430,7 @@ public class CommitTransactionRequest extends CDOClientRequestWithMonitoring<Com { if (in.readBoolean()) { - int n = in.readInt(); + int n = in.readXInt(); for (int i = 0; i < n; i++) { CDOID id = in.readCDOID(); diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CommitXATransactionPhase2Request.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CommitXATransactionPhase2Request.java index 082911cdf8..5ec3433457 100644 --- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CommitXATransactionPhase2Request.java +++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CommitXATransactionPhase2Request.java @@ -65,7 +65,7 @@ public class CommitXATransactionPhase2Request extends CommitXATransactionRequest InternalCDOXACommitContext context = getCommitContext(); Map<CDOIDTempObjectExternalImpl, InternalCDOTransaction> requestedIDs = context.getRequestedIDs(); int size = requestedIDs.size(); - out.writeInt(size); + out.writeXInt(size); if (PROTOCOL.isEnabled()) { PROTOCOL.format("Number of ids requested: {0}", size); //$NON-NLS-1$ diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CreateBranchRequest.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CreateBranchRequest.java index 85a415dc6c..3d80b56606 100644 --- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CreateBranchRequest.java +++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CreateBranchRequest.java @@ -38,15 +38,15 @@ public class CreateBranchRequest extends CDOClientRequest<Pair<Integer, Long>> @Override protected void requesting(CDODataOutput out) throws IOException { - out.writeInt(branchID); + out.writeXInt(branchID); branchInfo.write(out); } @Override protected Pair<Integer, Long> confirming(CDODataInput in) throws IOException { - branchID = in.readInt(); - long baseTimeStamp = in.readLong(); + branchID = in.readXInt(); + long baseTimeStamp = in.readXLong(); return Pair.create(branchID, baseTimeStamp); } } diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/EnableLockNotificationRequest.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/EnableLockNotificationRequest.java index d5f1643c40..058aa15c17 100644 --- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/EnableLockNotificationRequest.java +++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/EnableLockNotificationRequest.java @@ -35,7 +35,7 @@ public class EnableLockNotificationRequest extends CDOClientRequest<Boolean> @Override protected void requesting(CDODataOutput out) throws IOException { - out.writeInt(viewID); + out.writeXInt(viewID); out.writeBoolean(on); } diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/GetRemoteSessionsRequest.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/GetRemoteSessionsRequest.java index 23e60c1527..fd403f32c5 100644 --- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/GetRemoteSessionsRequest.java +++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/GetRemoteSessionsRequest.java @@ -57,7 +57,7 @@ public class GetRemoteSessionsRequest extends CDOClientRequest<List<CDORemoteSes for (;;) { - int sessionID = in.readInt(); + int sessionID = in.readXInt(); if (sessionID == CDOProtocolConstants.NO_MORE_REMOTE_SESSIONS) { break; diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/HandleRevisionsRequest.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/HandleRevisionsRequest.java index 0888b2c7c0..12761c8b5f 100644 --- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/HandleRevisionsRequest.java +++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/HandleRevisionsRequest.java @@ -99,7 +99,7 @@ public class HandleRevisionsRequest extends CDOClientRequest<Boolean> TRACER.format("Writing timeStamp: {0}", CDOCommonUtil.formatTimeStamp(timeStamp)); //$NON-NLS-1$ } - out.writeLong(timeStamp); + out.writeXLong(timeStamp); if (TRACER.isEnabled()) { TRACER.format("Writing exactTime: {0}", exactTime); //$NON-NLS-1$ diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LoadBranchRequest.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LoadBranchRequest.java index 29e0b2a60e..999df37ae5 100644 --- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LoadBranchRequest.java +++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LoadBranchRequest.java @@ -33,7 +33,7 @@ public class LoadBranchRequest extends CDOClientRequest<BranchInfo> @Override protected void requesting(CDODataOutput out) throws IOException { - out.writeInt(branchID); + out.writeXInt(branchID); } @Override diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LoadBranchesRequest.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LoadBranchesRequest.java index da0ad0d0f9..128d028466 100644 --- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LoadBranchesRequest.java +++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LoadBranchesRequest.java @@ -40,8 +40,8 @@ public class LoadBranchesRequest extends CDOClientRequest<Integer> @Override protected void requesting(CDODataOutput out) throws IOException { - out.writeInt(startID); - out.writeInt(endID); + out.writeXInt(startID); + out.writeXInt(endID); } @Override diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LoadChangeSetsRequest.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LoadChangeSetsRequest.java index 3cc2a50811..cc4490364c 100644 --- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LoadChangeSetsRequest.java +++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LoadChangeSetsRequest.java @@ -35,7 +35,7 @@ public class LoadChangeSetsRequest extends CDOClientRequest<CDOChangeSetData[]> @Override protected void requesting(CDODataOutput out) throws IOException { - out.writeInt(ranges.length); + out.writeXInt(ranges.length); for (CDOBranchPointRange range : ranges) { CDOBranchUtil.writeRange(out, range); diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LoadChunkRequest.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LoadChunkRequest.java index 5d16340ad1..836bc1f7de 100644 --- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LoadChunkRequest.java +++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LoadChunkRequest.java @@ -81,27 +81,27 @@ public class LoadChunkRequest extends CDOClientRequest<Object> TRACER.format("Writing version: {0}", version); //$NON-NLS-1$ } - out.writeInt(version); + out.writeXInt(version); if (TRACER.isEnabled()) { TRACER.format("Writing feature: {0}", feature); //$NON-NLS-1$ } out.writeCDOClassifierRef(feature.getEContainingClass()); - out.writeInt(feature.getFeatureID()); + out.writeXInt(feature.getFeatureID()); if (TRACER.isEnabled()) { TRACER.format("Writing fromIndex: {0}", fromIndex); //$NON-NLS-1$ } int diffIndex = accessIndex - fetchIndex; - out.writeInt(fromIndex - diffIndex); + out.writeXInt(fromIndex - diffIndex); if (TRACER.isEnabled()) { TRACER.format("Writing toIndex: {0}", toIndex); //$NON-NLS-1$ } - out.writeInt(toIndex - diffIndex); + out.writeXInt(toIndex - diffIndex); } @Override diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LoadCommitDataRequest.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LoadCommitDataRequest.java index 1f77d3e23c..68da44e04b 100644 --- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LoadCommitDataRequest.java +++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LoadCommitDataRequest.java @@ -34,7 +34,7 @@ public class LoadCommitDataRequest extends CDOClientRequest<CDOCommitData> @Override protected void requesting(CDODataOutput out) throws IOException { - out.writeLong(timeStamp); + out.writeXLong(timeStamp); } @Override diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LoadCommitInfosRequest.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LoadCommitInfosRequest.java index 7bd7a1e66a..79707e5c67 100644 --- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LoadCommitInfosRequest.java +++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LoadCommitInfosRequest.java @@ -58,8 +58,8 @@ public class LoadCommitInfosRequest extends CDOClientRequest<Boolean> out.writeCDOBranch(branch); } - out.writeLong(startTime); - out.writeLong(endTime); + out.writeXLong(startTime); + out.writeXLong(endTime); } @Override @@ -68,9 +68,9 @@ public class LoadCommitInfosRequest extends CDOClientRequest<Boolean> InternalCDOCommitInfoManager manager = getSession().getCommitInfoManager(); while (in.readBoolean()) { - long id = in.readLong(); + long id = in.readXLong(); CDOBranch branch = this.branch == null ? in.readCDOBranch() : this.branch; - long timeStamp = in.readLong(); + long timeStamp = in.readXLong(); String userID = in.readString(); String comment = in.readString(); CDOBranchPoint mergeSource = CDOBranchUtil.readBranchPointOrNull(in); diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LoadMergeDataRequest.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LoadMergeDataRequest.java index f8eb63c115..7b39a871c2 100644 --- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LoadMergeDataRequest.java +++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LoadMergeDataRequest.java @@ -61,7 +61,7 @@ public class LoadMergeDataRequest extends CDOClientRequestWithMonitoring<MergeDa @Override protected void requesting(CDODataOutput out, OMMonitor monitor) throws IOException { - out.writeInt(infos); + out.writeXInt(infos); monitor.begin(infos); try @@ -96,7 +96,7 @@ public class LoadMergeDataRequest extends CDOClientRequestWithMonitoring<MergeDa int size = availableRevisions.size(); out.writeCDOBranchPoint(branchPoint); - out.writeInt(size); + out.writeXInt(size); monitor.begin(size); @@ -206,7 +206,7 @@ public class LoadMergeDataRequest extends CDOClientRequestWithMonitoring<MergeDa private void readRevisionAvailabilityInfo(CDODataInput in, CDORevisionAvailabilityInfo info, Set<CDOID> result, OMMonitor monitor) throws IOException { - int size = in.readInt(); + int size = in.readXInt(); monitor.begin(size + 1); try diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LoadPermissionsRequest.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LoadPermissionsRequest.java index 37ea46e552..cbd410899f 100644 --- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LoadPermissionsRequest.java +++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LoadPermissionsRequest.java @@ -39,7 +39,7 @@ public class LoadPermissionsRequest extends CDOClientRequest<Map<CDORevision, CD protected void requesting(CDODataOutput out) throws IOException { int length = revisions.length; - out.writeInt(length); + out.writeXInt(length); for (int i = 0; i < length; i++) { @@ -52,7 +52,7 @@ public class LoadPermissionsRequest extends CDOClientRequest<Map<CDORevision, CD } int referenceChunk = getSession().options().getCollectionLoadingPolicy().getInitialChunkSize(); - out.writeInt(referenceChunk); + out.writeXInt(referenceChunk); } @Override diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LoadRevisionByVersionRequest.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LoadRevisionByVersionRequest.java index bfdc0125ac..269981536d 100644 --- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LoadRevisionByVersionRequest.java +++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LoadRevisionByVersionRequest.java @@ -65,7 +65,7 @@ public class LoadRevisionByVersionRequest extends CDOClientRequest<InternalCDORe TRACER.format("Writing referenceChunk: {0}", referenceChunk); //$NON-NLS-1$ } - out.writeInt(referenceChunk); + out.writeXInt(referenceChunk); } @Override diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LoadRevisionsRequest.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LoadRevisionsRequest.java index ba349bd931..c9110c9264 100644 --- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LoadRevisionsRequest.java +++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LoadRevisionsRequest.java @@ -68,7 +68,7 @@ public class LoadRevisionsRequest extends CDOClientRequest<List<RevisionInfo>> TRACER.format("Writing referenceChunk: {0}", referenceChunk); //$NON-NLS-1$ } - out.writeInt(referenceChunk); + out.writeXInt(referenceChunk); int size = infos.size(); if (TRACER.isEnabled()) { @@ -77,17 +77,17 @@ public class LoadRevisionsRequest extends CDOClientRequest<List<RevisionInfo>> if (prefetchDepth == 0) { - out.writeInt(size); + out.writeXInt(size); } else { - out.writeInt(-size); + out.writeXInt(-size); if (TRACER.isEnabled()) { TRACER.format("Writing prefetchDepth: {0}", prefetchDepth); //$NON-NLS-1$ } - out.writeInt(prefetchDepth); + out.writeXInt(prefetchDepth); } Collection<CDOID> ids = new ArrayList<CDOID>(size); @@ -107,7 +107,7 @@ public class LoadRevisionsRequest extends CDOClientRequest<List<RevisionInfo>> List<CDOFetchRule> fetchRules = ruleManager.getFetchRules(ids); if (fetchRules == null || fetchRules.size() <= 0) { - out.writeInt(0); + out.writeXInt(0); } else { @@ -115,8 +115,8 @@ public class LoadRevisionsRequest extends CDOClientRequest<List<RevisionInfo>> int fetchSize = fetchRules.size(); CDOID contextID = ruleManager.getContext(); - out.writeInt(fetchSize); - out.writeInt(collectionLoadingPolicy != null ? collectionLoadingPolicy.getInitialChunkSize() : CDORevision.UNCHUNKED); + out.writeXInt(fetchSize); + out.writeXInt(collectionLoadingPolicy != null ? collectionLoadingPolicy.getInitialChunkSize() : CDORevision.UNCHUNKED); out.writeCDOID(contextID); for (CDOFetchRule fetchRule : fetchRules) @@ -141,7 +141,7 @@ public class LoadRevisionsRequest extends CDOClientRequest<List<RevisionInfo>> } List<RevisionInfo> additionalRevisionInfos = null; - int additionalSize = in.readInt(); + int additionalSize = in.readXInt(); if (additionalSize != 0) { if (TRACER.isEnabled()) diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LoadSubBranchesRequest.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LoadSubBranchesRequest.java index e2ad36784b..996272be8e 100644 --- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LoadSubBranchesRequest.java +++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LoadSubBranchesRequest.java @@ -33,13 +33,13 @@ public class LoadSubBranchesRequest extends CDOClientRequest<SubBranchInfo[]> @Override protected void requesting(CDODataOutput out) throws IOException { - out.writeInt(branchID); + out.writeXInt(branchID); } @Override protected SubBranchInfo[] confirming(CDODataInput in) throws IOException { - int size = in.readInt(); + int size = in.readXInt(); SubBranchInfo[] infos = new SubBranchInfo[size]; for (int i = 0; i < infos.length; i++) { diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LockAreaRequest.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LockAreaRequest.java index 8efc87c3fb..abddb136b4 100644 --- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LockAreaRequest.java +++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LockAreaRequest.java @@ -36,7 +36,7 @@ public class LockAreaRequest extends CDOClientRequest<String> @Override protected void requesting(CDODataOutput out) throws IOException { - out.writeInt(view.getViewID()); + out.writeXInt(view.getViewID()); out.writeBoolean(create); } diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LockObjectsRequest.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LockObjectsRequest.java index 74a0c7204b..bdd0087a41 100644 --- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LockObjectsRequest.java +++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LockObjectsRequest.java @@ -60,12 +60,12 @@ public class LockObjectsRequest extends CDOClientRequest<LockObjectsResult> @Override protected void requesting(CDODataOutput out) throws IOException { - out.writeInt(viewID); + out.writeXInt(viewID); out.writeCDOLockType(lockType); out.writeBoolean(recursive); - out.writeLong(timeout); + out.writeXLong(timeout); - out.writeInt(revisionKeys.size()); + out.writeXInt(revisionKeys.size()); for (CDORevisionKey revKey : revisionKeys) { out.writeCDORevisionKey(revKey); @@ -78,18 +78,18 @@ public class LockObjectsRequest extends CDOClientRequest<LockObjectsResult> boolean succesful = in.readBoolean(); boolean timeout = in.readBoolean(); boolean waitForUpdate = in.readBoolean(); - long requiredTimestamp = in.readLong(); + long requiredTimestamp = in.readXLong(); - int nStaleRevisions = in.readInt(); + int nStaleRevisions = in.readXInt(); CDORevisionKey[] staleRevisions = new CDORevisionKey[nStaleRevisions]; for (int i = 0; i < nStaleRevisions; i++) { staleRevisions[i] = in.readCDORevisionKey(); } - long timestamp = in.readLong(); + long timestamp = in.readXLong(); - int n = in.readInt(); + int n = in.readXInt(); CDOLockState[] newLockStates = new CDOLockState[n]; for (int i = 0; i < n; i++) { diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LockStateRequest.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LockStateRequest.java index 46de19b6fd..e4d5b63733 100644 --- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LockStateRequest.java +++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LockStateRequest.java @@ -42,16 +42,16 @@ public class LockStateRequest extends CDOClientRequest<CDOLockState[]> @Override protected void requesting(CDODataOutput out) throws IOException { - out.writeInt(viewID); + out.writeXInt(viewID); if (prefetchDepth == CDOLockState.DEPTH_NONE) { - out.writeInt(ids.size()); + out.writeXInt(ids.size()); } else { - out.writeInt(-ids.size()); - out.writeInt(prefetchDepth); + out.writeXInt(-ids.size()); + out.writeXInt(prefetchDepth); } for (CDOID id : ids) @@ -63,7 +63,7 @@ public class LockStateRequest extends CDOClientRequest<CDOLockState[]> @Override protected CDOLockState[] confirming(CDODataInput in) throws IOException { - int n = in.readInt(); + int n = in.readXInt(); CDOLockState[] lockStates = new CDOLockState[n]; for (int i = 0; i < n; i++) { diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/ObjectLockedRequest.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/ObjectLockedRequest.java index 4e9b8ef5e4..00cc1b714d 100644 --- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/ObjectLockedRequest.java +++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/ObjectLockedRequest.java @@ -55,7 +55,7 @@ public class ObjectLockedRequest extends CDOClientRequest<Boolean> lockType == LockType.READ ? "read" : "write"); //$NON-NLS-1$ //$NON-NLS-2$ } - out.writeInt(view.getViewID()); + out.writeXInt(view.getViewID()); out.writeCDOLockType(lockType); out.writeCDOID(object.cdoID()); out.writeBoolean(byOthers); diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/OpenSessionRequest.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/OpenSessionRequest.java index 436b7e1a6a..45374d529b 100644 --- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/OpenSessionRequest.java +++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/OpenSessionRequest.java @@ -95,7 +95,7 @@ public class OpenSessionRequest extends CDOClientRequestWithMonitoring<OpenSessi @Override protected OpenSessionResult confirming(CDODataInput in, OMMonitor monitor) throws IOException { - int sessionID = in.readInt(); + int sessionID = in.readXInt(); if (sessionID == 0) { // The user has canceled the authentication diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/OpenViewRequest.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/OpenViewRequest.java index 9c948e25e2..310d933c82 100644 --- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/OpenViewRequest.java +++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/OpenViewRequest.java @@ -50,7 +50,7 @@ public class OpenViewRequest extends CDOClientRequest<CDOBranchPoint> @Override protected void requesting(CDODataOutput out) throws IOException { - out.writeInt(viewID); + out.writeXInt(viewID); out.writeBoolean(readOnly); if (branchPoint != null) diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/QueryCancelRequest.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/QueryCancelRequest.java index 4d35a4620c..3bcde10554 100644 --- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/QueryCancelRequest.java +++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/QueryCancelRequest.java @@ -43,7 +43,7 @@ public class QueryCancelRequest extends CDOClientRequest<Boolean> TRACER.trace("Cancel query " + queryID); //$NON-NLS-1$ } - out.writeInt(queryID); + out.writeXInt(queryID); } @Override diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/QueryLobsRequest.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/QueryLobsRequest.java index cbc23db831..3966b1159d 100644 --- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/QueryLobsRequest.java +++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/QueryLobsRequest.java @@ -35,7 +35,7 @@ public class QueryLobsRequest extends CDOClientRequest<List<byte[]>> @Override protected void requesting(CDODataOutput out) throws IOException { - out.writeInt(ids.size()); + out.writeXInt(ids.size()); for (byte[] id : ids) { out.writeByteArray(id); @@ -45,7 +45,7 @@ public class QueryLobsRequest extends CDOClientRequest<List<byte[]>> @Override protected List<byte[]> confirming(CDODataInput in) throws IOException { - int size = in.readInt(); + int size = in.readXInt(); List<byte[]> result = new ArrayList<byte[]>(size); for (int i = 0; i < size; i++) { diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/QueryRequest.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/QueryRequest.java index 19a05a9597..fa0df6021e 100644 --- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/QueryRequest.java +++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/QueryRequest.java @@ -57,14 +57,14 @@ public class QueryRequest extends CDOClientRequest<Boolean> @Override protected void requesting(CDODataOutput out) throws IOException { - out.writeInt(view.getViewID()); + out.writeXInt(view.getViewID()); ((CDOQueryInfoImpl)queryResult.getQueryInfo()).write(out); } @Override protected Boolean confirming(CDODataInput in) throws IOException { - int queryID = in.readInt(); + int queryID = in.readXInt(); queryResult.setQueryID(queryID); CDOQueryQueue<Object> resultQueue = queryResult.getQueue(); diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/RefreshSessionRequest.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/RefreshSessionRequest.java index 4ff705b3b2..1d31c9d63b 100644 --- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/RefreshSessionRequest.java +++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/RefreshSessionRequest.java @@ -61,18 +61,18 @@ public class RefreshSessionRequest extends CDOClientRequest<RefreshSessionResult @Override protected void requesting(CDODataOutput out) throws IOException { - out.writeLong(lastUpdateTime); - out.writeInt(initialChunkSize); + out.writeXLong(lastUpdateTime); + out.writeXInt(initialChunkSize); out.writeBoolean(enablePassiveUpdates); - out.writeInt(viewedRevisions.size()); + out.writeXInt(viewedRevisions.size()); for (Entry<CDOBranch, Map<CDOID, InternalCDORevision>> entry : viewedRevisions.entrySet()) { CDOBranch branch = entry.getKey(); Map<CDOID, InternalCDORevision> revisions = entry.getValue(); out.writeCDOBranch(branch); - out.writeInt(revisions.size()); + out.writeXInt(revisions.size()); for (InternalCDORevision revision : revisions.values()) { out.writeCDORevisionKey(revision); @@ -83,7 +83,7 @@ public class RefreshSessionRequest extends CDOClientRequest<RefreshSessionResult @Override protected RefreshSessionResult confirming(CDODataInput in) throws IOException { - lastUpdateTime = in.readLong(); + lastUpdateTime = in.readXLong(); RefreshSessionResult result = new RefreshSessionResult(lastUpdateTime); ResourceSet resourceSet = EMFUtil.newEcoreResourceSet(); diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/RemoteMessageNotificationIndication.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/RemoteMessageNotificationIndication.java index 98af1b5b27..b0b4606059 100644 --- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/RemoteMessageNotificationIndication.java +++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/RemoteMessageNotificationIndication.java @@ -37,7 +37,7 @@ public class RemoteMessageNotificationIndication extends CDOClientIndication @Override protected void indicating(CDODataInput in) throws IOException { - int senderID = in.readInt(); + int senderID = in.readXInt(); if (TRACER.isEnabled()) { TRACER.trace("Read senderID: " + senderID); //$NON-NLS-1$ diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/RemoteMessageRequest.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/RemoteMessageRequest.java index 24e02b5394..5d86c80667 100644 --- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/RemoteMessageRequest.java +++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/RemoteMessageRequest.java @@ -56,7 +56,7 @@ public class RemoteMessageRequest extends CDOClientRequest<Set<Integer>> TRACER.format("Writing {0} recipients", recipients.size()); //$NON-NLS-1$ } - out.writeInt(recipients.size()); + out.writeXInt(recipients.size()); for (CDORemoteSession recipient : recipients) { if (TRACER.isEnabled()) @@ -64,7 +64,7 @@ public class RemoteMessageRequest extends CDOClientRequest<Set<Integer>> TRACER.trace("Writing recipient: " + recipient); //$NON-NLS-1$ } - out.writeInt(recipient.getSessionID()); + out.writeXInt(recipient.getSessionID()); } } @@ -72,10 +72,10 @@ public class RemoteMessageRequest extends CDOClientRequest<Set<Integer>> protected Set<Integer> confirming(CDODataInput in) throws IOException { Set<Integer> sessionIDs = new HashSet<Integer>(); - int count = in.readInt(); + int count = in.readXInt(); for (int i = 0; i < count; i++) { - int sessionID = in.readInt(); + int sessionID = in.readXInt(); sessionIDs.add(sessionID); } diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/RemoteSessionNotificationIndication.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/RemoteSessionNotificationIndication.java index 9c58e22dce..9b3fead56c 100644 --- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/RemoteSessionNotificationIndication.java +++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/RemoteSessionNotificationIndication.java @@ -29,7 +29,7 @@ public class RemoteSessionNotificationIndication extends CDOClientIndication @Override protected void indicating(CDODataInput in) throws IOException { - int sessionID = in.readInt(); + int sessionID = in.readXInt(); byte opcode = in.readByte(); switch (opcode) { diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/RenameBranchRequest.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/RenameBranchRequest.java index 6148e040a8..676f135012 100644 --- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/RenameBranchRequest.java +++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/RenameBranchRequest.java @@ -38,7 +38,7 @@ public class RenameBranchRequest extends CDOClientRequest<Boolean> @Override protected void requesting(CDODataOutput out) throws IOException { - out.writeInt(branchID); + out.writeXInt(branchID); out.writeString(oldName); out.writeString(newName); } diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/ReplicateRepositoryRawRequest.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/ReplicateRepositoryRawRequest.java index e934f1e1ff..510885cbb5 100644 --- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/ReplicateRepositoryRawRequest.java +++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/ReplicateRepositoryRawRequest.java @@ -38,8 +38,8 @@ public class ReplicateRepositoryRawRequest extends CDOClientRequestWithMonitorin int lastReplicatedBranchID = context.getLastReplicatedBranchID(); long lastReplicatedCommitTime = context.getLastReplicatedCommitTime(); - out.writeInt(lastReplicatedBranchID); - out.writeLong(lastReplicatedCommitTime); + out.writeXInt(lastReplicatedBranchID); + out.writeXLong(lastReplicatedCommitTime); } @Override diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/ReplicateRepositoryRequest.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/ReplicateRepositoryRequest.java index 2083346669..a95277b193 100644 --- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/ReplicateRepositoryRequest.java +++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/ReplicateRepositoryRequest.java @@ -37,11 +37,11 @@ public class ReplicateRepositoryRequest extends CDOClientRequest<Boolean> @Override protected void requesting(CDODataOutput out) throws IOException { - out.writeInt(context.getLastReplicatedBranchID()); - out.writeLong(context.getLastReplicatedCommitTime()); + out.writeXInt(context.getLastReplicatedBranchID()); + out.writeXLong(context.getLastReplicatedCommitTime()); String[] lockAreaIDs = context.getLockAreaIDs(); - out.writeInt(lockAreaIDs.length); + out.writeXInt(lockAreaIDs.length); for (int i = 0; i < lockAreaIDs.length; i++) { out.writeString(lockAreaIDs[i]); diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/ResetTransactionRequest.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/ResetTransactionRequest.java index 0bad95d223..3cd7aaa2fa 100644 --- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/ResetTransactionRequest.java +++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/ResetTransactionRequest.java @@ -47,14 +47,14 @@ public class ResetTransactionRequest extends CDOClientRequest<CDOCommitInfo> TRACER.format("Writing transactionID: {0}", transactionID); //$NON-NLS-1$ } - out.writeInt(transactionID); + out.writeXInt(transactionID); if (TRACER.isEnabled()) { TRACER.format("Writing commitNumber: {0}", commitNumber); //$NON-NLS-1$ } - out.writeInt(commitNumber); + out.writeXInt(commitNumber); } @Override @@ -62,8 +62,8 @@ public class ResetTransactionRequest extends CDOClientRequest<CDOCommitInfo> { if (in.readBoolean()) { - long timeStamp = in.readLong(); - long previousTimeStamp = in.readLong(); + long timeStamp = in.readXLong(); + long previousTimeStamp = in.readXLong(); InternalCDOCommitInfoManager commitInfoManager = getSession().getCommitInfoManager(); return commitInfoManager.createCommitInfo(null, timeStamp, previousTimeStamp, null, null, null, null); diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/SwitchTargetRequest.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/SwitchTargetRequest.java index 88ae858cf8..cb47b6098a 100644 --- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/SwitchTargetRequest.java +++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/SwitchTargetRequest.java @@ -56,10 +56,10 @@ public class SwitchTargetRequest extends CDOClientRequestWithMonitoring<Object> @Override protected void requesting(CDODataOutput out, OMMonitor monitor) throws IOException { - out.writeInt(viewID); + out.writeXInt(viewID); out.writeCDOBranchPoint(branchPoint); - out.writeInt(invalidObjects.size()); + out.writeXInt(invalidObjects.size()); for (InternalCDOObject object : invalidObjects) { out.writeCDOID(object.cdoID()); @@ -69,13 +69,13 @@ public class SwitchTargetRequest extends CDOClientRequestWithMonitoring<Object> @Override protected boolean[] confirming(CDODataInput in, OMMonitor monitor) throws IOException { - int size = in.readInt(); + int size = in.readXInt(); for (int i = 0; i < size; i++) { allChangedObjects.add(in.readCDORevisionDelta()); } - size = in.readInt(); + size = in.readXInt(); for (int i = 0; i < size; i++) { CDOID id = in.readCDOID(); diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/UnitRequest.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/UnitRequest.java index f9f3c41239..967fce8442 100644 --- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/UnitRequest.java +++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/UnitRequest.java @@ -47,7 +47,7 @@ public class UnitRequest extends CDOClientRequestWithMonitoring<Boolean> @Override protected void requesting(CDODataOutput out, OMMonitor monitor) throws IOException { - out.writeInt(viewID); + out.writeXInt(viewID); out.writeCDOID(rootID); out.writeByte(opcode.ordinal()); } diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/UnlockObjectsRequest.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/UnlockObjectsRequest.java index 79ecee0387..7e7a0064db 100644 --- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/UnlockObjectsRequest.java +++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/UnlockObjectsRequest.java @@ -57,7 +57,7 @@ public class UnlockObjectsRequest extends CDOClientRequest<UnlockObjectsResult> @Override protected void requesting(CDODataOutput out) throws IOException { - out.writeInt(viewID); + out.writeXInt(viewID); out.writeCDOLockType(lockType); out.writeBoolean(recursive); if (objectIDs == null) @@ -67,7 +67,7 @@ public class UnlockObjectsRequest extends CDOClientRequest<UnlockObjectsResult> TRACER.format("Unlocking all objects for view {0}", viewID); //$NON-NLS-1$ } - out.writeInt(CDOProtocolConstants.RELEASE_ALL_LOCKS); + out.writeXInt(CDOProtocolConstants.RELEASE_ALL_LOCKS); } else { @@ -77,7 +77,7 @@ public class UnlockObjectsRequest extends CDOClientRequest<UnlockObjectsResult> : "write", viewID); //$NON-NLS-1$ } - out.writeInt(objectIDs.size()); + out.writeXInt(objectIDs.size()); for (CDOID id : objectIDs) { if (TRACER.isEnabled()) @@ -93,8 +93,8 @@ public class UnlockObjectsRequest extends CDOClientRequest<UnlockObjectsResult> @Override protected UnlockObjectsResult confirming(CDODataInput in) throws IOException { - long timestamp = in.readLong(); - int n = in.readInt(); + long timestamp = in.readXLong(); + int n = in.readXInt(); CDOLockState[] newLockStates = new CDOLockState[n]; for (int i = 0; i < n; i++) { diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractHorizontalMappingStrategy.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractHorizontalMappingStrategy.java index 880122d66f..9952dca840 100644 --- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractHorizontalMappingStrategy.java +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractHorizontalMappingStrategy.java @@ -186,7 +186,7 @@ public abstract class AbstractHorizontalMappingStrategy extends AbstractMappingS IDBConnection connection = accessor.getDBConnection(); Collection<IClassMapping> classMappings = getClassMappings(true).values(); - out.writeInt(classMappings.size()); + out.writeXInt(classMappings.size()); for (IClassMapping classMapping : classMappings) { @@ -227,7 +227,7 @@ public abstract class AbstractHorizontalMappingStrategy extends AbstractMappingS public void rawImport(IDBStoreAccessor accessor, CDODataInput in, long fromCommitTime, long toCommitTime, OMMonitor monitor) throws IOException { - int size = in.readInt(); + int size = in.readXInt(); if (size == 0) { return; diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/HorizontalBranchingMappingStrategyWithRanges.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/HorizontalBranchingMappingStrategyWithRanges.java index eb94575f22..3786cd3252 100644 --- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/HorizontalBranchingMappingStrategyWithRanges.java +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/HorizontalBranchingMappingStrategyWithRanges.java @@ -129,7 +129,7 @@ public class HorizontalBranchingMappingStrategyWithRanges extends HorizontalBran // Write resultSet size for progress monitoring int size = DBUtil.getRowCount(resultSet); - out.writeInt(size); + out.writeXInt(size); if (size == 0) { return; @@ -144,10 +144,10 @@ public class HorizontalBranchingMappingStrategyWithRanges extends HorizontalBran int idx = resultSet.getInt(5); out.writeCDOID(source); - out.writeInt(branch); - out.writeInt(versionAdded); - out.writeInt(versionRemoved); - out.writeInt(idx); + out.writeXInt(branch); + out.writeXInt(versionAdded); + out.writeXInt(versionRemoved); + out.writeXInt(idx); } } catch (SQLException ex) @@ -190,7 +190,7 @@ public class HorizontalBranchingMappingStrategyWithRanges extends HorizontalBran private void rawImportListPostProcess(CDODataInput in, IDBConnection connection, IDBTable table, OMMonitor monitor) throws IOException { - int size = in.readInt(); + int size = in.readXInt(); if (size == 0) { return; @@ -224,10 +224,10 @@ public class HorizontalBranchingMappingStrategyWithRanges extends HorizontalBran for (int row = 0; row < size; row++) { CDOID source = in.readCDOID(); - int branch = in.readInt(); - int versionAdded = in.readInt(); - int versionRemoved = in.readInt(); - int idx = in.readInt(); + int branch = in.readXInt(); + int versionAdded = in.readXInt(); + int versionRemoved = in.readXInt(); + int idx = in.readXInt(); stmt.setInt(1, versionRemoved); idHandler.setCDOID(stmt, 2, source); diff --git a/plugins/org.eclipse.emf.cdo.server.lissome/src/org/eclipse/emf/cdo/server/internal/lissome/LissomeFileHandle.java b/plugins/org.eclipse.emf.cdo.server.lissome/src/org/eclipse/emf/cdo/server/internal/lissome/LissomeFileHandle.java index e3d6082b07..6b2f0085b7 100644 --- a/plugins/org.eclipse.emf.cdo.server.lissome/src/org/eclipse/emf/cdo/server/internal/lissome/LissomeFileHandle.java +++ b/plugins/org.eclipse.emf.cdo.server.lissome/src/org/eclipse/emf/cdo/server/internal/lissome/LissomeFileHandle.java @@ -56,8 +56,10 @@ import org.eclipse.net4j.util.io.DataInputOutputFile; import org.eclipse.net4j.util.io.DataOutputExtender; import org.eclipse.net4j.util.io.ExtendedDataInput; import org.eclipse.net4j.util.io.ExtendedDataOutput; +import org.eclipse.net4j.util.io.ExtendedIOUtil; import org.eclipse.net4j.util.io.ExtendedIOUtil.ClassResolver; import org.eclipse.net4j.util.io.IORuntimeException; +import org.eclipse.net4j.util.om.OMPlatform; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EClassifier; @@ -72,6 +74,8 @@ import java.io.IOException; */ public class LissomeFileHandle extends DataInputOutputFile implements CDODataInput, CDODataOutput, LissomeFile.RevisionProvider { + private static final boolean X_COMPRESSION = OMPlatform.INSTANCE.isProperty("org.eclipse.emf.cdo.server.lissome.X_COMPRESSION"); + private LissomeFile file; private CDODataInput in; @@ -173,14 +177,14 @@ public class LissomeFileHandle extends DataInputOutputFile implements CDODataInp boolean detached = readBoolean(); if (detached) { - int cid = readInt(); + int cid = readXInt(); EClass eClass = (EClass)file.getStore().getMetaObject(cid); CDOID id = readCDOID(); CDOBranch branch = readCDOBranch(); - int version = readInt(); - long timeStamp = readLong(); - long revised = readLong(); + int version = readXInt(); + long timeStamp = readXLong(); + long revised = readXLong(); return new DetachedCDORevision(eClass, id, branch, version, timeStamp, revised); } @@ -225,6 +229,36 @@ public class LissomeFileHandle extends DataInputOutputFile implements CDODataInp }; } + public int readVarInt() throws IOException + { + return ExtendedIOUtil.readVarInt(in()); + } + + public long readVarLong() throws IOException + { + return ExtendedIOUtil.readVarLong(in()); + } + + public int readXInt() throws IOException + { + if (isXCompression()) + { + return readVarInt(); + } + + return readInt(); + } + + public long readXLong() throws IOException + { + if (isXCompression()) + { + return readVarLong(); + } + + return readLong(); + } + public byte[] readByteArray() throws IOException { return in().readByteArray(); @@ -448,13 +482,13 @@ public class LissomeFileHandle extends DataInputOutputFile implements CDODataInp if (detached) { int cid = file.getStore().getMetaID(revision.getEClass()); - writeInt(cid); + writeXInt(cid); writeCDOID(revision.getID()); writeCDOBranch(revision.getBranch()); - writeInt(revision.getVersion()); - writeLong(revision.getTimeStamp()); - writeLong(revision.getRevised()); + writeXInt(revision.getVersion()); + writeXLong(revision.getTimeStamp()); + writeXLong(revision.getRevised()); } else { @@ -476,6 +510,40 @@ public class LissomeFileHandle extends DataInputOutputFile implements CDODataInp }; } + public void writeVarInt(int v) throws IOException + { + ExtendedIOUtil.writeVarInt(out(), v); + } + + public void writeVarLong(long v) throws IOException + { + ExtendedIOUtil.writeVarLong(out(), v); + } + + public void writeXInt(int v) throws IOException + { + if (isXCompression()) + { + writeVarInt(v); + } + else + { + writeInt(v); + } + } + + public void writeXLong(long v) throws IOException + { + if (isXCompression()) + { + writeVarLong(v); + } + else + { + writeLong(v); + } + } + public void writeByteArray(byte[] b) throws IOException { out().writeByteArray(b); @@ -696,4 +764,9 @@ public class LissomeFileHandle extends DataInputOutputFile implements CDODataInp throw new IORuntimeException(ex); } } + + protected boolean isXCompression() + { + return X_COMPRESSION; + } } diff --git a/plugins/org.eclipse.emf.cdo.server.lissome/src/org/eclipse/emf/cdo/server/internal/lissome/file/Journal.java b/plugins/org.eclipse.emf.cdo.server.lissome/src/org/eclipse/emf/cdo/server/internal/lissome/file/Journal.java index 1cfbf785f6..44226bc477 100644 --- a/plugins/org.eclipse.emf.cdo.server.lissome/src/org/eclipse/emf/cdo/server/internal/lissome/file/Journal.java +++ b/plugins/org.eclipse.emf.cdo.server.lissome/src/org/eclipse/emf/cdo/server/internal/lissome/file/Journal.java @@ -124,8 +124,8 @@ public class Journal extends LissomeFile try { writer.seek(0); - writer.writeLong(commitPointer); - writer.writeLong(packageUnitPointer); + writer.writeXLong(commitPointer); + writer.writeXLong(packageUnitPointer); } catch (IOException ex) { @@ -142,8 +142,8 @@ public class Journal extends LissomeFile try { writer.seek(0); - commitPointer = writer.readLong(); - packageUnitPointer = writer.readLong(); + commitPointer = writer.readXLong(); + packageUnitPointer = writer.readXLong(); } catch (IOException ex) { @@ -171,16 +171,16 @@ public class Journal extends LissomeFile while (filePointer != 0) { reader.seek(filePointer); - filePointer = reader.readLong(); + filePointer = reader.readXLong(); - int size = reader.readInt(); + int size = reader.readXInt(); for (int i = 0; i < size; i++) { InternalCDOPackageUnit packageUnit = (InternalCDOPackageUnit)reader.readCDOPackageUnit(resourceSet); packageUnit.setPackageRegistry(packageRegistry); result.add(packageUnit); - long ePackagePointer = reader.readLong(); + long ePackagePointer = reader.readXLong(); ePackagePointers.put(packageUnit.getID(), ePackagePointer); EPackage ePackage = packageUnit.getTopLevelPackageInfo().getEPackage(); @@ -244,33 +244,33 @@ public class Journal extends LissomeFile LissomeStore store = getStore(); checkMetaObject(ePackage, reader.readString()); - store.mapMetaObject(ePackage, reader.readInt()); + store.mapMetaObject(ePackage, reader.readXInt()); EList<EClassifier> eClassifiers = ePackage.getEClassifiers(); - checkListSize(eClassifiers, reader.readInt()); + checkListSize(eClassifiers, reader.readXInt()); for (EClassifier eClassifier : eClassifiers) { checkMetaObject(eClassifier, reader.readString()); - store.mapMetaObject(eClassifier, reader.readInt()); + store.mapMetaObject(eClassifier, reader.readXInt()); if (eClassifier instanceof EClass) { EClass eClass = (EClass)eClassifier; EList<EStructuralFeature> eStructuralFeatures = eClass.getEStructuralFeatures(); - checkListSize(eStructuralFeatures, reader.readInt()); + checkListSize(eStructuralFeatures, reader.readXInt()); for (EStructuralFeature eStructuralFeature : eStructuralFeatures) { checkMetaObject(eStructuralFeature, reader.readString()); - store.mapMetaObject(eStructuralFeature, reader.readInt()); + store.mapMetaObject(eStructuralFeature, reader.readXInt()); } } } EList<EPackage> eSubpackages = ePackage.getESubpackages(); - checkListSize(eSubpackages, reader.readInt()); + checkListSize(eSubpackages, reader.readXInt()); for (EPackage eSubpackage : eSubpackages) { @@ -283,33 +283,33 @@ public class Journal extends LissomeFile LissomeStore store = getStore(); writer.writeString(ePackage.getName()); - writer.writeInt(store.mapMetaObject(ePackage)); + writer.writeXInt(store.mapMetaObject(ePackage)); EList<EClassifier> eClassifiers = ePackage.getEClassifiers(); - writer.writeInt(eClassifiers.size()); + writer.writeXInt(eClassifiers.size()); for (EClassifier eClassifier : eClassifiers) { writer.writeString(eClassifier.getName()); - writer.writeInt(store.mapMetaObject(eClassifier)); + writer.writeXInt(store.mapMetaObject(eClassifier)); if (eClassifier instanceof EClass) { EClass eClass = (EClass)eClassifier; EList<EStructuralFeature> eStructuralFeatures = eClass.getEStructuralFeatures(); - writer.writeInt(eStructuralFeatures.size()); + writer.writeXInt(eStructuralFeatures.size()); for (EStructuralFeature eStructuralFeature : eStructuralFeatures) { writer.writeString(eStructuralFeature.getName()); - writer.writeInt(store.mapMetaObject(eStructuralFeature)); + writer.writeXInt(store.mapMetaObject(eStructuralFeature)); } } } EList<EPackage> eSubpackages = ePackage.getESubpackages(); - writer.writeInt(eSubpackages.size()); + writer.writeXInt(eSubpackages.size()); for (EPackage eSubpackage : eSubpackages) { @@ -357,7 +357,7 @@ public class Journal extends LissomeFile protected void writePackageUnits(LissomeFileHandle writer, InternalCDOPackageUnit[] packageUnits, OMMonitor monitor) throws IOException { - writer.writeInt(packageUnits.length); + writer.writeXInt(packageUnits.length); for (InternalCDOPackageUnit packageUnit : packageUnits) { long ePackagePointer = writer.getFilePointer(); @@ -370,15 +370,15 @@ public class Journal extends LissomeFile } newPackageUnitPointer = writer.getFilePointer(); - writer.writeLong(packageUnitPointer); + writer.writeXLong(packageUnitPointer); - writer.writeInt(packageUnits.length); + writer.writeXInt(packageUnits.length); for (InternalCDOPackageUnit packageUnit : packageUnits) { writer.writeCDOPackageUnit(packageUnit, false); long ePackagePointer = ePackagePointers.get(packageUnit.getID()); - writer.writeLong(ePackagePointer); + writer.writeXLong(ePackagePointer); EPackage ePackage = packageUnit.getTopLevelPackageInfo().getEPackage(); mapPackage(ePackage); @@ -399,10 +399,10 @@ public class Journal extends LissomeFile public void execute(LissomeFileHandle writer) throws IOException { writer.writeByte(CREATE_BRANCH_BLOCK); - writer.writeInt(branchID); + writer.writeXInt(branchID); writer.writeString(branchInfo.getName()); - writer.writeInt(branchInfo.getBaseBranchID()); - writer.writeLong(branchInfo.getBaseTimeStamp()); + writer.writeXInt(branchInfo.getBaseBranchID()); + writer.writeXLong(branchInfo.getBaseTimeStamp()); } }); } @@ -438,9 +438,9 @@ public class Journal extends LissomeFile public void execute(LissomeFileHandle writer) throws IOException { writer.writeByte(COMMIT_TRANSACTION_BLOCK); - writer.writeLong(commitPointer); + writer.writeXLong(commitPointer); writer.writeCDOBranchPoint(branchPoint); - writer.writeLong(previousTimeStamp); + writer.writeXLong(previousTimeStamp); writer.writeString(userID); writer.writeString(commitComment); monitor.worked(); @@ -464,7 +464,7 @@ public class Journal extends LissomeFile writer.writeBoolean(detachedObjectTypes != null); writer.writeBoolean(detachedObjectVersions != null); - writer.writeInt(detachedObjects.length); + writer.writeXInt(detachedObjects.length); for (int i = 0; i < detachedObjects.length; i++) { @@ -482,7 +482,7 @@ public class Journal extends LissomeFile if (eClass != null) { int cid = getStore().getMetaID(eClass); - writer.writeInt(cid); + writer.writeXInt(cid); } if (branchVersion != null) @@ -490,11 +490,11 @@ public class Journal extends LissomeFile int version = branchVersion.getVersion(); if (branchVersion.getBranch() == transactionBranch) { - writer.writeInt(version); + writer.writeXInt(version); } else { - writer.writeInt(-version); + writer.writeXInt(-version); writer.writeCDOBranch(branchVersion.getBranch()); } } @@ -504,7 +504,7 @@ public class Journal extends LissomeFile // New objects Map<CDORevision, Long> newObjectPointers = commitTransactionTask.getNewObjectPointers(); - writer.writeInt(newObjects.length); + writer.writeXInt(newObjects.length); for (InternalCDORevision revision : newObjects) { long pointer = writer.getFilePointer(); @@ -514,7 +514,7 @@ public class Journal extends LissomeFile } // Dirty object deltas - writer.writeInt(dirtyObjectDeltas.length); + writer.writeXInt(dirtyObjectDeltas.length); for (InternalCDORevisionDelta revisionDelta : dirtyObjectDeltas) { writer.writeCDORevisionDelta(revisionDelta); @@ -581,8 +581,8 @@ public class Journal extends LissomeFile packageUnitPointer = newPackageUnitPointer; writer.seek(0L); - writer.writeLong(commitPointer); - writer.writeLong(packageUnitPointer); + writer.writeXLong(commitPointer); + writer.writeXLong(packageUnitPointer); } return commitTransactionTask; @@ -626,12 +626,12 @@ public class Journal extends LissomeFile { reader.seek(pointer); reader.readByte(); // COMMIT_TRANSACTION_BLOCK - reader.readLong(); // commitPointer + reader.readXLong(); // commitPointer CDOBranchPoint branchPoint = reader.readCDOBranchPoint(); CDOBranch branch = branchPoint.getBranch(); long timeStamp = branchPoint.getTimeStamp(); - long previousTimeStamp = reader.readLong(); + long previousTimeStamp = reader.readXLong(); String userID = reader.readString(); String comment = reader.readString(); diff --git a/plugins/org.eclipse.emf.cdo.server.lissome/src/org/eclipse/emf/cdo/server/internal/lissome/file/Vob.java b/plugins/org.eclipse.emf.cdo.server.lissome/src/org/eclipse/emf/cdo/server/internal/lissome/file/Vob.java index 9f94401686..233dbe18a2 100644 --- a/plugins/org.eclipse.emf.cdo.server.lissome/src/org/eclipse/emf/cdo/server/internal/lissome/file/Vob.java +++ b/plugins/org.eclipse.emf.cdo.server.lissome/src/org/eclipse/emf/cdo/server/internal/lissome/file/Vob.java @@ -37,7 +37,7 @@ public class Vob extends LissomeFile super(store, store.getRepository().getName() + "." + EXTENSION); writer = openWriter(); writer.seek(0); - writer.writeLong(System.currentTimeMillis()); + writer.writeXLong(System.currentTimeMillis()); } @Override diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerIndication.java index 59525f5e1b..bd0eafba8f 100644 --- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerIndication.java +++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerIndication.java @@ -18,6 +18,7 @@ import org.eclipse.emf.cdo.common.lob.CDOLobStore; import org.eclipse.emf.cdo.common.model.CDOPackageRegistry; import org.eclipse.emf.cdo.common.protocol.CDODataInput; import org.eclipse.emf.cdo.common.protocol.CDODataOutput; +import org.eclipse.emf.cdo.common.protocol.CDOProtocolConstants; import org.eclipse.emf.cdo.common.revision.CDOListFactory; import org.eclipse.emf.cdo.common.revision.CDORevisionFactory; import org.eclipse.emf.cdo.common.security.CDOPermissionProvider; @@ -112,6 +113,12 @@ public abstract class CDOServerIndication extends IndicationWithResponse } @Override + protected boolean isXCompression() + { + return CDOProtocolConstants.X_COMPRESSION; + } + + @Override protected StringIO getPackageURICompressor() { return getProtocol().getPackageURICompressor(); @@ -179,6 +186,12 @@ public abstract class CDOServerIndication extends IndicationWithResponse } @Override + protected boolean isXCompression() + { + return CDOProtocolConstants.X_COMPRESSION; + } + + @Override protected StringIO getPackageURICompressor() { return getProtocol().getPackageURICompressor(); diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerIndicationWithMonitoring.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerIndicationWithMonitoring.java index af0029f50f..8f6a5da352 100644 --- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerIndicationWithMonitoring.java +++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerIndicationWithMonitoring.java @@ -20,6 +20,7 @@ import org.eclipse.emf.cdo.common.lob.CDOLobStore; import org.eclipse.emf.cdo.common.model.CDOPackageRegistry; import org.eclipse.emf.cdo.common.protocol.CDODataInput; import org.eclipse.emf.cdo.common.protocol.CDODataOutput; +import org.eclipse.emf.cdo.common.protocol.CDOProtocolConstants; import org.eclipse.emf.cdo.common.revision.CDOListFactory; import org.eclipse.emf.cdo.common.revision.CDORevisionFactory; import org.eclipse.emf.cdo.internal.common.revision.CDOListImpl; @@ -122,6 +123,12 @@ public abstract class CDOServerIndicationWithMonitoring extends IndicationWithMo } @Override + protected boolean isXCompression() + { + return CDOProtocolConstants.X_COMPRESSION; + } + + @Override protected StringIO getPackageURICompressor() { return getProtocol().getPackageURICompressor(); @@ -195,6 +202,12 @@ public abstract class CDOServerIndicationWithMonitoring extends IndicationWithMo } @Override + protected boolean isXCompression() + { + return CDOProtocolConstants.X_COMPRESSION; + } + + @Override protected StringIO getPackageURICompressor() { return getProtocol().getPackageURICompressor(); diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerRequest.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerRequest.java index 24dab5b80b..ccbbebf53c 100644 --- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerRequest.java +++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerRequest.java @@ -13,6 +13,7 @@ package org.eclipse.emf.cdo.server.internal.net4j.protocol; import org.eclipse.emf.cdo.common.id.CDOIDProvider; import org.eclipse.emf.cdo.common.model.CDOPackageRegistry; import org.eclipse.emf.cdo.common.protocol.CDODataOutput; +import org.eclipse.emf.cdo.common.protocol.CDOProtocolConstants; import org.eclipse.emf.cdo.spi.common.protocol.CDODataOutputImpl; import org.eclipse.emf.cdo.spi.common.revision.CDORevisionUnchunker; import org.eclipse.emf.cdo.spi.server.InternalSession; @@ -76,6 +77,12 @@ public abstract class CDOServerRequest extends Request } @Override + protected boolean isXCompression() + { + return CDOProtocolConstants.X_COMPRESSION; + } + + @Override protected StringIO getPackageURICompressor() { return getProtocol().getPackageURICompressor(); diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/ChangeSubscriptionIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/ChangeSubscriptionIndication.java index 973d9441cc..234d5da53f 100644 --- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/ChangeSubscriptionIndication.java +++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/ChangeSubscriptionIndication.java @@ -39,9 +39,9 @@ public class ChangeSubscriptionIndication extends CDOServerReadIndication { boolean subscribeMode = true; - int viewID = in.readInt(); + int viewID = in.readXInt(); boolean clear = in.readBoolean(); - int size = in.readInt(); + int size = in.readXInt(); if (size <= 0) { subscribeMode = false; diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CloseViewIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CloseViewIndication.java index c21994e3df..176d9032c3 100644 --- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CloseViewIndication.java +++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CloseViewIndication.java @@ -30,7 +30,7 @@ public class CloseViewIndication extends CDOServerReadIndication @Override protected void indicating(CDODataInput in) throws IOException { - int viewID = in.readInt(); + int viewID = in.readXInt(); IView view = getView(viewID); if (view != null) { diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CommitTransactionIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CommitTransactionIndication.java index 99b9c50721..cbd2fb73e4 100644 --- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CommitTransactionIndication.java +++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CommitTransactionIndication.java @@ -88,7 +88,7 @@ public class CommitTransactionIndication extends CDOServerIndicationWithMonitori protected void initializeCommitContext(CDODataInput in) throws Exception { - int viewID = in.readInt(); + int viewID = in.readXInt(); commitContext = getTransaction(viewID).createCommitContext(); } @@ -126,17 +126,17 @@ public class CommitTransactionIndication extends CDOServerIndicationWithMonitori initializeCommitContext(in); commitContext.preWrite(); - long lastUpdateTime = in.readLong(); - int commitNumber = in.readInt(); + long lastUpdateTime = in.readXLong(); + int commitNumber = in.readXInt(); String commitComment = in.readString(); CDOBranchPoint commitMergeSource = CDOBranchUtil.readBranchPointOrNull(in); - CDOLockState[] locksOnNewObjects = new CDOLockState[in.readInt()]; - CDOID[] idsToUnlock = new CDOID[in.readInt()]; - InternalCDOPackageUnit[] newPackageUnits = new InternalCDOPackageUnit[in.readInt()]; - InternalCDORevision[] newObjects = new InternalCDORevision[in.readInt()]; - InternalCDORevisionDelta[] dirtyObjectDeltas = new InternalCDORevisionDelta[in.readInt()]; - CDOID[] detachedObjects = new CDOID[in.readInt()]; + CDOLockState[] locksOnNewObjects = new CDOLockState[in.readXInt()]; + CDOID[] idsToUnlock = new CDOID[in.readXInt()]; + InternalCDOPackageUnit[] newPackageUnits = new InternalCDOPackageUnit[in.readXInt()]; + InternalCDORevision[] newObjects = new InternalCDORevision[in.readXInt()]; + InternalCDORevisionDelta[] dirtyObjectDeltas = new InternalCDORevisionDelta[in.readXInt()]; + CDOID[] detachedObjects = new CDOID[in.readXInt()]; monitor .begin(locksOnNewObjects.length + idsToUnlock.length + newPackageUnits.length + newObjects.length + dirtyObjectDeltas.length + detachedObjects.length); @@ -265,7 +265,7 @@ public class CommitTransactionIndication extends CDOServerIndicationWithMonitori if (detachedObjectVersions != null) { CDOBranch branch; - int version = in.readInt(); + int version = in.readXInt(); if (version < 0) { version = -version; @@ -361,11 +361,11 @@ public class CommitTransactionIndication extends CDOServerIndicationWithMonitori out.writeByte(rollbackReason); out.writeString(rollbackMessage); out.writeCDOBranchPoint(commitContext.getBranchPoint()); - out.writeLong(commitContext.getPreviousTimeStamp()); + out.writeXLong(commitContext.getPreviousTimeStamp()); if (xRefs != null) { - out.writeInt(xRefs.size()); + out.writeXInt(xRefs.size()); for (CDOIDReference xRef : xRefs) { out.writeCDOIDReference(xRef); @@ -373,7 +373,7 @@ public class CommitTransactionIndication extends CDOServerIndicationWithMonitori } else { - out.writeInt(0); + out.writeXInt(0); } } @@ -383,7 +383,7 @@ public class CommitTransactionIndication extends CDOServerIndicationWithMonitori protected void respondingResult(CDODataOutput out) throws Exception { out.writeCDOBranchPoint(commitContext.getBranchPoint()); - out.writeLong(commitContext.getPreviousTimeStamp()); + out.writeXLong(commitContext.getPreviousTimeStamp()); out.writeByte(commitContext.getSecurityImpact()); } @@ -406,7 +406,7 @@ public class CommitTransactionIndication extends CDOServerIndicationWithMonitori List<LockState<Object, IView>> newLockStates = commitContext.getPostCommmitLockStates(); if (newLockStates != null) { - out.writeInt(newLockStates.size()); + out.writeXInt(newLockStates.size()); for (LockState<Object, IView> lockState : newLockStates) { CDOLockState cdoLockState = CDOLockUtil.createLockState(lockState); @@ -415,7 +415,7 @@ public class CommitTransactionIndication extends CDOServerIndicationWithMonitori } else { - out.writeInt(0); + out.writeXInt(0); } } @@ -432,7 +432,7 @@ public class CommitTransactionIndication extends CDOServerIndicationWithMonitori InternalCDORevision[] newObjects = commitContext.getNewObjects(); InternalCDORevision[] dirtyObjects = commitContext.getDirtyObjects(); - out.writeInt(newObjects.length + dirtyObjects.length); + out.writeXInt(newObjects.length + dirtyObjects.length); respondingNewPermissions(out, permissionManager, session, newObjects); respondingNewPermissions(out, permissionManager, session, dirtyObjects); diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CommitXATransactionCancelIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CommitXATransactionCancelIndication.java index 08605df814..d705917dbf 100644 --- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CommitXATransactionCancelIndication.java +++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CommitXATransactionCancelIndication.java @@ -61,7 +61,7 @@ public class CommitXATransactionCancelIndication extends CommitTransactionIndica @Override protected void initializeCommitContext(CDODataInput in) throws Exception { - int viewID = in.readInt(); + int viewID = in.readXInt(); commitContext = getRepository().getCommitManager().get(getTransaction(viewID)); } } diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CommitXATransactionPhase1Indication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CommitXATransactionPhase1Indication.java index 50ec879e19..eba235a8ab 100644 --- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CommitXATransactionPhase1Indication.java +++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CommitXATransactionPhase1Indication.java @@ -46,7 +46,7 @@ public class CommitXATransactionPhase1Indication extends CommitTransactionIndica @Override protected void initializeCommitContext(CDODataInput in) throws Exception { - int viewID = in.readInt(); + int viewID = in.readXInt(); InternalTransaction transaction = getTransaction(viewID); commitContext = new XATransactionCommitContext(transaction); } diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CommitXATransactionPhase2Indication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CommitXATransactionPhase2Indication.java index b477be0216..6eaa8167c7 100644 --- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CommitXATransactionPhase2Indication.java +++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CommitXATransactionPhase2Indication.java @@ -44,7 +44,7 @@ public class CommitXATransactionPhase2Indication extends CommitTransactionIndica initializeCommitContext(in); XATransactionCommitContext xaContextContext = (XATransactionCommitContext)commitContext; - int size = in.readInt(); + int size = in.readXInt(); if (PROTOCOL.isEnabled()) { PROTOCOL.format("Receiving {0} mapping informations", size); //$NON-NLS-1$ @@ -91,7 +91,7 @@ public class CommitXATransactionPhase2Indication extends CommitTransactionIndica @Override protected void initializeCommitContext(CDODataInput in) throws Exception { - int viewID = in.readInt(); + int viewID = in.readXInt(); commitContext = getRepository().getCommitManager().get(getTransaction(viewID)); } } diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CommitXATransactionPhase3Indication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CommitXATransactionPhase3Indication.java index fd473c9376..1b73ef9211 100644 --- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CommitXATransactionPhase3Indication.java +++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CommitXATransactionPhase3Indication.java @@ -44,7 +44,7 @@ public class CommitXATransactionPhase3Indication extends CommitTransactionIndica @Override protected void initializeCommitContext(CDODataInput in) throws Exception { - int viewID = in.readInt(); + int viewID = in.readXInt(); commitContext = getRepository().getCommitManager().get(getTransaction(viewID)); } } diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CreateBranchIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CreateBranchIndication.java index 961b211525..3fb07d09d8 100644 --- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CreateBranchIndication.java +++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CreateBranchIndication.java @@ -39,7 +39,7 @@ public class CreateBranchIndication extends CDOServerWriteIndication @Override protected void indicating(CDODataInput in) throws IOException { - branchID = in.readInt(); + branchID = in.readXInt(); branchInfo = new BranchInfo(in); } @@ -54,7 +54,7 @@ public class CreateBranchIndication extends CDOServerWriteIndication InternalSessionManager sessionManager = getRepository().getSessionManager(); sessionManager.sendBranchNotification(session, branch, ChangeKind.CREATED); - out.writeInt(branch.getID()); - out.writeLong(branch.getBase().getTimeStamp()); + out.writeXInt(branch.getID()); + out.writeXLong(branch.getBase().getTimeStamp()); } } diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/EnableLockNotificationIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/EnableLockNotificationIndication.java index adde6acc21..b2c5185fca 100644 --- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/EnableLockNotificationIndication.java +++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/EnableLockNotificationIndication.java @@ -30,7 +30,7 @@ public class EnableLockNotificationIndication extends CDOServerIndication @Override protected void indicating(CDODataInput in) throws IOException { - int viewID = in.readInt(); + int viewID = in.readXInt(); boolean enable = in.readBoolean(); InternalView view = getView(viewID); diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/GetRemoteSessionsIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/GetRemoteSessionsIndication.java index 32c3bf7e2c..f8729bb8d3 100644 --- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/GetRemoteSessionsIndication.java +++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/GetRemoteSessionsIndication.java @@ -53,13 +53,13 @@ public class GetRemoteSessionsIndication extends CDOServerReadIndication { if (session != localSession) { - out.writeInt(session.getSessionID()); + out.writeXInt(session.getSessionID()); out.writeString(session.getUserID()); out.writeBoolean(session.isSubscribed()); } } - out.writeInt(CDOProtocolConstants.NO_MORE_REMOTE_SESSIONS); + out.writeXInt(CDOProtocolConstants.NO_MORE_REMOTE_SESSIONS); localSession.setSubscribed(subscribe); } } diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/HandleRevisionsIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/HandleRevisionsIndication.java index f28be3a098..baef3281d2 100644 --- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/HandleRevisionsIndication.java +++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/HandleRevisionsIndication.java @@ -74,7 +74,7 @@ public class HandleRevisionsIndication extends CDOServerReadIndication } } - timeStamp = in.readLong(); + timeStamp = in.readXLong(); if (TRACER.isEnabled()) { TRACER.format("Read timeStamp: {0}", CDOCommonUtil.formatTimeStamp(timeStamp)); //$NON-NLS-1$ diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LoadBranchIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LoadBranchIndication.java index fb70484ad4..e73c405e14 100644 --- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LoadBranchIndication.java +++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LoadBranchIndication.java @@ -34,7 +34,7 @@ public class LoadBranchIndication extends CDOServerReadIndication @Override protected void indicating(CDODataInput in) throws IOException { - branchID = in.readInt(); + branchID = in.readXInt(); } @Override diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LoadBranchesIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LoadBranchesIndication.java index 5c4e86734b..1fcd7c3ceb 100644 --- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LoadBranchesIndication.java +++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LoadBranchesIndication.java @@ -38,8 +38,8 @@ public class LoadBranchesIndication extends CDOServerReadIndication @Override protected void indicating(CDODataInput in) throws IOException { - startID = in.readInt(); - endID = in.readInt(); + startID = in.readXInt(); + endID = in.readXInt(); } @Override diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LoadChangeSetsIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LoadChangeSetsIndication.java index 4cf6a44287..fab2072936 100644 --- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LoadChangeSetsIndication.java +++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LoadChangeSetsIndication.java @@ -36,7 +36,7 @@ public class LoadChangeSetsIndication extends CDOServerReadIndication @Override protected void indicating(CDODataInput in) throws IOException { - int size = in.readInt(); + int size = in.readXInt(); ranges = new CDOBranchPointRange[size]; for (int i = 0; i < ranges.length; i++) { diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LoadChunkIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LoadChunkIndication.java index b77ce48c12..793b9c8477 100644 --- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LoadChunkIndication.java +++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LoadChunkIndication.java @@ -69,20 +69,20 @@ public class LoadChunkIndication extends CDOServerReadIndication } EClass eClass = (EClass)in.readCDOClassifierRefAndResolve(); - int featureID = in.readInt(); + int featureID = in.readXInt(); feature = eClass.getEStructuralFeature(featureID); if (TRACER.isEnabled()) { TRACER.format("Read feature: {0}", feature); //$NON-NLS-1$ } - fromIndex = in.readInt(); + fromIndex = in.readXInt(); if (TRACER.isEnabled()) { TRACER.format("Read fromIndex: {0}", fromIndex); //$NON-NLS-1$ } - toIndex = in.readInt(); + toIndex = in.readXInt(); if (TRACER.isEnabled()) { TRACER.format("Read toIndex: {0}", toIndex); //$NON-NLS-1$ diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LoadCommitDataIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LoadCommitDataIndication.java index 254d23a7ab..4adbf3a449 100644 --- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LoadCommitDataIndication.java +++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LoadCommitDataIndication.java @@ -33,7 +33,7 @@ public class LoadCommitDataIndication extends CDOServerReadIndication @Override protected void indicating(CDODataInput in) throws IOException { - timeStamp = in.readLong(); + timeStamp = in.readXLong(); } @Override diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LoadCommitInfosIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LoadCommitInfosIndication.java index a92494ac56..d60516911a 100644 --- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LoadCommitInfosIndication.java +++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LoadCommitInfosIndication.java @@ -43,8 +43,8 @@ public class LoadCommitInfosIndication extends CDOServerReadIndication protected void indicating(CDODataInput in) throws IOException { branch = in.readBoolean() ? in.readCDOBranch() : null; - startTime = in.readLong(); - endTime = in.readLong(); + startTime = in.readXLong(); + endTime = in.readXLong(); } @Override @@ -60,13 +60,13 @@ public class LoadCommitInfosIndication extends CDOServerReadIndication try { out.writeBoolean(true); - out.writeLong(commitInfo.getPreviousTimeStamp()); + out.writeXLong(commitInfo.getPreviousTimeStamp()); if (branch == null) { out.writeCDOBranch(commitInfo.getBranch()); } - out.writeLong(commitInfo.getTimeStamp()); + out.writeXLong(commitInfo.getTimeStamp()); out.writeString(commitInfo.getUserID()); out.writeString(commitInfo.getComment()); CDOBranchUtil.writeBranchPointOrNull(out, commitInfo.getMergeSource()); diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LoadMergeDataIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LoadMergeDataIndication.java index ca6b60236e..8880f4a401 100644 --- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LoadMergeDataIndication.java +++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LoadMergeDataIndication.java @@ -63,7 +63,7 @@ public class LoadMergeDataIndication extends CDOServerReadIndicationWithMonitori @Override protected void indicating(CDODataInput in, OMMonitor monitor) throws Exception { - infos = in.readInt(); + infos = in.readXInt(); monitor.begin(infos); try @@ -94,7 +94,7 @@ public class LoadMergeDataIndication extends CDOServerReadIndicationWithMonitori CDOBranchPoint branchPoint = in.readCDOBranchPoint(); CDORevisionAvailabilityInfo info = new CDORevisionAvailabilityInfo(branchPoint); - int size = in.readInt(); + int size = in.readXInt(); monitor.begin(size); try @@ -215,7 +215,7 @@ public class LoadMergeDataIndication extends CDOServerReadIndicationWithMonitori } int size = revisions.size(); - out.writeInt(size); + out.writeXInt(size); monitor.begin(size); try diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LoadPermissionsIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LoadPermissionsIndication.java index 8ef6881adc..a8ed16b277 100644 --- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LoadPermissionsIndication.java +++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LoadPermissionsIndication.java @@ -44,7 +44,7 @@ public class LoadPermissionsIndication extends CDOServerReadIndication @Override protected void indicating(CDODataInput in) throws IOException { - int length = in.readInt(); + int length = in.readXInt(); ids = new CDOID[length]; oldPermissions = new CDOPermission[length]; @@ -54,7 +54,7 @@ public class LoadPermissionsIndication extends CDOServerReadIndication oldPermissions[i] = CDOPermission.get(in.readByte()); } - referenceChunk = in.readInt(); + referenceChunk = in.readXInt(); } @Override diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LoadRevisionByVersionIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LoadRevisionByVersionIndication.java index 48617410e1..4fa1446421 100644 --- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LoadRevisionByVersionIndication.java +++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LoadRevisionByVersionIndication.java @@ -57,7 +57,7 @@ public class LoadRevisionByVersionIndication extends CDOServerReadIndication TRACER.format("Read branchVersion: {0}", branchVersion); //$NON-NLS-1$ } - referenceChunk = in.readInt(); + referenceChunk = in.readXInt(); if (TRACER.isEnabled()) { TRACER.format("Read referenceChunk: {0}", referenceChunk); //$NON-NLS-1$ diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LoadRevisionsIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LoadRevisionsIndication.java index 41dd5befc8..89f3f45d37 100644 --- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LoadRevisionsIndication.java +++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LoadRevisionsIndication.java @@ -76,17 +76,17 @@ public class LoadRevisionsIndication extends CDOServerReadIndication TRACER.format("Read branchPoint: {0}", branchPoint); //$NON-NLS-1$ } - referenceChunk = in.readInt(); + referenceChunk = in.readXInt(); if (TRACER.isEnabled()) { TRACER.format("Read referenceChunk: {0}", referenceChunk); //$NON-NLS-1$ } - int size = in.readInt(); + int size = in.readXInt(); if (size < 0) { size = -size; - prefetchDepth = in.readInt(); + prefetchDepth = in.readXInt(); if (TRACER.isEnabled()) { TRACER.format("Read prefetchDepth: {0}", prefetchDepth); //$NON-NLS-1$ @@ -110,10 +110,10 @@ public class LoadRevisionsIndication extends CDOServerReadIndication infos[i] = info; } - int fetchSize = in.readInt(); + int fetchSize = in.readXInt(); if (fetchSize > 0) { - loadRevisionCollectionChunkSize = in.readInt(); + loadRevisionCollectionChunkSize = in.readXInt(); if (loadRevisionCollectionChunkSize < 1) { loadRevisionCollectionChunkSize = 1; @@ -197,7 +197,7 @@ public class LoadRevisionsIndication extends CDOServerReadIndication TRACER.format("Writing {0} additional revision infos", additionalSize); //$NON-NLS-1$ } - out.writeInt(additionalSize); + out.writeXInt(additionalSize); for (int i = 0; i < additionalSize; i++) { InternalCDORevision revision = (InternalCDORevision)additionalRevisions.get(i); diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LoadSubBranchesIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LoadSubBranchesIndication.java index 27533544ed..ebe29f88a4 100644 --- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LoadSubBranchesIndication.java +++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LoadSubBranchesIndication.java @@ -34,7 +34,7 @@ public class LoadSubBranchesIndication extends CDOServerReadIndication @Override protected void indicating(CDODataInput in) throws IOException { - branchID = in.readInt(); + branchID = in.readXInt(); } @Override @@ -43,7 +43,7 @@ public class LoadSubBranchesIndication extends CDOServerReadIndication InternalCDOBranchManager branchManager = getRepository().getBranchManager(); InternalCDOBranch branch = branchManager.getBranch(branchID); InternalCDOBranch[] branches = branch.getBranches(); - out.writeInt(branches.length); + out.writeXInt(branches.length); for (InternalCDOBranch subBranch : branches) { SubBranchInfo info = new SubBranchInfo(subBranch.getID(), subBranch.getName(), subBranch.getBase().getTimeStamp()); diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LockAreaIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LockAreaIndication.java index 3e6dbb25cf..df8a9e36c4 100644 --- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LockAreaIndication.java +++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LockAreaIndication.java @@ -36,7 +36,7 @@ public class LockAreaIndication extends CDOServerWriteIndication { InternalLockManager lockManager = getRepository().getLockingManager(); - int viewID = in.readInt(); + int viewID = in.readXInt(); InternalView view = getView(viewID); boolean create = in.readBoolean(); diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LockObjectsIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LockObjectsIndication.java index 6af7b899d6..8d7878ca62 100644 --- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LockObjectsIndication.java +++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LockObjectsIndication.java @@ -49,12 +49,12 @@ public class LockObjectsIndication extends CDOServerWriteIndication @Override protected void indicating(CDODataInput in) throws IOException { - int viewID = in.readInt(); + int viewID = in.readXInt(); LockType lockType = in.readCDOLockType(); boolean recursive = in.readBoolean(); - long timeout = in.readLong(); + long timeout = in.readXLong(); - int nRevisions = in.readInt(); + int nRevisions = in.readXInt(); List<CDORevisionKey> revisionKeys = new LinkedList<CDORevisionKey>(); for (int i = 0; i < nRevisions; i++) { @@ -72,19 +72,19 @@ public class LockObjectsIndication extends CDOServerWriteIndication out.writeBoolean(result.isSuccessful()); out.writeBoolean(result.isTimedOut()); out.writeBoolean(result.isWaitForUpdate()); - out.writeLong(result.getRequiredTimestamp()); + out.writeXLong(result.getRequiredTimestamp()); CDORevisionKey[] staleRevisions = result.getStaleRevisions(); - out.writeInt(staleRevisions.length); + out.writeXInt(staleRevisions.length); for (CDORevisionKey revKey : staleRevisions) { out.writeCDORevisionKey(revKey); } - out.writeLong(result.getTimestamp()); + out.writeXLong(result.getTimestamp()); CDOLockState[] newLockStates = result.getNewLockStates(); - out.writeInt(newLockStates.length); + out.writeXInt(newLockStates.length); for (CDOLockState lockState : newLockStates) { out.writeCDOLockState(lockState); diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LockStateIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LockStateIndication.java index 76528872cf..4091b1051c 100644 --- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LockStateIndication.java +++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LockStateIndication.java @@ -49,7 +49,7 @@ public class LockStateIndication extends CDOServerReadIndication @Override protected void indicating(CDODataInput in) throws IOException { - int viewID = in.readInt(); + int viewID = in.readXInt(); InternalView view = getView(viewID); if (view == null) { @@ -59,11 +59,11 @@ public class LockStateIndication extends CDOServerReadIndication InternalLockManager lockManager = getRepository().getLockingManager(); existingLockStates = new ArrayList<CDOLockState>(); - int n = in.readInt(); + int n = in.readXInt(); if (n < 0) { n = -n; - prefetchDepth = in.readInt(); + prefetchDepth = in.readXInt(); } if (n == 0) @@ -150,7 +150,7 @@ public class LockStateIndication extends CDOServerReadIndication @Override protected void responding(CDODataOutput out) throws IOException { - out.writeInt(existingLockStates.size()); + out.writeXInt(existingLockStates.size()); for (CDOLockState lockState : existingLockStates) { out.writeCDOLockState(lockState); diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/ObjectLockedIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/ObjectLockedIndication.java index 9e78484470..e4c6bd1627 100644 --- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/ObjectLockedIndication.java +++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/ObjectLockedIndication.java @@ -38,7 +38,7 @@ public class ObjectLockedIndication extends CDOServerReadIndication @Override protected void indicating(CDODataInput in) throws IOException { - int viewID = in.readInt(); + int viewID = in.readXInt(); IView view = getView(viewID); InternalLockManager lockManager = getRepository().getLockingManager(); diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/OpenSessionIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/OpenSessionIndication.java index 6d55797ef2..2715c4cfed 100644 --- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/OpenSessionIndication.java +++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/OpenSessionIndication.java @@ -142,7 +142,7 @@ public class OpenSessionIndication extends CDOServerIndicationWithMonitoring catch (NotAuthenticatedException ex) { // Skip response because the user has canceled the authentication - out.writeInt(0); + out.writeXInt(0); flush(); protocol.getExecutorService().submit(new Runnable() @@ -172,7 +172,7 @@ public class OpenSessionIndication extends CDOServerIndicationWithMonitoring TRACER.format("Writing sessionID: {0}", session.getSessionID()); //$NON-NLS-1$ } - out.writeInt(session.getSessionID()); + out.writeXInt(session.getSessionID()); if (TRACER.isEnabled()) { TRACER.format("Writing userID: {0}", session.getUserID()); //$NON-NLS-1$ @@ -192,14 +192,14 @@ public class OpenSessionIndication extends CDOServerIndicationWithMonitoring Set<CDOID.ObjectType> objectIDTypes = repository.getObjectIDTypes(); int types = objectIDTypes.size(); - out.writeInt(types); + out.writeXInt(types); for (CDOID.ObjectType objectIDType : objectIDTypes) { out.writeEnum(objectIDType); } - out.writeLong(repository.getCreationTime()); - out.writeLong(session.getFirstUpdateTime()); + out.writeXLong(repository.getCreationTime()); + out.writeXLong(session.getFirstUpdateTime()); out.writeCDOID(repository.getRootResourceID()); out.writeBoolean(repository.isAuthenticating()); out.writeBoolean(repository.isSupportingAudits()); diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/OpenViewIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/OpenViewIndication.java index f689bd565d..c3a5204da8 100644 --- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/OpenViewIndication.java +++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/OpenViewIndication.java @@ -40,7 +40,7 @@ public class OpenViewIndication extends CDOServerReadIndication { InternalSession session = getSession(); - int viewID = in.readInt(); + int viewID = in.readXInt(); boolean readOnly = in.readBoolean(); if (in.readBoolean()) diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/QueryCancelIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/QueryCancelIndication.java index f967f8ac2e..c4be210a88 100644 --- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/QueryCancelIndication.java +++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/QueryCancelIndication.java @@ -37,7 +37,7 @@ public class QueryCancelIndication extends CDOServerReadIndication @Override protected void indicating(CDODataInput in) throws IOException { - queryID = in.readInt(); + queryID = in.readXInt(); if (TRACER.isEnabled()) { TRACER.trace("Query " + queryID + " will be cancelled"); //$NON-NLS-1$ //$NON-NLS-2$ diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/QueryIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/QueryIndication.java index eb703372a1..b54ddd7035 100644 --- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/QueryIndication.java +++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/QueryIndication.java @@ -47,7 +47,7 @@ public class QueryIndication extends CDOServerReadIndication @Override protected void indicating(CDODataInput in) throws IOException { - int viewID = in.readInt(); + int viewID = in.readXInt(); InternalView view = getView(viewID); CDOQueryInfo queryInfo = new CDOQueryInfoImpl(in); @@ -64,7 +64,7 @@ public class QueryIndication extends CDOServerReadIndication protected void responding(CDODataOutput out) throws IOException { // Return queryID immediately. - out.writeInt(queryResult.getQueryID()); + out.writeXInt(queryResult.getQueryID()); flushUnlessDisabled(); int numberOfResults = 0; diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/QueryLobsIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/QueryLobsIndication.java index 4eb5929220..fce022e2b0 100644 --- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/QueryLobsIndication.java +++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/QueryLobsIndication.java @@ -33,7 +33,7 @@ public class QueryLobsIndication extends CDOServerReadIndication @Override protected void indicating(CDODataInput in) throws IOException { - int size = in.readInt(); + int size = in.readXInt(); for (int i = 0; i < size; i++) { ids.add(in.readByteArray()); @@ -44,7 +44,7 @@ public class QueryLobsIndication extends CDOServerReadIndication protected void responding(CDODataOutput out) throws IOException { getRepository().queryLobs(ids); - out.writeInt(ids.size()); + out.writeXInt(ids.size()); for (byte[] id : ids) { out.writeByteArray(id); diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/RefreshSessionIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/RefreshSessionIndication.java index 63611d6eac..51bfda8656 100644 --- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/RefreshSessionIndication.java +++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/RefreshSessionIndication.java @@ -64,17 +64,17 @@ public class RefreshSessionIndication extends CDOServerReadIndication @Override protected void indicating(CDODataInput in) throws IOException { - lastUpdateTime = in.readLong(); - initialChunkSize = in.readInt(); + lastUpdateTime = in.readXLong(); + initialChunkSize = in.readXInt(); enablePassiveUpdates = in.readBoolean(); - int branches = in.readInt(); + int branches = in.readXInt(); for (int i = 0; i < branches; i++) { CDOBranch branch = in.readCDOBranch(); List<CDORevisionKey> revisions = new ArrayList<CDORevisionKey>(); viewedRevisions.put(branch, revisions); - int size = in.readInt(); + int size = in.readXInt(); for (int j = 0; j < size; j++) { CDORevisionKey revision = in.readCDORevisionKey(); @@ -87,7 +87,7 @@ public class RefreshSessionIndication extends CDOServerReadIndication protected void responding(CDODataOutput out) throws IOException { long lastCommitTimeStamp = getRepository().getLastCommitTimeStamp(); - out.writeLong(lastCommitTimeStamp); + out.writeXLong(lastCommitTimeStamp); writePackageUnits(out, lastCommitTimeStamp); writeRevisions(out); diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/RemoteMessageIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/RemoteMessageIndication.java index 5907771ee6..8e81a23fb4 100644 --- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/RemoteMessageIndication.java +++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/RemoteMessageIndication.java @@ -45,7 +45,7 @@ public class RemoteMessageIndication extends CDOServerReadIndication TRACER.trace("Read message: " + message); //$NON-NLS-1$ } - int count = in.readInt(); + int count = in.readXInt(); if (TRACER.isEnabled()) { TRACER.format("Reading {0} recipients", count); //$NON-NLS-1$ @@ -54,7 +54,7 @@ public class RemoteMessageIndication extends CDOServerReadIndication int[] recipients = new int[count]; for (int i = 0; i < recipients.length; i++) { - recipients[i] = in.readInt(); + recipients[i] = in.readXInt(); } InternalSessionManager sessionManager = getRepository().getSessionManager(); @@ -64,10 +64,10 @@ public class RemoteMessageIndication extends CDOServerReadIndication @Override protected void responding(CDODataOutput out) throws IOException { - out.writeInt(result.size()); + out.writeXInt(result.size()); for (Integer recipient : result) { - out.writeInt(recipient); + out.writeXInt(recipient); } } } diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/RemoteMessageNotificationRequest.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/RemoteMessageNotificationRequest.java index b04bb0dcc3..2a29c7ce16 100644 --- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/RemoteMessageNotificationRequest.java +++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/RemoteMessageNotificationRequest.java @@ -48,7 +48,7 @@ public class RemoteMessageNotificationRequest extends CDOServerRequest TRACER.trace("Writing senderID: " + senderID); //$NON-NLS-1$ } - out.writeInt(senderID); + out.writeXInt(senderID); if (TRACER.isEnabled()) { TRACER.trace("Writing message: " + message); //$NON-NLS-1$ diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/RemoteSessionNotificationRequest.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/RemoteSessionNotificationRequest.java index 86e5e457ce..6047cf4951 100644 --- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/RemoteSessionNotificationRequest.java +++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/RemoteSessionNotificationRequest.java @@ -37,7 +37,7 @@ public class RemoteSessionNotificationRequest extends CDOServerRequest @Override protected void requesting(CDODataOutput out) throws IOException { - out.writeInt(sender.getSessionID()); + out.writeXInt(sender.getSessionID()); out.writeByte(opcode); if (opcode == CDOProtocolConstants.REMOTE_SESSION_OPENED) { diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/RenameBranchIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/RenameBranchIndication.java index e114efe078..1b98313ffe 100644 --- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/RenameBranchIndication.java +++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/RenameBranchIndication.java @@ -42,7 +42,7 @@ public class RenameBranchIndication extends CDOServerWriteIndication @Override protected void indicating(CDODataInput in) throws IOException { - branchID = in.readInt(); + branchID = in.readXInt(); oldName = in.readString(); newName = in.readString(); } diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/ReplicateRepositoryIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/ReplicateRepositoryIndication.java index a6d8f2333a..bf694bc6e3 100644 --- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/ReplicateRepositoryIndication.java +++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/ReplicateRepositoryIndication.java @@ -43,9 +43,9 @@ public class ReplicateRepositoryIndication extends CDOServerReadIndication @Override protected void indicating(CDODataInput in) throws IOException { - lastReplicatedBranchID = in.readInt(); - lastReplicatedCommitTime = in.readLong(); - lockAreaIDs = new String[in.readInt()]; + lastReplicatedBranchID = in.readXInt(); + lastReplicatedCommitTime = in.readXLong(); + lockAreaIDs = new String[in.readXInt()]; for (int i = 0; i < lockAreaIDs.length; i++) { lockAreaIDs[i] = in.readString(); diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/ReplicateRepositoryRawIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/ReplicateRepositoryRawIndication.java index 144200c53b..9016c7553b 100644 --- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/ReplicateRepositoryRawIndication.java +++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/ReplicateRepositoryRawIndication.java @@ -47,8 +47,8 @@ public class ReplicateRepositoryRawIndication extends CDOServerReadIndicationWit { monitor.begin(); - lastReplicatedBranchID = in.readInt(); - lastReplicatedCommitTime = in.readLong(); + lastReplicatedBranchID = in.readXInt(); + lastReplicatedCommitTime = in.readXLong(); } finally { diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/RepositoryTimeIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/RepositoryTimeIndication.java index dc558df359..c36f6c2c7b 100644 --- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/RepositoryTimeIndication.java +++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/RepositoryTimeIndication.java @@ -54,12 +54,12 @@ public class RepositoryTimeIndication extends CDOServerIndication TRACER.format("Writing indicated: {0}", CDOCommonUtil.formatTimeStamp(indicated)); //$NON-NLS-1$ } - out.writeLong(indicated); + out.writeXLong(indicated); if (TRACER.isEnabled()) { TRACER.format("Writing responded: {0}", CDOCommonUtil.formatTimeStamp(responded)); //$NON-NLS-1$ } - out.writeLong(responded); + out.writeXLong(responded); } } diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/ResetTransactionIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/ResetTransactionIndication.java index c9a7fc133a..7c0db88733 100644 --- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/ResetTransactionIndication.java +++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/ResetTransactionIndication.java @@ -40,13 +40,13 @@ public class ResetTransactionIndication extends CDOServerReadIndication @Override protected void indicating(CDODataInput in) throws IOException { - transactionID = in.readInt(); + transactionID = in.readXInt(); if (TRACER.isEnabled()) { TRACER.format("Read transactionID: {0}", transactionID); //$NON-NLS-1$ } - commitNumber = in.readInt(); + commitNumber = in.readXInt(); if (TRACER.isEnabled()) { TRACER.format("Read commitNumber: {0}", commitNumber); //$NON-NLS-1$ @@ -61,8 +61,8 @@ public class ResetTransactionIndication extends CDOServerReadIndication if (lastCommitSuccess != null && lastCommitSuccess.getCommitNumber() == commitNumber) { out.writeBoolean(true); - out.writeLong(lastCommitSuccess.getTimeStamp()); - out.writeLong(lastCommitSuccess.getPreviousTimeStamp()); + out.writeXLong(lastCommitSuccess.getTimeStamp()); + out.writeXLong(lastCommitSuccess.getPreviousTimeStamp()); } else { diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/SwitchTargetIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/SwitchTargetIndication.java index 9d359154a7..6396ff4ec2 100644 --- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/SwitchTargetIndication.java +++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/SwitchTargetIndication.java @@ -55,10 +55,10 @@ public class SwitchTargetIndication extends CDOServerReadIndicationWithMonitorin try { - int viewID = in.readInt(); + int viewID = in.readXInt(); CDOBranchPoint branchPoint = in.readCDOBranchPoint(); - int size = in.readInt(); + int size = in.readXInt(); List<CDOID> invalidObjects = new ArrayList<CDOID>(size); for (int i = 0; i < size; i++) { @@ -84,13 +84,13 @@ public class SwitchTargetIndication extends CDOServerReadIndicationWithMonitorin @Override protected void responding(CDODataOutput out, OMMonitor monitor) throws IOException { - out.writeInt(allChangedObjects.size()); + out.writeXInt(allChangedObjects.size()); for (CDORevisionDelta delta : allChangedObjects) { out.writeCDORevisionDelta(delta); } - out.writeInt(allDetachedObjects.size()); + out.writeXInt(allDetachedObjects.size()); for (CDOID id : allDetachedObjects) { out.writeCDOID(id); diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/UnitIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/UnitIndication.java index 9e09aef776..fb614d66c6 100644 --- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/UnitIndication.java +++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/UnitIndication.java @@ -53,7 +53,7 @@ public class UnitIndication extends CDOServerReadIndicationWithMonitoring @Override protected void indicating(CDODataInput in, OMMonitor monitor) throws Exception { - viewID = in.readInt(); + viewID = in.readXInt(); rootID = in.readCDOID(); opcode = UnitOpcode.values()[in.readByte()]; } diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/UnlockObjectsIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/UnlockObjectsIndication.java index 14e295c0cd..0931bd25bc 100644 --- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/UnlockObjectsIndication.java +++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/UnlockObjectsIndication.java @@ -48,10 +48,10 @@ public class UnlockObjectsIndication extends CDOServerWriteIndication @Override protected void indicating(CDODataInput in) throws IOException { - int viewID = in.readInt(); + int viewID = in.readXInt(); LockType lockType = in.readCDOLockType(); boolean recursive = in.readBoolean(); - int size = in.readInt(); + int size = in.readXInt(); InternalRepository repository = getRepository(); IView view = getView(viewID); @@ -75,9 +75,9 @@ public class UnlockObjectsIndication extends CDOServerWriteIndication @Override protected void responding(CDODataOutput out) throws IOException { - out.writeLong(result.getTimestamp()); + out.writeXLong(result.getTimestamp()); CDOLockState[] newLockStates = result.getNewLockStates(); - out.writeInt(newLockStates.length); + out.writeXInt(newLockStates.length); for (CDOLockState state : newLockStates) { out.writeCDOLockState(state); 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 35cd1dab7f..425e265b72 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 @@ -1508,8 +1508,8 @@ public class Repository extends Container<Object> implements InternalRepository, final long fromCommitTime = lastReplicatedCommitTime + 1L; final long toCommitTime = store.getLastCommitTime(); - out.writeInt(toBranchID); - out.writeLong(toCommitTime); + out.writeXInt(toBranchID); + out.writeXLong(toCommitTime); IStoreAccessor.Raw accessor = (IStoreAccessor.Raw)StoreThreadLocal.getAccessor(); accessor.rawExport(out, fromBranchID, toBranchID, fromCommitTime, toCommitTime); diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/SynchronizableRepository.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/SynchronizableRepository.java index fd11415bce..8057dfdc5e 100644 --- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/SynchronizableRepository.java +++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/SynchronizableRepository.java @@ -424,9 +424,9 @@ public abstract class SynchronizableRepository extends Repository.Default implem long previousCommitTime = getLastCommitTimeStamp(); int fromBranchID = lastReplicatedBranchID + 1; - int toBranchID = in.readInt(); + int toBranchID = in.readXInt(); long fromCommitTime = lastReplicatedCommitTime + 1L; - long toCommitTime = in.readLong(); + long toCommitTime = in.readXLong(); StoreThreadLocal.setSession(replicatorSession); IStoreAccessor.Raw accessor = (IStoreAccessor.Raw)StoreThreadLocal.getAccessor(); diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreAccessor.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreAccessor.java index b21141d0e6..3363f19bc5 100644 --- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreAccessor.java +++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreAccessor.java @@ -404,7 +404,7 @@ public interface IStoreAccessor extends IQueryHandlerProvider, BranchLoader, Com * <ol> * <li> {@link ExtendedDataInputStream#readByteArray() int + byte[]}: the id of the lob (prepended by the size of the * id). - * <li> {@link ExtendedDataInputStream#readLong() long}: the size of the lob. The foollowing interpretation applies: + * <li> {@link ExtendedDataInputStream#readLong() long}: the size of the lob. The following interpretation applies: * <ul> * <li>A positive size indicates a {@link CDOBlob blob} and means the number of bytes that can be * {@link IOUtil#copyBinary(java.io.InputStream, java.io.OutputStream) read}. diff --git a/plugins/org.eclipse.emf.cdo.tests/launches/CDO AllTests (MEM branching TCP).launch b/plugins/org.eclipse.emf.cdo.tests/launches/CDO AllTests (MEM branching TCP).launch index 99183f6eaf..3bfc317e84 100644 --- a/plugins/org.eclipse.emf.cdo.tests/launches/CDO AllTests (MEM branching TCP).launch +++ b/plugins/org.eclipse.emf.cdo.tests/launches/CDO AllTests (MEM branching TCP).launch @@ -18,5 +18,5 @@ <stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit3"/> <stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.emf.cdo.tests.AllTestsMEMBranchesTCP"/> <stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.emf.cdo.tests"/> -<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dorg.eclipse.net4j.tcp.ssl.trust=sslKey/testTrust -Dorg.eclipse.net4j.tcp.ssl.key=sslKey/testKeys"/> +<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dorg.eclipse.net4j.tcp.ssl.trust=sslKey/testTrust -Dorg.eclipse.net4j.tcp.ssl.key=sslKey/testKeys -Dorg.eclipse.emf.cdo.common.protocol.X_COMPRESSION=true"/> </launchConfiguration> diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOTransactionImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOTransactionImpl.java index 01992801c8..c554fccfb4 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOTransactionImpl.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOTransactionImpl.java @@ -151,6 +151,7 @@ import org.eclipse.net4j.util.event.IEvent; import org.eclipse.net4j.util.event.IListener; import org.eclipse.net4j.util.io.ExtendedDataInputStream; import org.eclipse.net4j.util.io.ExtendedDataOutputStream; +import org.eclipse.net4j.util.om.OMPlatform; import org.eclipse.net4j.util.om.monitor.MonitorCanceledException; import org.eclipse.net4j.util.om.trace.ContextTracer; import org.eclipse.net4j.util.options.OptionsEvent; @@ -212,6 +213,8 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa { private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG_TRANSACTION, CDOTransactionImpl.class); + private static final boolean X_COMPRESSION = OMPlatform.INSTANCE.isProperty("org.eclipse.emf.cdo.transaction.X_COMPRESSION"); + private Object transactionHandlersLock = new Object(); private ConcurrentArray<CDOTransactionHandler1> transactionHandlers1 = new ConcurrentArray<CDOTransactionHandler1>() @@ -2618,6 +2621,12 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa { return getSession(); } + + @Override + protected boolean isXCompression() + { + return X_COMPRESSION; + } }; List<CDOSavepoint> savepoints = new ArrayList<CDOSavepoint>(); @@ -2632,7 +2641,7 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa savepoint = savepoint.getNextSavepoint(); } - out.writeInt(totalNewObjects); + out.writeXInt(totalNewObjects); savepoint = firstSavepoint; while (savepoint != null) @@ -2648,13 +2657,13 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa savepoints.add(savepoint); out.writeBoolean(true); - out.writeInt(newObjects.size()); + out.writeXInt(newObjects.size()); for (CDOObject newObject : newObjects) { out.writeCDORevision(newObject.cdoRevision(), CDORevision.UNCHUNKED); } - out.writeInt(revisionDeltas.size()); + out.writeXInt(revisionDeltas.size()); for (CDORevisionDelta revisionDelta : revisionDeltas) { out.writeCDORevisionDelta(revisionDelta); @@ -2720,10 +2729,16 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa { return CDOListWithElementProxiesImpl.FACTORY; } + + @Override + protected boolean isXCompression() + { + return X_COMPRESSION; + } }; // Increase the internal tempID counter to prevent ID collisions during mapping - int totalNewObjects = in.readInt(); + int totalNewObjects = in.readXInt(); for (int i = 0; i < totalNewObjects; i++) { createIDForNewObject(null); @@ -2808,7 +2823,7 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa private void importNewRevisions(CDODataInput in, List<InternalCDORevision> revisions, Map<CDOID, CDOID> idMappings) throws IOException { - int size = in.readInt(); + int size = in.readXInt(); for (int i = 0; i < size; i++) { InternalCDORevision revision = (InternalCDORevision)in.readCDORevision(false); @@ -2827,7 +2842,7 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa private List<InternalCDORevisionDelta> importRevisionDeltas(CDODataInput in) throws IOException { - int size = in.readInt(); + int size = in.readXInt(); List<InternalCDORevisionDelta> deltas = new ArrayList<InternalCDORevisionDelta>(size); for (int i = 0; i < size; i++) { diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/CDOSessionProtocol.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/CDOSessionProtocol.java index e6359bc297..a6052a3b8e 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/CDOSessionProtocol.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/CDOSessionProtocol.java @@ -419,15 +419,15 @@ public interface CDOSessionProtocol extends CDOProtocol, PackageLoader, BranchLo state = in.readEnum(CDOCommonRepository.State.class); storeType = in.readString(); - int types = in.readInt(); + int types = in.readXInt(); for (int i = 0; i < types; i++) { CDOID.ObjectType objectIDType = in.readEnum(CDOID.ObjectType.class); objectIDTypes.add(objectIDType); } - repositoryCreationTime = in.readLong(); - lastUpdateTime = in.readLong(); + repositoryCreationTime = in.readXLong(); + lastUpdateTime = in.readXLong(); rootResourceID = in.readCDOID(); authenticating = in.readBoolean(); supportingAudits = in.readBoolean(); diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/DataInputExtender.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/DataInputExtender.java index 75f1c6771b..9ef625dbfc 100644 --- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/DataInputExtender.java +++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/DataInputExtender.java @@ -98,6 +98,16 @@ public class DataInputExtender implements ExtendedDataInput, Closeable return input.readUTF(); } + public int readVarInt() throws IOException + { + return ExtendedIOUtil.readVarInt(input); + } + + public long readVarLong() throws IOException + { + return ExtendedIOUtil.readVarLong(input); + } + public byte[] readByteArray() throws IOException { return ExtendedIOUtil.readByteArray(input); diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/DataOutputExtender.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/DataOutputExtender.java index c3ced4360a..20bfa49c5f 100644 --- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/DataOutputExtender.java +++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/DataOutputExtender.java @@ -96,6 +96,16 @@ public class DataOutputExtender implements ExtendedDataOutput, Closeable output.writeUTF(str); } + public void writeVarInt(int v) throws IOException + { + ExtendedIOUtil.writeVarInt(output, v); + } + + public void writeVarLong(long v) throws IOException + { + ExtendedIOUtil.writeVarLong(output, v); + } + public void writeByteArray(byte[] b) throws IOException { ExtendedIOUtil.writeByteArray(output, b); diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/ExtendedDataInput.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/ExtendedDataInput.java index 6dbff53935..ef2f3f8922 100644 --- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/ExtendedDataInput.java +++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/ExtendedDataInput.java @@ -25,6 +25,16 @@ import java.io.InputStream; */ public interface ExtendedDataInput extends DataInput { + /** + * @since 3.7 + */ + public int readVarInt() throws IOException; + + /** + * @since 3.7 + */ + public long readVarLong() throws IOException; + public byte[] readByteArray() throws IOException; public Object readObject() throws IOException; @@ -174,6 +184,16 @@ public interface ExtendedDataInput extends DataInput return delegate.readUTF(); } + public int readVarInt() throws IOException + { + return delegate.readVarInt(); + } + + public long readVarLong() throws IOException + { + return delegate.readVarLong(); + } + public int skipBytes(int n) throws IOException { return delegate.skipBytes(n); diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/ExtendedDataInputStream.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/ExtendedDataInputStream.java index de26cee06c..73f86c52f2 100644 --- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/ExtendedDataInputStream.java +++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/ExtendedDataInputStream.java @@ -26,6 +26,16 @@ public class ExtendedDataInputStream extends DataInputStream implements Extended super(in); } + public int readVarInt() throws IOException + { + return ExtendedIOUtil.readVarInt(this); + } + + public long readVarLong() throws IOException + { + return ExtendedIOUtil.readVarLong(this); + } + public byte[] readByteArray() throws IOException { return ExtendedIOUtil.readByteArray(this); diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/ExtendedDataOutput.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/ExtendedDataOutput.java index 7373c8d464..2ccf9074ca 100644 --- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/ExtendedDataOutput.java +++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/ExtendedDataOutput.java @@ -22,6 +22,16 @@ import java.io.OutputStream; */ public interface ExtendedDataOutput extends DataOutput { + /** + * @since 3.7 + */ + public void writeVarInt(int v) throws IOException; + + /** + * @since 3.7 + */ + public void writeVarLong(long v) throws IOException; + public void writeByteArray(byte[] b) throws IOException; public void writeObject(Object object) throws IOException; @@ -157,6 +167,16 @@ public interface ExtendedDataOutput extends DataOutput delegate.writeUTF(str); } + public void writeVarInt(int v) throws IOException + { + delegate.writeVarInt(v); + } + + public void writeVarLong(long v) throws IOException + { + delegate.writeVarLong(v); + } + /** * @since 3.6 */ diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/ExtendedDataOutputStream.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/ExtendedDataOutputStream.java index 00f389aa6e..cf3b49d041 100644 --- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/ExtendedDataOutputStream.java +++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/ExtendedDataOutputStream.java @@ -24,6 +24,16 @@ public class ExtendedDataOutputStream extends DataOutputStream implements Extend super(out); } + public void writeVarInt(int v) throws IOException + { + ExtendedIOUtil.writeVarInt(this, v); + } + + public void writeVarLong(long v) throws IOException + { + ExtendedIOUtil.writeVarLong(this, v); + } + public void writeByteArray(byte[] b) throws IOException { ExtendedIOUtil.writeByteArray(this, b); diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/ExtendedIOUtil.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/ExtendedIOUtil.java index f92ee469a3..a0a4847b53 100644 --- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/ExtendedIOUtil.java +++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/ExtendedIOUtil.java @@ -56,10 +56,100 @@ public final class ExtendedIOUtil private static final int CHARACTER_BUFFER_SIZE = 4096; + private static final byte[] EMPTY_BYTE_ARRAY = {}; + private ExtendedIOUtil() { } + /** + * @since 3.7 + */ + public static void writeVarInt(DataOutput out, int v) throws IOException + { + while ((v & ~0x7f) != 0) + { + out.writeByte((byte)(0x80 | v & 0x7f)); + v >>>= 7; + } + + out.writeByte((byte)v); + } + + /** + * @since 3.7 + */ + public static int readVarInt(DataInput in) throws IOException + { + int b = in.readByte(); + if (b >= 0) + { + return b; + } + + int v = b & 0x7f; + b = in.readByte(); + if (b >= 0) + { + return v | b << 7; + } + + v |= (b & 0x7f) << 7; + b = in.readByte(); + if (b >= 0) + { + return v | b << 14; + } + + v |= (b & 0x7f) << 14; + b = in.readByte(); + if (b >= 0) + { + return v | b << 21; + } + + v |= (b & 0x7f) << 21; + b = in.readByte(); + return v | b << 28; + } + + /** + * @since 3.7 + */ + public static void writeVarLong(DataOutput out, long v) throws IOException + { + while ((v & ~0x7f) != 0) + { + out.writeByte((byte)(v & 0x7f | 0x80)); + v >>>= 7; + } + + out.writeByte((byte)v); + } + + /** + * @since 3.7 + */ + public static long readVarLong(DataInput in) throws IOException + { + long v = in.readByte(); + if (v >= 0) + { + return v; + } + + v &= 0x7f; + for (int s = 7;; s += 7) + { + long b = in.readByte(); + v |= (b & 0x7f) << s; + if (b >= 0) + { + return v; + } + } + } + public static void writeByteArray(DataOutput out, byte[] b) throws IOException { if (b != null) @@ -81,6 +171,11 @@ public final class ExtendedIOUtil return null; } + if (length == 0) + { + return EMPTY_BYTE_ARRAY; + } + byte[] b; try { |