You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by re...@apache.org on 2026/01/20 16:52:25 UTC

(jackrabbit-filevault) branch JCRVLT-836 created (now 0a977fa3)

This is an automated email from the ASF dual-hosted git repository.

reschke pushed a change to branch JCRVLT-836
in repository https://gitbox.apache.org/repos/asf/jackrabbit-filevault.git


      at 0a977fa3 JCRVLT-836: log durations and number of nodes in AggregateImpl node walk

This branch includes the following new commits:

     new 0444ce6c Revert "JCRVLT-836: log durations and number of nodes in AggregateImpl node walk"
     new 0a977fa3 JCRVLT-836: log durations and number of nodes in AggregateImpl node walk

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(jackrabbit-filevault) 01/02: Revert "JCRVLT-836: log durations and number of nodes in AggregateImpl node walk"

Posted by re...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

reschke pushed a commit to branch JCRVLT-836
in repository https://gitbox.apache.org/repos/asf/jackrabbit-filevault.git

commit 0444ce6c82fc2784b8490770370f9bb4152f6dee
Author: Julian Reschke <ju...@gmx.de>
AuthorDate: Tue Jan 20 17:49:03 2026 +0100

    Revert "JCRVLT-836: log durations and number of nodes in AggregateImpl node walk"
    
    This reverts commit 68909428e148cc1e2d4302bd31b5324d4eba0874.
---
 .../jackrabbit/vault/fs/impl/AggregateImpl.java    | 31 ----------------------
 1 file changed, 31 deletions(-)

diff --git a/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/impl/AggregateImpl.java b/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/impl/AggregateImpl.java
index 9b50ceb2..28b0e71b 100644
--- a/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/impl/AggregateImpl.java
+++ b/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/impl/AggregateImpl.java
@@ -29,7 +29,6 @@ import javax.jcr.Value;
 
 import java.io.IOException;
 import java.lang.ref.WeakReference;
