reschke commented on code in PR #2224:
URL: https://github.com/apache/jackrabbit-oak/pull/2224#discussion_r2039171535


##########
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreBuilder.java:
##########
@@ -117,7 +116,7 @@ public class DocumentNodeStoreBuilder<T extends 
DocumentNodeStoreBuilder<T>> {
      */
     static final int UPDATE_LIMIT = Integer.getInteger("update.limit", 
DEFAULT_UPDATE_LIMIT);
 
-    protected Supplier<DocumentStore> documentStoreSupplier = ofInstance(new 
MemoryDocumentStore());
+    protected Supplier<DocumentStore> documentStoreSupplier = () -> new 
MemoryDocumentStore();

Review Comment:
   Try:
   
   ~~~
   diff --git 
a/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreBuilder.java
 
b/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreBuilder.java
   index 884ce2d881..4d760bedcc 100644
   --- 
a/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreBuilder.java
   +++ 
b/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreBuilder.java
   @@ -35,7 +35,6 @@ import java.util.concurrent.TimeUnit;
    import java.util.function.Predicate;
    import java.util.function.Supplier;
   
   -import org.apache.jackrabbit.guava.common.base.Suppliers;
    import org.apache.jackrabbit.guava.common.cache.Cache;
    import org.apache.jackrabbit.guava.common.cache.CacheBuilder;
    import org.apache.jackrabbit.guava.common.cache.RemovalCause;
   @@ -117,8 +116,10 @@ public class DocumentNodeStoreBuilder<T extends 
DocumentNodeStoreBuilder<T>> {
         */
        static final int UPDATE_LIMIT = Integer.getInteger("update.limit", 
DEFAULT_UPDATE_LIMIT);
   
   -    protected Supplier<DocumentStore> documentStoreSupplier = 
Suppliers.ofInstance(new MemoryDocumentStore());
   -    protected Supplier<BlobStore> blobStoreSupplier;
   +    private static DocumentStore defaultDocumentStore = new 
MemoryDocumentStore();
   +    protected Supplier<DocumentStore> documentStoreSupplier = () -> 
defaultDocumentStore;
   +    private static BlobStore defaultBlobStore = new MemoryBlobStore();
   +    protected Supplier<BlobStore> blobStoreSupplier = () -> 
defaultBlobStore;
        private DiffCache diffCache;
        private int clusterId  = Integer.getInteger("oak.documentMK.clusterId", 
0);
        private int asyncDelay = 1000;
   @@ -539,9 +540,6 @@ public class DocumentNodeStoreBuilder<T extends 
DocumentNodeStoreBuilder<T>> {
        }
   
        public BlobStore getBlobStore() {
   -        if (blobStoreSupplier == null) {
   -            blobStoreSupplier = () -> new MemoryBlobStore();
   -        }
            BlobStore blobStore = blobStoreSupplier.get();
            configureBlobStore(blobStore);
            return blobStore;
   ~~~



-- 
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: oak-dev-unsubscr...@jackrabbit.apache.org

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

Reply via email to