jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thom...@apache.org
Subject svn commit: r1445721 - in /jackrabbit/oak/trunk/oak-mongomk/src: main/java/org/apache/jackrabbit/mongomk/prototype/MongoDocumentStore.java test/java/org/apache/jackrabbit/mongomk/prototype/MongoDocumentStoreTest.java
Date Wed, 13 Feb 2013 16:40:35 GMT
Author: thomasm
Date: Wed Feb 13 16:40:35 2013
New Revision: 1445721

URL: http://svn.apache.org/r1445721
Log:
OAK-619 Lock-free MongoMK implementation

Modified:
    jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/prototype/MongoDocumentStore.java
    jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/prototype/MongoDocumentStoreTest.java

Modified: jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/prototype/MongoDocumentStore.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/prototype/MongoDocumentStore.java?rev=1445721&r1=1445720&r2=1445721&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/prototype/MongoDocumentStore.java
(original)
+++ jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/prototype/MongoDocumentStore.java
Wed Feb 13 16:40:35 2013
@@ -33,7 +33,7 @@ import com.mongodb.WriteResult;
 
 public class MongoDocumentStore implements DocumentStore {
 
-    private static final String KEY_PATH = "_path";
+    private static final String KEY_PATH = "_id";
     private static final Logger LOG = LoggerFactory.getLogger(MongoDocumentStore.class);
 
     private final DBCollection nodesCollection;
@@ -111,13 +111,13 @@ public class MongoDocumentStore implemen
     }
 
     private void ensureIndex() {
-        DBObject index = new BasicDBObject();
-        index.put(KEY_PATH, 1L);
-
-        DBObject options = new BasicDBObject();
-        options.put("unique", Boolean.TRUE);
-
-        nodesCollection.ensureIndex(index, options);
+        // the _id field is the primary key, so we don't need to define it
+        // the following code is just a template in case we need more indexes
+        // DBObject index = new BasicDBObject();
+        // index.put(KEY_PATH, 1L);
+        // DBObject options = new BasicDBObject();
+        // options.put("unique", Boolean.TRUE);
+        // nodesCollection.ensureIndex(index, options);
     }
 
     private static Map<String, Object> convertFromDBObject(DBObject n) {
@@ -146,7 +146,7 @@ public class MongoDocumentStore implemen
         return dbCollection.findOne(getByPathQuery(path));
     }
 
-    private DBObject getByPathQuery(String path) {
+    private static DBObject getByPathQuery(String path) {
         return QueryBuilder.start(KEY_PATH).is(path).get();
     }
 }
\ No newline at end of file

Modified: jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/prototype/MongoDocumentStoreTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/prototype/MongoDocumentStoreTest.java?rev=1445721&r1=1445720&r2=1445721&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/prototype/MongoDocumentStoreTest.java
(original)
+++ jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/prototype/MongoDocumentStoreTest.java
Wed Feb 13 16:40:35 2013
@@ -29,7 +29,7 @@ import org.junit.Test;
 
 public class MongoDocumentStoreTest {
     
-    private static boolean MONGO_DB = false;
+    private static boolean MONGO_DB = true;
     
     // private final static int NODE_COUNT = 2000;
     private static int NODE_COUNT = 10;



Mime
View raw message