stefan-egli commented on a change in pull request #283:
URL: https://github.com/apache/jackrabbit-oak/pull/283#discussion_r609570848
##########
File path:
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoSessionFactory.java
##########
@@ -37,22 +37,23 @@
private final ClientSessionOptions options;
+ private final MongoClock clock;
Review comment:
I might not fully understand this, but MongoClock is somewhat confusing
me. IIUC it is only used by MongoSessionFactory and serves as a replacement for
the `clusterTime` and `operationTime` fields that were previously used (and now
become obsolete). In that case, could the scope `MongoClock` not actually be
limited to be a private/inner class of MongoSessionFactory - or is the
MongoClock indeed being used outside of this class?
##########
File path:
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoDBClient.java
##########
@@ -0,0 +1,145 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.oak.plugins.document.mongo;
+
+import com.mongodb.BasicDBObject;
+import com.mongodb.MongoClient;
+import com.mongodb.MongoClientOptions;
+import com.mongodb.MongoClientURI;
+import com.mongodb.ReadConcernLevel;
+import com.mongodb.client.ClientSession;
+import com.mongodb.client.MongoCollection;
+import com.mongodb.client.MongoDatabase;
+
+import org.apache.jackrabbit.oak.plugins.document.util.MongoConnection;
+import org.jetbrains.annotations.NotNull;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+import static
org.apache.jackrabbit.oak.plugins.document.util.MongoConnection.readConcernLevel;
+
+/**
+ * Simple struct that contains {@code MongoClient}, {@code MongoDatabase} and
+ * {@code MongoStatus}.
+ */
+final class MongoDBClient {
Review comment:
I was wondering if there would be an alternative name for
`MongoDBClient`. Reason is that there is code that does `client.getClient()`
which is a bit difficult to read, as you need to know that there are
effectively 2 layers or 2 concepts of client (the MongoDBClient and the
MongoClient).. IIUC this is like a `Holder` or an `Info` (but the latter is
also a bit underappreciating the functionality of this class).. so, not sure
what's a better name, but at least this name was initially not directly
intuitive (as it collides with MongoClient)
##########
File path:
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreServiceConfiguration.java
##########
@@ -73,6 +73,12 @@
*/
private static final String FWK_PROP_SO_KEEP_ALIVE =
"oak.mongo.socketKeepAlive";
+ /**
+ * Name of framework property to configure socket timeout for lease update
+ * operations on MongoDB.
+ */
+ private static final String FWK_PROP_LEASE_SO_TIMEOUT =
"oak.mongo.leaseSocketTimeout";
Review comment:
To @reschke 's comment re naming/generalising : what I noticed is that
the property key has `mongo` in it (to make it clear, it is only for mongo) -
but this field does not. Perhaps it could be renamed to sth like
`FWK_PROP_MONGO_LEASE_SO_TIMEOUT` (and the same would then also apply to other
places/methods that use leaseSoTimeout and not specifically call it out as
belonging to mongo
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]