drill-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From par...@apache.org
Subject drill git commit: DRILL-2811: Fix connection to individual drill bit. Allow port to be optional.
Date Sat, 02 May 2015 06:24:06 GMT
Repository: drill
Updated Branches:
  refs/heads/master f8a91f14b -> 636177df1


DRILL-2811: Fix connection to individual drill bit. Allow port to be optional.


Project: http://git-wip-us.apache.org/repos/asf/drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/drill/commit/636177df
Tree: http://git-wip-us.apache.org/repos/asf/drill/tree/636177df
Diff: http://git-wip-us.apache.org/repos/asf/drill/diff/636177df

Branch: refs/heads/master
Commit: 636177df12c593368676d42bc17b65d684c8d000
Parents: f8a91f1
Author: Parth Chandra <pchandra@maprtech.com>
Authored: Thu Apr 30 11:20:35 2015 -0700
Committer: Parth Chandra <pchandra@maprtech.com>
Committed: Fri May 1 22:11:16 2015 -0700

----------------------------------------------------------------------
 .../src/main/java/org/apache/drill/exec/client/DrillClient.java   | 3 ++-
 .../main/java/org/apache/drill/jdbc/DrillConnectionConfig.java    | 2 +-
 .../src/main/java/org/apache/drill/jdbc/DrillConnectionImpl.java  | 2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/636177df/exec/java-exec/src/main/java/org/apache/drill/exec/client/DrillClient.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/client/DrillClient.java b/exec/java-exec/src/main/java/org/apache/drill/exec/client/DrillClient.java
index ae0f580..4576eb4 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/client/DrillClient.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/client/DrillClient.java
@@ -174,9 +174,10 @@ public class DrillClient implements Closeable, ConnectionThrottle {
     final DrillbitEndpoint endpoint;
     if (isDirectConnection) {
       String[] connectInfo = props.getProperty("drillbit").split(":");
+      String port = connectInfo.length==2?connectInfo[1]:config.getString(ExecConstants.INITIAL_USER_PORT);
       endpoint = DrillbitEndpoint.newBuilder()
               .setAddress(connectInfo[0])
-              .setUserPort(Integer.parseInt(connectInfo[1]))
+              .setUserPort(Integer.parseInt(port))
               .build();
     } else {
       if (ownsZkConnection) {

http://git-wip-us.apache.org/repos/asf/drill/blob/636177df/exec/jdbc/src/main/java/org/apache/drill/jdbc/DrillConnectionConfig.java
----------------------------------------------------------------------
diff --git a/exec/jdbc/src/main/java/org/apache/drill/jdbc/DrillConnectionConfig.java b/exec/jdbc/src/main/java/org/apache/drill/jdbc/DrillConnectionConfig.java
index e353c71..1be4bb1 100644
--- a/exec/jdbc/src/main/java/org/apache/drill/jdbc/DrillConnectionConfig.java
+++ b/exec/jdbc/src/main/java/org/apache/drill/jdbc/DrillConnectionConfig.java
@@ -37,7 +37,7 @@ public class DrillConnectionConfig extends ConnectionConfigImpl {
 
   // True if the URL points directly to a drillbit
   public boolean isDirect(){
-    return props.getProperty("local")!=null;
+    return props.getProperty("drillbit")!=null;
   }
 
   // TODO: Check: Shouldn't something validate that URL has "zk" parameter?

http://git-wip-us.apache.org/repos/asf/drill/blob/636177df/exec/jdbc/src/main/java/org/apache/drill/jdbc/DrillConnectionImpl.java
----------------------------------------------------------------------
diff --git a/exec/jdbc/src/main/java/org/apache/drill/jdbc/DrillConnectionImpl.java b/exec/jdbc/src/main/java/org/apache/drill/jdbc/DrillConnectionImpl.java
index 7c690d8..c73eb50 100644
--- a/exec/jdbc/src/main/java/org/apache/drill/jdbc/DrillConnectionImpl.java
+++ b/exec/jdbc/src/main/java/org/apache/drill/jdbc/DrillConnectionImpl.java
@@ -103,7 +103,7 @@ public abstract class DrillConnectionImpl extends AvaticaConnection
       } else if(config.isDirect()) {
         final DrillConfig dConfig = DrillConfig.forClient();
         this.allocator = new TopLevelAllocator(dConfig);
-        this.client = new DrillClient(true); // Get a direct connection
+        this.client = new DrillClient(dConfig, true); // Get a direct connection
         this.client.connect(config.getZookeeperConnectionString(), info);
       } else {
         final DrillConfig dConfig = DrillConfig.forClient();


Mime
View raw message