You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by GitBox <gi...@apache.org> on 2021/10/27 12:24:14 UTC

[GitHub] [drill] luocooong commented on a change in pull request #2352: DRILL-8021: Add the srv protocol support for the mongo storage

luocooong commented on a change in pull request #2352:
URL: https://github.com/apache/drill/pull/2352#discussion_r737409995



##########
File path: contrib/storage-mongo/src/main/java/org/apache/drill/exec/store/mongo/MongoStoragePlugin.java
##########
@@ -195,6 +199,18 @@ public MongoClient getClient() {
     return getClient(addresses);
   }
 
+  public synchronized MongoClient getClientWithSrvProtocol() {
+    MongoClientSettings settings = MongoClientSettings.builder()
+        .applyConnectionString(clientURI)
+        .build();
+    MongoClient client = MongoClients.create(settings);
+    ServerAddress serverAddress = new ServerAddress(clientURI.getHosts().get(0));
+    String userName = clientURI.getCredential().getUserName();

Review comment:
       Good practices. But we have done it. The credentials in the `clientURI` variable were processed during the construction period, and the `clientURI` is only available in the memory.  See that :
   https://github.com/apache/drill/blob/b6da35ece5a278a5ca72ecc33bafc98ba8f861f6/contrib/storage-mongo/src/main/java/org/apache/drill/exec/store/mongo/MongoStoragePlugin.java#L80-L81




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

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