You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by GitBox <gi...@apache.org> on 2021/09/14 06:59:46 UTC

[GitHub] [jackrabbit-oak] thomasmueller commented on a change in pull request #370: Oak-9566 | Improve Index Stats

thomasmueller commented on a change in pull request #370:
URL: https://github.com/apache/jackrabbit-oak/pull/370#discussion_r707966554



##########
File path: oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexMBeanImpl.java
##########
@@ -122,13 +133,13 @@ public TabularData getIndexStats() throws IOException {
             TabularType tt = new TabularType(LuceneIndexMBeanImpl.class.getName(),
                     "Lucene Index Stats", IndexStats.TYPE, new String[]{"path"});
             tds = new TabularDataSupport(tt);
-            Set<String> indexes = indexTracker.getIndexNodePaths();
-            for (String path : indexes) {
+            // Use indexPathService to get list of all the lucene indexes.

Review comment:
       We need to avoid downloading all indexes, that's for sure. If that means we have some unknown data (numDocs and so on), then that's fine. Should we set "unknown" to the value -1 or 0?

##########
File path: oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexMBeanImpl.java
##########
@@ -122,13 +133,13 @@ public TabularData getIndexStats() throws IOException {
             TabularType tt = new TabularType(LuceneIndexMBeanImpl.class.getName(),
                     "Lucene Index Stats", IndexStats.TYPE, new String[]{"path"});
             tds = new TabularDataSupport(tt);
-            Set<String> indexes = indexTracker.getIndexNodePaths();
-            for (String path : indexes) {
+            // Use indexPathService to get list of all the lucene indexes.

Review comment:
       I hope some of the info we can still list, even without potentially downloading the indexes (by calling acquireIndexNode) - for example lastUpdatedTimestamp, hasHiddenOakLibsMount, hasPropertyIndex, and size on disk. But I guess we can't list things like nrtNumDocs, numDocs, and so on. Right?

##########
File path: oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexInfoProvider.java
##########
@@ -140,6 +139,24 @@ private static void computeLastUpdatedTime(NodeState idxState, LuceneIndexInfo i
         }
     }
 
+    private static void checkIfHiddenNodesExists(NodeState idxState, LuceneIndexInfo info) {
+        // Check for hidden oak libs mount node that has indexed content for read only repo in composite store
+        info.hasHiddenOakLibsMount = false;
+        for(String c : idxState.getChildNodeNames()) {
+            if (c.startsWith(IndexDefinition.HIDDEN_OAK_MOUNT_PREFIX)) {

Review comment:
       `startsWith` makes sense in my view... The cases we have so far is all `:oak:mount-libs-index-data`, but someone might change the read-only mount names. I think the prefix will always stay like this.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@jackrabbit.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org