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


##########
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/util/LeaseCheckDocumentStoreWrapper.java:
##########
@@ -52,133 +53,134 @@ public LeaseCheckDocumentStoreWrapper(final DocumentStore 
delegate, final Cluste
         this.clusterNodeInfo = clusterNodeInfo;
     }
 
-    private final void performLeaseCheck() {
+    private void performLeaseCheck() {
         if (clusterNodeInfo != null) {
             clusterNodeInfo.performLeaseCheck();
         }
     }
 
     @Override
-    public final <T extends Document> T find(Collection<T> collection, String 
key) {
-        performLeaseCheck();
-        return delegate.find(collection, key);
+    public <T extends Document> T find(Collection<T> collection, String key) {
+        return leaseChecking(() ->
+                delegate.find(collection, key));
     }
 
     @Override
-    public final <T extends Document> T find(Collection<T> collection, String 
key,
-            int maxCacheAge) {
-        performLeaseCheck();
-        return delegate.find(collection, key, maxCacheAge);
+    public <T extends Document> T find(Collection<T> collection, String key,
+                                       int maxCacheAge) {
+        return leaseChecking(() ->
+                delegate.find(collection, key, maxCacheAge));
+
     }
 
     @Override
-    public final <T extends Document> List<T> query(Collection<T> collection,
-            String fromKey, String toKey, int limit) {
-        performLeaseCheck();
-        return delegate.query(collection, fromKey, toKey, limit);
+    public <T extends Document> List<T> query(Collection<T> collection,
+                                              String fromKey, String toKey, 
int limit) {

Review Comment:
   same as above



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