jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From meteata...@apache.org
Subject svn commit: r1416496 - in /jackrabbit/oak/trunk/oak-mongomk/src: main/java/org/apache/jackrabbit/mongomk/impl/action/ main/java/org/apache/jackrabbit/mongomk/impl/command/ main/java/org/apache/jackrabbit/mongomk/impl/instruction/ test/java/org/apache/j...
Date Mon, 03 Dec 2012 12:58:51 GMT
Author: meteatamel
Date: Mon Dec  3 12:58:50 2012
New Revision: 1416496

URL: http://svn.apache.org/viewvc?rev=1416496&view=rev
Log:
OAK-489 - FetchNodesAction need to limit the versions of a node

Reintroduce depth as a parameter to the constructor of FetchNodesAction as depth is essential
to fetching nodes.

Modified:
    jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/action/FetchNodesActionNew.java
    jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/command/GetNodesCommandNew.java
    jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/instruction/CommitCommandInstructionVisitor.java
    jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/impl/action/FetchNodesActionTest.java

Modified: jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/action/FetchNodesActionNew.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/action/FetchNodesActionNew.java?rev=1416496&r1=1416495&r2=1416496&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/action/FetchNodesActionNew.java
(original)
+++ jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/action/FetchNodesActionNew.java
Mon Dec  3 12:58:50 2012
@@ -58,12 +58,15 @@ public class FetchNodesActionNew extends
      *
      * @param nodeStore Node store.
      * @param path The path.
+     * @param depth The depth.
      * @param revisionId The revision id.
      */
-    public FetchNodesActionNew(MongoNodeStore nodeStore, String path, long revisionId) {
+    public FetchNodesActionNew(MongoNodeStore nodeStore, String path, int depth,
+            long revisionId) {
         super(nodeStore);
         paths = new HashSet<String>();
         paths.add(path);
+        this.depth = depth;
         this.revisionId = revisionId;
     }
 
@@ -90,15 +93,6 @@ public class FetchNodesActionNew extends
         this.branchId = branchId;
     }
 
-    /**
-     * Sets the depth for the command. Only used when fetchDescendants is enabled.
-     *
-     * @param depth The depth for the command or -1 for limitless depth.
-     */
-    public void setDepth(int depth) {
-        this.depth = depth;
-    }
-
     @Override
     public Map<String, MongoNode> execute() {
         if (paths.isEmpty()) {

Modified: jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/command/GetNodesCommandNew.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/command/GetNodesCommandNew.java?rev=1416496&r1=1416495&r2=1416496&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/command/GetNodesCommandNew.java
(original)
+++ jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/command/GetNodesCommandNew.java
Mon Dec  3 12:58:50 2012
@@ -135,9 +135,8 @@ public class GetNodesCommandNew extends 
     }
 
     private void readNodesByPath() {
-        FetchNodesActionNew query = new FetchNodesActionNew(nodeStore, path, revisionId);
+        FetchNodesActionNew query = new FetchNodesActionNew(nodeStore, path, depth, revisionId);
         query.setBranchId(branchId);
-        query.setDepth(depth);
         pathAndNodeMap = query.execute();
     }
 

Modified: jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/instruction/CommitCommandInstructionVisitor.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/instruction/CommitCommandInstructionVisitor.java?rev=1416496&r1=1416495&r2=1416496&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/instruction/CommitCommandInstructionVisitor.java
(original)
+++ jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/instruction/CommitCommandInstructionVisitor.java
Mon Dec  3 12:58:50 2012
@@ -156,7 +156,7 @@ public class CommitCommandInstructionVis
 
         // First, copy the existing nodes.
         Map<String, MongoNode> nodesToCopy = new FetchNodesActionNew(nodeStore,
-                srcPath, headRevisionId).execute();
+                srcPath, FetchNodesActionNew.LIMITLESS_DEPTH, headRevisionId).execute();
         for (MongoNode nodeMongo : nodesToCopy.values()) {
             String oldPath = nodeMongo.getPath();
             String oldPathRel = PathUtils.relativize(srcPath, oldPath);
@@ -204,7 +204,7 @@ public class CommitCommandInstructionVis
 
         // First, copy the existing nodes.
         Map<String, MongoNode> nodesToCopy = new FetchNodesActionNew(nodeStore,
-                srcPath, headRevisionId).execute();
+                srcPath, FetchNodesActionNew.LIMITLESS_DEPTH, headRevisionId).execute();
         for (MongoNode nodeMongo : nodesToCopy.values()) {
             String oldPath = nodeMongo.getPath();
             String oldPathRel = PathUtils.relativize(srcPath, oldPath);

Modified: jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/impl/action/FetchNodesActionTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/impl/action/FetchNodesActionTest.java?rev=1416496&r1=1416495&r2=1416496&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/impl/action/FetchNodesActionTest.java
(original)
+++ jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/impl/action/FetchNodesActionTest.java
Mon Dec  3 12:58:50 2012
@@ -214,9 +214,6 @@ public class FetchNodesActionTest extend
 
     private List<Node> createAndExecuteQuery(long revisionId, Set<String> paths,
int depth) {
         FetchNodesActionNew query = new FetchNodesActionNew(getNodeStore(), paths, revisionId);
-        if (depth > -1) {
-            query.setDepth(depth);
-        }
         return toNode(query.execute());
     }
 



Mime
View raw message