thomasmueller commented on code in PR #3112:
URL: https://github.com/apache/jackrabbit-oak/pull/3112#discussion_r3979788084


##########
oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/AsyncIndexUpdate.java:
##########
@@ -1406,6 +1417,25 @@ public void doneOneCycle(long timeInMillis, long 
updates){
                 lastIndexedTime.inc(System.currentTimeMillis() - 
previousLastIndexedTime);
             }
 
+            /**
+             * Reads the persisted ":async/<lane>-LastIndexedTo" 
property as epoch millis,
+             * or 0 when it is absent or cannot be parsed (e.g. before the 
initial index).
+             * Used to initialise the {@code lastIndexedTime} counter at 
construction.
+             */
+            private long readLastIndexedToMillis() {
+                try {
+                    PropertyState ps = 
store.getRoot().getChildNode(ASYNC).getProperty(lastIndexedTo);
+                    if (ps == null) {
+                        return 0;
+                    }
+                    Calendar cal = ISO8601.parse(ps.getValue(Type.STRING));
+                    return cal != null ? cal.getTimeInMillis() : 0;
+                } catch (Exception e) {
+                    log.debug("[{}] Unable to read {} for LAST_INDEXED_TIME 
metric", name, lastIndexedTo, e);

Review Comment:
   ```suggestion
                       log.warn("[{}] Unable to read {} for LAST_INDEXED_TIME 
metric", name, lastIndexedTo, e);
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to