-import java.time.Duration;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
@@ -105,8 +104,6 @@ public class AggregateImpl implements Aggregate {
     private List<AggregateImpl> leaves;
 
     private String[] namespacePrefixes;
-    private long nodesVisitedForPrefixScanning;
-    private long siblingNodesInOrderedCollectionVisitedForPrefixScanning;
 
     private char state = STATE_INITIAL;
 
@@ -628,21 +625,10 @@ public class AggregateImpl implements Aggregate {
             }
             try {
                 load();
-                log.debug("starting namespace prefix walk of '{}'", this.path);
-                long start = System.nanoTime();
                 Set<String> prefixes = new HashSet<String>();
                 // need to traverse the nodes to get all namespaces
                 loadNamespaces(prefixes, "", getNode());
                 namespacePrefixes = prefixes.toArray(new String[prefixes.size()]);
-                Duration duration = Duration.ofNanos(System.nanoTime() - start);
-                log.debug(
-                        "namespace prefix walk of '{}', visited {} nodes (of which {} siblings in ordered collections), prefixes: {}, elapsed {}ms, ({})",
-                        this.path,
-                        this.nodesVisitedForPrefixScanning,
-                        this.siblingNodesInOrderedCollectionVisitedForPrefixScanning,
-                        this.namespacePrefixes,
-                        duration.toMillis(),
-                        duration);
             } catch (RepositoryException e) {
                 throw new IllegalStateException("Internal error while loading namespaces", e);
             }
@@ -651,7 +637,6 @@ public class AggregateImpl implements Aggregate {
 
     private void loadNamespaces(Set<String> prefixes, String parentPath, Node node) throws RepositoryException {
         String name = node.getName();
-        nodesVisitedForPrefixScanning += 1;
         addNamespace(prefixes, name);
         for (PropertyIterator iter = node.getProperties(); iter.hasNext(); ) {
             Property p = iter.nextProperty();
@@ -670,11 +655,8 @@ public class AggregateImpl implements Aggregate {
             Node c = iter.nextNode();
             String relPath = parentPath + "/" + c.getName();
             if (includes(relPath)) {
-                nodesVisitedForPrefixScanning += 1;
                 loadNamespaces(prefixes, relPath, c);
             } else if (hasOrderableChildNodes) {
-                nodesVisitedForPrefixScanning += 1;
-                siblingNodesInOrderedCollectionVisitedForPrefixScanning += 1;
                 addNamespace(prefixes, c.getName());
             }
         }
@@ -737,15 +719,10 @@ public class AggregateImpl implements Aggregate {
         // get a node iterator suitable for the current node and the applicable filters
         NodeIterator nIter = getNodeIteratorFor(node, filter);
 
-        log.debug("starting aggregate walk of '{}'", this.path);
-        int visited = 0;
-        long startTime = System.nanoTime();
-
         // include "our" nodes to the include set and delegate the others to the
         // respective aggregator building sub aggregates
         while (nIter.hasNext()) {
             Node n = nIter.nextNode();
-            visited += 1;
             String path = n.getPath();
             log.trace("checking {}", path);
 
@@ -803,14 +780,6 @@ public class AggregateImpl implements Aggregate {
                 }
             }
         }
-
-        Duration duration = Duration.ofNanos(System.nanoTime() - startTime);
-        log.debug(
-                "aggregate walk of '{}', visited {} siblings in {}ms ({})",
-                node.getPath(),
-                visited,
-                duration.toMillis(),
-                duration);
     }
 
     private static NodeIterator getNodeIteratorFor(Node node, WorkspaceFilter filter) throws RepositoryException {


(jackrabbit-filevault) 02/02: JCRVLT-836: log durations and number of nodes in AggregateImpl node walk

Posted by re...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

reschke pushed a commit to branch JCRVLT-836
in repository https://gitbox.apache.org/repos/asf/jackrabbit-filevault.git

commit 0a977fa307513957c388c6f7f43d29b0c539e352
Author: Julian Reschke <ju...@gmx.de>
AuthorDate: Tue Jan 20 17:52:04 2026 +0100

    JCRVLT-836: log durations and number of nodes in AggregateImpl node walk
---
 .../jackrabbit/vault/fs/impl/AggregateImpl.java    | 31 ++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/impl/AggregateImpl.java b/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/impl/AggregateImpl.java
index 28b0e71b..9b50ceb2 100644
--- a/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/impl/AggregateImpl.java
+++ b/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/impl/AggregateImpl.java
@@ -29,6 +29,7 @@ import javax.jcr.Value;
 
 import java.io.IOException;
 import java.lang.ref.WeakReference;
+import java.time.Duration;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
@@ -104,6 +105,8 @@ public class AggregateImpl implements Aggregate {
     private List<AggregateImpl> leaves;
 
     private String[] namespacePrefixes;
+    private long nodesVisitedForPrefixScanning;
+    private long siblingNodesInOrderedCollectionVisitedForPrefixScanning;
 
     private char state = STATE_INITIAL;
 
@@ -625,10 +628,21 @@ public class AggregateImpl implements Aggregate {
             }
             try {
                 load();
+                log.debug("starting namespace prefix walk of '{}'", this.path);
+                long start = System.nanoTime();
                 Set<String> prefixes = new HashSet<String>();
                 // need to traverse the nodes to get all namespaces
                 loadNamespaces(prefixes, "", getNode());
                 namespacePrefixes = prefixes.toArray(new String[prefixes.size()]);
+                Duration duration = Duration.ofNanos(System.nanoTime() - start);
+                log.debug(
+                        "namespace prefix walk of '{}', visited {} nodes (of which {} siblings in ordered collections), prefixes: {}, elapsed {}ms, ({})",
+                        this.path,
+                        this.nodesVisitedForPrefixScanning,
+                        this.siblingNodesInOrderedCollectionVisitedForPrefixScanning,
+                        this.namespacePrefixes,
+                        duration.toMillis(),
+                        duration);
             } catch (RepositoryException e) {
                 throw new IllegalStateException("Internal error while loading namespaces", e);
             }
@@ -637,6 +651,7 @@ public class AggregateImpl implements Aggregate {
 
     private void loadNamespaces(Set<String> prefixes, String parentPath, Node node) throws RepositoryException {
         String name = node.getName();
+        nodesVisitedForPrefixScanning += 1;
         addNamespace(prefixes, name);
         for (PropertyIterator iter = node.getProperties(); iter.hasNext(); ) {
             Property p = iter.nextProperty();
@@ -655,8 +670,11 @@ public class AggregateImpl implements Aggregate {
             Node c = iter.nextNode();
             String relPath = parentPath + "/" + c.getName();
             if (includes(relPath)) {
+                nodesVisitedForPrefixScanning += 1;
                 loadNamespaces(prefixes, relPath, c);
             } else if (hasOrderableChildNodes) {
+                nodesVisitedForPrefixScanning += 1;
+                siblingNodesInOrderedCollectionVisitedForPrefixScanning += 1;
                 addNamespace(prefixes, c.getName());
             }
         }
@@ -719,10 +737,15 @@ public class AggregateImpl implements Aggregate {
         // get a node iterator suitable for the current node and the applicable filters
         NodeIterator nIter = getNodeIteratorFor(node, filter);
 
+        log.debug("starting aggregate walk of '{}'", this.path);
+        int visited = 0;
+        long startTime = System.nanoTime();
+
         // include "our" nodes to the include set and delegate the others to the
         // respective aggregator building sub aggregates
         while (nIter.hasNext()) {
             Node n = nIter.nextNode();
+            visited += 1;
             String path = n.getPath();
             log.trace("checking {}", path);
 
@@ -780,6 +803,14 @@ public class AggregateImpl implements Aggregate {
                 }
             }
         }
+
+        Duration duration = Duration.ofNanos(System.nanoTime() - startTime);
+        log.debug(
+                "aggregate walk of '{}', visited {} siblings in {}ms ({})",
+                node.getPath(),
+                visited,
+                duration.toMillis(),
+                duration);
     }
 
     private static NodeIterator getNodeIteratorFor(Node node, WorkspaceFilter filter) throws RepositoryException {