You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by GitBox <gi...@apache.org> on 2022/09/06 14:41:29 UTC

[GitHub] [jackrabbit-oak] gnaresh19 commented on a diff in pull request #684: [Oak 9919] Add support for zstd, zlib to document store with mongodb

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


##########
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:
   This method performs:
   - if collection exists (empty or with data), skips creating new collection
   - else, creates collection per collection config



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

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