summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-09-10 05:46:12 (EDT)
committerEike Stepper2007-09-10 05:46:12 (EDT)
commitbcf4877d65661917e4f14876ba0fe4fa5153c213 (patch)
treeb2e56f16d149bfa7b9c2b8bfa70d410623e9cd65
parentbdf93c76a6b31f12f8101b926f9498b3bae6d984 (diff)
downloadcdo-bcf4877d65661917e4f14876ba0fe4fa5153c213.zip
cdo-bcf4877d65661917e4f14876ba0fe4fa5153c213.tar.gz
cdo-bcf4877d65661917e4f14876ba0fe4fa5153c213.tar.bz2
[202768] Optimize CDOIDTyped
https://bugs.eclipse.org/bugs/show_bug.cgi?id=202768
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Repository.java15
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Session.java16
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/config/cdo.server.xml1
3 files changed, 26 insertions, 6 deletions
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 195f3e8..ec7da52 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
@@ -38,6 +38,8 @@ public class Repository extends Container<IRepositoryElement> implements IReposi
public static final String PROP_VERIFYING_REVISIONS = "verifyingRevisions";
+ public static final String PROP_REMEMBERING_KNOWN_TYPES = "rememberingKnownTypes";
+
private static final long INITIAL_OID_VALUE = 2;
private static final long INITIAL_META_ID_VALUE = 1;
@@ -54,6 +56,8 @@ public class Repository extends Container<IRepositoryElement> implements IReposi
private Boolean verifyingRevisions;
+ private Boolean rememberingKnownTypes;
+
private TypeManager typeManager = createTypeManager();
private PackageManager packageManager = createPackageManager();
@@ -142,6 +146,17 @@ public class Repository extends Container<IRepositoryElement> implements IReposi
return verifyingRevisions;
}
+ public boolean isRememberingKnownTypes()
+ {
+ if (rememberingKnownTypes == null)
+ {
+ String value = getProperties().get(PROP_REMEMBERING_KNOWN_TYPES);
+ rememberingKnownTypes = value == null ? false : Boolean.valueOf(value);
+ }
+
+ return rememberingKnownTypes;
+ }
+
public TypeManager getTypeManager()
{
return typeManager;
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Session.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Session.java
index d15c899..5024f49 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Session.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Session.java
@@ -52,7 +52,7 @@ public class Session extends Container<IView> implements ISession, CDOIDProvider
private ConcurrentMap<Integer, View> views = new ConcurrentHashMap<Integer, View>();
- private Set<CDOID> knownObjects = new HashSet<CDOID>();
+ private Set<CDOID> knownTypes = new HashSet<CDOID>();
private IListener protocolListener = new LifecycleEventAdapter()
{
@@ -171,14 +171,18 @@ public class Session extends Container<IView> implements ISession, CDOIDProvider
return id;
}
- if (knownObjects.contains(id))
+ Repository repository = sessionManager.getRepository();
+ if (repository.isRememberingKnownTypes())
{
- // TODO On client-side add a check if the id is really known!
- return id;
+ if (knownTypes.contains(id))
+ {
+ // TODO On client-side add a check if the id is really known!
+ return id;
+ }
+
+ knownTypes.add(id);
}
- knownObjects.add(id);
- Repository repository = sessionManager.getRepository();
CDOClassRef type = repository.getTypeManager().getObjectType(StoreUtil.getReader(), id);
return CDOIDImpl.create(id.getValue(), type);
}
diff --git a/plugins/org.eclipse.emf.cdo.ui/config/cdo.server.xml b/plugins/org.eclipse.emf.cdo.ui/config/cdo.server.xml
index affa217..3f21313 100644
--- a/plugins/org.eclipse.emf.cdo.ui/config/cdo.server.xml
+++ b/plugins/org.eclipse.emf.cdo.ui/config/cdo.server.xml
@@ -5,6 +5,7 @@
<property name="overrideUUID" value="1ff5d226-b1f0-40fb-aba2-0c31b38c764f"/>
<property name="supportingAudits" value="true"/>
<property name="verifyingRevisions" value="false"/>
+ <property name="rememberingKnownTypes" value="false"/>
<store type="db">
<!-- mode: OFF | EXPRESS | NORMAL | GUARANTEED -->