jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r1513876 - /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/ClusterNodeInfo.java
Date Wed, 14 Aug 2013 13:37:19 GMT
Author: mreutegg
Date: Wed Aug 14 13:37:18 2013
New Revision: 1513876

URL: http://svn.apache.org/r1513876
Log:
OAK-926: MongoMK: split documents when they are too large
- Use document id in ClusterNodeInfo

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/ClusterNodeInfo.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/ClusterNodeInfo.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/ClusterNodeInfo.java?rev=1513876&r1=1513875&r2=1513876&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/ClusterNodeInfo.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/ClusterNodeInfo.java
Wed Aug 14 13:37:18 2013
@@ -29,6 +29,8 @@ import org.apache.jackrabbit.mk.util.Str
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import static org.apache.jackrabbit.oak.plugins.mongomk.Document.ID;
+
 /**
  * Information about a cluster node.
  */
@@ -42,11 +44,6 @@ public class ClusterNodeInfo {
     private static final String RANDOM_PREFIX = "random:";
     
     /**
-     * The cluster node id.
-     */
-    private static final String ID_KEY = "_id";
-    
-    /**
      * The machine id.
      */
     private static final String MACHINE_ID_KEY = "machine";
@@ -164,7 +161,7 @@ public class ClusterNodeInfo {
         for (int i = 0; i < 10; i++) {
             ClusterNodeInfo clusterNode = createInstance(store, machineId, instanceId);
             UpdateOp update = new UpdateOp(null, "" + clusterNode.id, true);
-            update.set(ID_KEY, "" + clusterNode.id);
+            update.set(ID, String.valueOf(clusterNode.id));
             update.set(MACHINE_ID_KEY, clusterNode.machineId);
             update.set(INSTANCE_ID_KEY, clusterNode.instanceId);
             update.set(LEASE_END_KEY, System.currentTimeMillis() + clusterNode.leaseTime);
@@ -185,7 +182,7 @@ public class ClusterNodeInfo {
         int clusterNodeId = 0;
         int maxId = 0;
         for (Document doc : list) {
-            String key = "" + doc.get(ID_KEY);
+            String key = doc.getId();
             int id;
             try {
                 id = Integer.parseInt(key);



Mime
View raw message