Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2011-02-21 06:13:21 +0000
committerEike Stepper2011-02-21 06:13:21 +0000
commiteb5578fa8bc73066e094b2513fb2e4b905a97c56 (patch)
treebbd256101c406e37856ed5db6218abffe038a1b5 /plugins/org.eclipse.emf.cdo.server.mongodb
parent0d6933ed943641d4e30ffd0d23252e88123b5626 (diff)
downloadcdo-eb5578fa8bc73066e094b2513fb2e4b905a97c56.tar.gz
cdo-eb5578fa8bc73066e094b2513fb2e4b905a97c56.tar.xz
cdo-eb5578fa8bc73066e094b2513fb2e4b905a97c56.zip
[337152] [Mongo] Create a MongoDBStore
https://bugs.eclipse.org/bugs/show_bug.cgi?id=337152
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.server.mongodb')
-rw-r--r--plugins/org.eclipse.emf.cdo.server.mongodb/src/org/eclipse/emf/cdo/server/internal/mongodb/Commits.java20
-rw-r--r--plugins/org.eclipse.emf.cdo.server.mongodb/src/org/eclipse/emf/cdo/server/internal/mongodb/MongoDBBrowserPage.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.server.mongodb/src/org/eclipse/emf/cdo/server/internal/mongodb/MongoDBStore.java2
3 files changed, 12 insertions, 14 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server.mongodb/src/org/eclipse/emf/cdo/server/internal/mongodb/Commits.java b/plugins/org.eclipse.emf.cdo.server.mongodb/src/org/eclipse/emf/cdo/server/internal/mongodb/Commits.java
index a153ae5e35..5e6a6e2674 100644
--- a/plugins/org.eclipse.emf.cdo.server.mongodb/src/org/eclipse/emf/cdo/server/internal/mongodb/Commits.java
+++ b/plugins/org.eclipse.emf.cdo.server.mongodb/src/org/eclipse/emf/cdo/server/internal/mongodb/Commits.java
@@ -26,6 +26,7 @@ import org.eclipse.emf.cdo.common.model.EMFUtil;
import org.eclipse.emf.cdo.common.revision.CDOList;
import org.eclipse.emf.cdo.common.revision.CDORevisionCacheAdder;
import org.eclipse.emf.cdo.common.revision.CDORevisionData;
+import org.eclipse.emf.cdo.common.util.CDOCommonUtil;
import org.eclipse.emf.cdo.server.IStoreAccessor;
import org.eclipse.emf.cdo.server.IStoreAccessor.QueryResourcesContext;
import org.eclipse.emf.cdo.server.StoreThreadLocal;
@@ -469,11 +470,6 @@ public class Commits extends Coll
return null;
}
- if (classID != folderCID && classID != resourceCID)
- {
- return null;
- }
-
int version = (Integer)embedded.get(REVISIONS_VERSION);
if (version <= 0)
{
@@ -518,8 +514,10 @@ public class Commits extends Coll
}
CDOID id = idHandler.read(embedded, REVISIONS_ID);
+
+ long created = (Long)doc.get(COMMITS_ID);
long revised = getRevised(id, context.getBranch(), version, doc, embedded);
- if (revised != CDOBranchPoint.UNSPECIFIED_DATE && revised < timeStamp)
+ if (!CDOCommonUtil.isValidTimeStamp(timeStamp, created, revised))
{
return null;
}
@@ -614,11 +612,11 @@ public class Commits extends Coll
InternalCDORevision revision = unmarshallRevision(doc, embedded, id, revisionBranchPoint);
- // long revised = revision.getRevised();
- // if (revised != CDOBranchPoint.UNSPECIFIED_DATE && revised < branchPoint.getTimeStamp())
- // {
- // return null;
- // }
+ long revised = revision.getRevised();
+ if (revised != CDOBranchPoint.UNSPECIFIED_DATE && revised < branchPoint.getTimeStamp())
+ {
+ return null;
+ }
return revision;
}
diff --git a/plugins/org.eclipse.emf.cdo.server.mongodb/src/org/eclipse/emf/cdo/server/internal/mongodb/MongoDBBrowserPage.java b/plugins/org.eclipse.emf.cdo.server.mongodb/src/org/eclipse/emf/cdo/server/internal/mongodb/MongoDBBrowserPage.java
index 72531d4bd0..0f4f67889d 100644
--- a/plugins/org.eclipse.emf.cdo.server.mongodb/src/org/eclipse/emf/cdo/server/internal/mongodb/MongoDBBrowserPage.java
+++ b/plugins/org.eclipse.emf.cdo.server.mongodb/src/org/eclipse/emf/cdo/server/internal/mongodb/MongoDBBrowserPage.java
@@ -22,11 +22,11 @@ import java.util.Set;
*/
public class MongoDBBrowserPage extends AbstractPage
{
- private static final boolean SHOW_INDEXES = true;
+ private static final boolean SHOW_INDEXES = false;
private static final boolean SHOW_DOCUMENTS = true;
- private static final boolean SHOW_INITIAL_COMMIT = true;
+ private static final boolean SHOW_INITIAL_COMMIT = false;
public MongoDBBrowserPage()
{
diff --git a/plugins/org.eclipse.emf.cdo.server.mongodb/src/org/eclipse/emf/cdo/server/internal/mongodb/MongoDBStore.java b/plugins/org.eclipse.emf.cdo.server.mongodb/src/org/eclipse/emf/cdo/server/internal/mongodb/MongoDBStore.java
index c40c8a5aa6..f6321a3667 100644
--- a/plugins/org.eclipse.emf.cdo.server.mongodb/src/org/eclipse/emf/cdo/server/internal/mongodb/MongoDBStore.java
+++ b/plugins/org.eclipse.emf.cdo.server.mongodb/src/org/eclipse/emf/cdo/server/internal/mongodb/MongoDBStore.java
@@ -51,7 +51,7 @@ import java.util.Set;
* <li>Are indexes always unique? Do unique indexes exist?
* <li>Are <code>_id</code> fields in embedded objects automatically indexed?
* <li>Ensure indexes: cdo_class, (cdo_branch/cdo_version)?
- * <li>Remove skipMongo()
+ * <li>Remove skipMongo() - server-side CommitInfoManager
* </ul>
*
* @author Eike Stepper

Back to the top