From 72eacc89f33d3dd91242f73d2c326ac6273b08ea Mon Sep 17 00:00:00 2001 From: jeffreyz Date: Thu, 15 Aug 2013 18:25:21 +0000 Subject: [PATCH] hbase-9226: Thrift host and port are hardcoded in thrift2 DemoClient.java git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1514425 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/hadoop/hbase/thrift2/DemoClient.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/hbase-examples/src/main/java/org/apache/hadoop/hbase/thrift2/DemoClient.java b/hbase-examples/src/main/java/org/apache/hadoop/hbase/thrift2/DemoClient.java index 1c7524dccd7..a1a96329221 100644 --- a/hbase-examples/src/main/java/org/apache/hadoop/hbase/thrift2/DemoClient.java +++ b/hbase-examples/src/main/java/org/apache/hadoop/hbase/thrift2/DemoClient.java @@ -38,10 +38,20 @@ import org.apache.thrift.transport.TTransport; 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;