summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2008-01-06 13:03:48 (EST)
committerEike Stepper2008-01-06 13:03:48 (EST)
commitcccfcaf5b8ce5a6b8b5d8853c93e46bc6fbe8d75 (patch)
tree8c3abf8248f073762e8c3dcd31d2a48fe8edfe0a
parentebfc8a9bfaa583af31f657e3987140211f36d40e (diff)
downloadcdo-cccfcaf5b8ce5a6b8b5d8853c93e46bc6fbe8d75.zip
cdo-cccfcaf5b8ce5a6b8b5d8853c93e46bc6fbe8d75.tar.gz
cdo-cccfcaf5b8ce5a6b8b5d8853c93e46bc6fbe8d75.tar.bz2
[214437] Provide efficient type lookup service in storage framework
https://bugs.eclipse.org/bugs/show_bug.cgi?id=214437
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IClassMapping.java6
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IDBStoreAccessor.java8
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IDBStoreChunkReader.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IDBStoreReader.java22
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IDBStoreWriter.java20
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IMappingStrategy.java8
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IObjectTypeCache.java22
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IObjectTypeLookup.java22
8 files changed, 96 insertions, 14 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IClassMapping.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IClassMapping.java
index b316957..fc706c4 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IClassMapping.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IClassMapping.java
@@ -42,11 +42,11 @@ public interface IClassMapping
public void writeRevision(IDBStoreAccessor storeAccessor, CDORevisionImpl revision);
- public void readRevision(IDBStoreAccessor storeAccessor, CDORevisionImpl revision, int referenceChunk);
+ public void readRevision(IDBStoreReader storeReader, CDORevisionImpl revision, int referenceChunk);
- public void readRevisionByTime(IDBStoreAccessor storeAccessor, CDORevisionImpl revision, long timeStamp,
+ public void readRevisionByTime(IDBStoreReader storeReader, CDORevisionImpl revision, long timeStamp,
int referenceChunk);
- public void readRevisionByVersion(IDBStoreAccessor storeAccessor, CDORevisionImpl revision, int version,
+ public void readRevisionByVersion(IDBStoreReader storeReader, CDORevisionImpl revision, int version,
int referenceChunk);
}
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IDBStoreAccessor.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IDBStoreAccessor.java
index 129e09c..eb9f802 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IDBStoreAccessor.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IDBStoreAccessor.java
@@ -10,9 +10,7 @@
**************************************************************************/
package org.eclipse.emf.cdo.server.db;
-import org.eclipse.emf.cdo.protocol.model.CDOClassRef;
-import org.eclipse.emf.cdo.server.IStoreReader;
-import org.eclipse.emf.cdo.server.IStoreWriter;
+import org.eclipse.emf.cdo.server.IStoreAccessor;
import java.sql.Connection;
import java.sql.Statement;
@@ -20,13 +18,11 @@ import java.sql.Statement;
/**
* @author Eike Stepper
*/
-public interface IDBStoreAccessor extends IStoreReader, IStoreWriter
+public interface IDBStoreAccessor extends IStoreAccessor
{
public IDBStore getStore();
public Connection getConnection();
public Statement getStatement();
-
- public CDOClassRef readClassRef(int classID);
}
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IDBStoreChunkReader.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IDBStoreChunkReader.java
index 353fba3..fc2699c 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IDBStoreChunkReader.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IDBStoreChunkReader.java
@@ -17,5 +17,5 @@ import org.eclipse.emf.cdo.server.IStoreChunkReader;
*/
public interface IDBStoreChunkReader extends IStoreChunkReader
{
- public IDBStoreAccessor getStoreAccessor();
+ public IDBStoreReader getStoreReader();
}
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IDBStoreReader.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IDBStoreReader.java
new file mode 100644
index 0000000..baedfa3
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IDBStoreReader.java
@@ -0,0 +1,22 @@
+/***************************************************************************
+ * Copyright (c) 2004 - 2008 Eike Stepper, Germany.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ **************************************************************************/
+package org.eclipse.emf.cdo.server.db;
+
+import org.eclipse.emf.cdo.protocol.model.CDOClassRef;
+import org.eclipse.emf.cdo.server.IStoreReader;
+
+/**
+ * @author Eike Stepper
+ */
+public interface IDBStoreReader extends IDBStoreAccessor, IStoreReader
+{
+ public CDOClassRef readClassRef(int classID);
+}
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IDBStoreWriter.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IDBStoreWriter.java
new file mode 100644
index 0000000..c201385
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IDBStoreWriter.java
@@ -0,0 +1,20 @@
+/***************************************************************************
+ * Copyright (c) 2004 - 2008 Eike Stepper, Germany.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ **************************************************************************/
+package org.eclipse.emf.cdo.server.db;
+
+import org.eclipse.emf.cdo.server.IStoreWriter;
+
+/**
+ * @author Eike Stepper
+ */
+public interface IDBStoreWriter extends IDBStoreReader, IStoreWriter
+{
+}
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IMappingStrategy.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IMappingStrategy.java
index b239890..ef17859 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IMappingStrategy.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IMappingStrategy.java
@@ -36,13 +36,13 @@ public interface IMappingStrategy
public IClassMapping getClassMapping(CDOClass cdoClass);
- public CloseableIterator<CDOID> readObjectIDs(IDBStoreAccessor storeAccessor, boolean withTypes);
+ public CloseableIterator<CDOID> readObjectIDs(IDBStoreReader storeReader, boolean withTypes);
- public CDOClassRef readObjectType(IDBStoreAccessor storeAccessor, CDOID id);
+ public CDOClassRef readObjectType(IDBStoreReader storeReader, CDOID id);
- public CDOID readResourceID(IDBStoreAccessor storeAccessor, String path);
+ public CDOID readResourceID(IDBStoreReader storeReader, String path);
- public String readResourcePath(IDBStoreAccessor storeAccessor, CDOID id);
+ public String readResourcePath(IDBStoreReader storeReader, CDOID id);
/**
* Must return the next CDOID value to be used for new objects.
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IObjectTypeCache.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IObjectTypeCache.java
new file mode 100644
index 0000000..c28ede8
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IObjectTypeCache.java
@@ -0,0 +1,22 @@
+/***************************************************************************
+ * Copyright (c) 2004 - 2008 Eike Stepper, Germany.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ **************************************************************************/
+package org.eclipse.emf.cdo.server.db;
+
+import org.eclipse.emf.cdo.protocol.CDOID;
+import org.eclipse.emf.cdo.protocol.model.CDOClassRef;
+
+/**
+ * @author Eike Stepper
+ */
+public interface IObjectTypeCache extends IObjectTypeLookup
+{
+ public void putObjectType(CDOID id, CDOClassRef type);
+}
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IObjectTypeLookup.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IObjectTypeLookup.java
new file mode 100644
index 0000000..dc2ae7d
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IObjectTypeLookup.java
@@ -0,0 +1,22 @@
+/***************************************************************************
+ * Copyright (c) 2004 - 2008 Eike Stepper, Germany.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ **************************************************************************/
+package org.eclipse.emf.cdo.server.db;
+
+import org.eclipse.emf.cdo.protocol.CDOID;
+import org.eclipse.emf.cdo.protocol.model.CDOClassRef;
+
+/**
+ * @author Eike Stepper
+ */
+public interface IObjectTypeLookup
+{
+ public CDOClassRef getObjectType(CDOID id);
+}