You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by tgrall <gi...@git.apache.org> on 2016/10/11 15:26:22 UTC

[GitHub] drill pull request #609: DRILL-4882 - Support for MongoDB Direct Connection ...

GitHub user tgrall opened a pull request:

    https://github.com/apache/drill/pull/609

    DRILL-4882 - Support for MongoDB Direct Connection to a node in a Replica Set.

    See issue DRILL-4882
    
    In some case, for analytics the applicatio, Drill, has to connect to node directly without access the replica set or shard globally.
    
    The new configuration option `direct-connection` true|false allows drillbit to be directly connected to a node.
    
    References:
    * [Connection String](http://mongodb.github.io/mongo-java-driver/3.0/driver/reference/connecting/connection-settings/)
    * [Direct Connection term](https://github.com/mongodb/specifications/blob/master/source/server-selection/server-selection.rst#terms)


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/tgrall/drill DRILL-4882

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/drill/pull/609.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #609
    
----

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] drill pull request #609: DRILL-4882 - Support for MongoDB Direct Connection ...

Posted by chunhui-shi <gi...@git.apache.org>.
Github user chunhui-shi commented on a diff in the pull request:

    https://github.com/apache/drill/pull/609#discussion_r94687060
  
    --- Diff: contrib/storage-mongo/src/main/java/org/apache/drill/exec/store/mongo/MongoStoragePlugin.java ---
    @@ -136,17 +138,40 @@ public synchronized MongoClient getClient(List<ServerAddress> addresses) {
         if (client == null) {
           if (credential != null) {
             List<MongoCredential> credentialList = Arrays.asList(credential);
    -        client = new MongoClient(addresses, credentialList, clientURI.getOptions());
    +        if (!isDirectConnection()) {
    --- End diff --
    
    Could you add Unit test for this fix?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] drill pull request #609: DRILL-4882 - Support for MongoDB Direct Connection ...

Posted by chunhui-shi <gi...@git.apache.org>.
Github user chunhui-shi commented on a diff in the pull request:

    https://github.com/apache/drill/pull/609#discussion_r94686987
  
    --- Diff: contrib/storage-mongo/src/main/resources/bootstrap-storage-plugins.json ---
    @@ -3,7 +3,8 @@
         mongo : {
           type:"mongo",
           enabled: false,
    -      connection:"mongodb://localhost:27017/"
    +      connection:"mongodb://localhost:27017/",
    +      "direct-connection" : false
         }
    --- End diff --
    
    Could you make "direct-connection" optional but default to false?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---