You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@drill.apache.org by pa...@apache.org on 2016/11/23 23:42:10 UTC
[2/5] drill git commit: DRILL-4979: Make port of the DataConnection
configurable
DRILL-4979: Make port of the DataConnection configurable
This closes #649
Project: http://git-wip-us.apache.org/repos/asf/drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/drill/commit/2de3a27c
Tree: http://git-wip-us.apache.org/repos/asf/drill/tree/2de3a27c
Diff: http://git-wip-us.apache.org/repos/asf/drill/diff/2de3a27c
Branch: refs/heads/master
Commit: 2de3a27c3440429d9bf852b6595542ce2bd0fd1b
Parents: 1c23173
Author: Korn, Uwe <Uw...@blue-yonder.com>
Authored: Wed Nov 9 13:02:20 2016 +0100
Committer: Parth Chandra <pa...@apache.org>
Committed: Mon Nov 21 17:38:33 2016 -0800
----------------------------------------------------------------------
.../src/main/java/org/apache/drill/exec/ExecConstants.java | 1 +
.../org/apache/drill/exec/rpc/data/DataConnectionCreator.java | 7 ++++++-
2 files changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/drill/blob/2de3a27c/exec/java-exec/src/main/java/org/apache/drill/exec/ExecConstants.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/ExecConstants.java b/exec/java-exec/src/main/java/org/apache/drill/exec/ExecConstants.java
index 5f62781..bb451c9 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/ExecConstants.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/ExecConstants.java
@@ -44,6 +44,7 @@ public interface ExecConstants {
String BIT_TIMEOUT = "drill.exec.bit.timeout" ;
String SERVICE_NAME = "drill.exec.cluster-id";
String INITIAL_BIT_PORT = "drill.exec.rpc.bit.server.port";
+ String INITIAL_DATA_PORT = "drill.exec.rpc.bit.server.dataport";
String BIT_RPC_TIMEOUT = "drill.exec.rpc.bit.timeout";
String INITIAL_USER_PORT = "drill.exec.rpc.user.server.port";
String USER_RPC_TIMEOUT = "drill.exec.rpc.user.timeout";
http://git-wip-us.apache.org/repos/asf/drill/blob/2de3a27c/exec/java-exec/src/main/java/org/apache/drill/exec/rpc/data/DataConnectionCreator.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/rpc/data/DataConnectionCreator.java b/exec/java-exec/src/main/java/org/apache/drill/exec/rpc/data/DataConnectionCreator.java
index a90d356..5c71b91 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/rpc/data/DataConnectionCreator.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/rpc/data/DataConnectionCreator.java
@@ -20,6 +20,7 @@ package org.apache.drill.exec.rpc.data;
import java.util.concurrent.ConcurrentMap;
import org.apache.drill.common.AutoCloseables;
+import org.apache.drill.exec.ExecConstants;
import org.apache.drill.exec.exception.DrillbitStartupException;
import org.apache.drill.exec.memory.BufferAllocator;
import org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint;
@@ -59,7 +60,11 @@ public class DataConnectionCreator implements AutoCloseable {
public DrillbitEndpoint start(DrillbitEndpoint partialEndpoint) throws DrillbitStartupException {
server = new DataServer(context, dataAllocator, workBus, bee);
- int port = server.bind(partialEndpoint.getControlPort() + 1, allowPortHunting);
+ int port = partialEndpoint.getControlPort() + 1;
+ if (context.getConfig().hasPath(ExecConstants.INITIAL_DATA_PORT)) {
+ port = context.getConfig().getInt(ExecConstants.INITIAL_DATA_PORT);
+ }
+ port = server.bind(port, allowPortHunting);
DrillbitEndpoint completeEndpoint = partialEndpoint.toBuilder().setDataPort(port).build();
return completeEndpoint;
}