hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject hbase git commit: HBASE-12781 thrift2 listen port will bind always to the passed command line address (Pankaj Kumar)
Date Tue, 30 Dec 2014 16:33:01 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1 6a7c619e1 -> bf94d6466


HBASE-12781 thrift2 listen port will bind always to the passed command line address (Pankaj
Kumar)


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

Branch: refs/heads/branch-1
Commit: bf94d64667fd5c5a98c39060fdec683252011658
Parents: 6a7c619
Author: tedyu <yuzhihong@gmail.com>
Authored: Tue Dec 30 08:32:56 2014 -0800
Committer: tedyu <yuzhihong@gmail.com>
Committed: Tue Dec 30 08:32:56 2014 -0800

----------------------------------------------------------------------
 .../org/apache/hadoop/hbase/thrift2/ThriftServer.java    | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/bf94d646/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/ThriftServer.java
----------------------------------------------------------------------
diff --git a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/ThriftServer.java
b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/ThriftServer.java
index 60f4763..72e9117 100644
--- a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/ThriftServer.java
+++ b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/ThriftServer.java
@@ -309,6 +309,15 @@ public class ThriftServer {
       System.exit(1);
     }
 
+    // Get address to bind
+    String bindAddress;
+    if (cmd.hasOption("bind")) {
+      bindAddress = cmd.getOptionValue("bind");
+      conf.set("hbase.thrift.info.bindAddress", bindAddress);
+    } else {
+      bindAddress = conf.get("hbase.thrift.info.bindAddress");
+    }
+
     // Get port to bind to
     int listenPort = 0;
     try {
@@ -387,7 +396,7 @@ public class ThriftServer {
         conf.getBoolean("hbase.regionserver.thrift.framed", false) || nonblocking || hsha;
     TTransportFactory transportFactory = getTTransportFactory(qop, name, host, framed,
         conf.getInt("hbase.regionserver.thrift.framed.max_frame_size_in_mb", 2) * 1024 *
1024);
-    InetSocketAddress inetSocketAddress = bindToPort(cmd.getOptionValue("bind"), listenPort);
+    InetSocketAddress inetSocketAddress = bindToPort(bindAddress, listenPort);
     conf.setBoolean("hbase.regionserver.thrift.framed", framed);
     if (qop != null) {
       // Create a processor wrapper, to get the caller


Mime
View raw message