rishabhdaim commented on code in PR #690:
URL: https://github.com/apache/jackrabbit-oak/pull/690#discussion_r983707764


##########
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreBuilder.java:
##########
@@ -526,6 +527,15 @@ public T 
setDocumentStoreStatsCollector(DocumentStoreStatsCollector documentStor
         return thisBuilder();
     }
 
+    public ThrottlingStatsCollector getThrottlingStatsCollector() {
+        return throttlingStatsCollector;
+    }
+
+    public T setThrottlingStatsCollector(final ThrottlingStatsCollector 
throttlingStatsCollector) {
+        this.throttlingStatsCollector = throttlingStatsCollector;
+        return thisBuilder();
+    }

Review Comment:
   how about the following code change in the `getThrottlingStatsCollector`:
   ```@NotNull
       public ThrottlingStatsCollector getThrottlingStatsCollector() {
           if (isNull(throttlingStatsCollector)) {
               throttlingStatsCollector = new 
ThrottlingStatsCollectorImpl(statisticsProvider);
           }
           return throttlingStatsCollector;
       }
   ```
   
   This would ensure that we always get non-null throttlingStatsCollector.
   We have followed the same approach in `getDocumentStoreStatsCollector` as 
well.



-- 
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