hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jeffr...@apache.org
Subject svn commit: r1514425 - /hbase/trunk/hbase-examples/src/main/java/org/apache/hadoop/hbase/thrift2/DemoClient.java
Date Thu, 15 Aug 2013 18:25:21 GMT
Author: jeffreyz
Date: Thu Aug 15 18:25:21 2013
New Revision: 1514425

URL: http://svn.apache.org/r1514425
Log:
hbase-9226: Thrift host and port are hardcoded in thrift2 DemoClient.java

Modified:
    hbase/trunk/hbase-examples/src/main/java/org/apache/hadoop/hbase/thrift2/DemoClient.java

Modified: hbase/trunk/hbase-examples/src/main/java/org/apache/hadoop/hbase/thrift2/DemoClient.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-examples/src/main/java/org/apache/hadoop/hbase/thrift2/DemoClient.java?rev=1514425&r1=1514424&r2=1514425&view=diff
==============================================================================
--- hbase/trunk/hbase-examples/src/main/java/org/apache/hadoop/hbase/thrift2/DemoClient.java
(original)
+++ hbase/trunk/hbase-examples/src/main/java/org/apache/hadoop/hbase/thrift2/DemoClient.java
Thu Aug 15 18:25:21 2013
@@ -38,10 +38,20 @@ import org.apache.thrift.transport.TTran
 public class DemoClient {
   public static void main(String[] args) throws TIOError, TException {
     System.out.println("Thrift2 Demo");
+    System.out.println("Usage: DemoClient [host=localhost] [port=9090]");
     System.out.println("This demo assumes you have a table called \"example\" with a column
family called \"family1\"");
     
     String host = "localhost";
     int port = 9090;
+
+    // use passed in arguments instead of defaults
+    if (args.length >= 1) {
+      host = args[0];
+    }
+    if (args.length >= 2) {
+      port = Integer.parseInt(args[1]);
+    }
+
     int timeout = 10000;
     boolean framed = false;
 



Mime
View raw message