mreutegg commented on code in PR #684:
URL: https://github.com/apache/jackrabbit-oak/pull/684#discussion_r963768603


##########
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoDocumentStore.java:
##########
@@ -383,16 +393,17 @@ private MongoDBConnection 
getOrCreateClusterNodesConnection(@NotNull MongoDocume
         return mc;
     }
 
-    private void ensureIndexes(@NotNull MongoStatus mongoStatus) {
+    private void ensureIndexes(MongoDatabase db, @NotNull MongoStatus 
mongoStatus) {

Review Comment:
   Please add `NotNull` annotation to `db` parameter.



##########
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoDocumentStore.java:
##########
@@ -383,16 +393,17 @@ private MongoDBConnection 
getOrCreateClusterNodesConnection(@NotNull MongoDocume
         return mc;
     }
 
-    private void ensureIndexes(@NotNull MongoStatus mongoStatus) {
+    private void ensureIndexes(MongoDatabase db, @NotNull MongoStatus 
mongoStatus) {
         // reading documents in the nodes collection and checking
         // existing indexes is performed against the MongoDB primary
         // this ensures the information is up-to-date and accurate
         boolean emptyNodesCollection = execute(session -> 
MongoUtils.isCollectionEmpty(nodes, session), Collection.NODES);
-
+        createCollection(db, Collection.NODES.toString(), mongoStatus);

Review Comment:
   What happens when the collection exists and is empty? Will this method still 
succeed?



##########
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoDocumentStore.java:
##########
@@ -242,7 +244,7 @@ enum DocumentReadPreference {
      * How many times should be the bulk update request retries in case of
      * a conflict.
      * <p>
-     * Default is 0 (no retries).
+     * Default is 0 (no retries).≠≠

Review Comment:
   This looks unintentional.



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

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

Reply via email to