accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject [2/3] accumulo git commit: ACCUMULO-3945 Use provided zookeeper hosts for tracing when present.
Date Sun, 26 Jul 2015 23:48:12 GMT
ACCUMULO-3945 Use provided zookeeper hosts for tracing when present.


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

Branch: refs/heads/master
Commit: 3622556517432540b0ff90997c9e1d4ee3474e6e
Parents: 069d198
Author: Josh Elser <elserj@apache.org>
Authored: Sun Jul 26 19:47:11 2015 -0400
Committer: Josh Elser <elserj@apache.org>
Committed: Sun Jul 26 19:47:11 2015 -0400

----------------------------------------------------------------------
 .../org/apache/accumulo/shell/ShellOptionsJC.java  |  5 +++++
 .../apache/accumulo/shell/ShellOptionsJCTest.java  | 17 ++++++++++++++---
 2 files changed, 19 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/36225565/shell/src/main/java/org/apache/accumulo/shell/ShellOptionsJC.java
----------------------------------------------------------------------
diff --git a/shell/src/main/java/org/apache/accumulo/shell/ShellOptionsJC.java b/shell/src/main/java/org/apache/accumulo/shell/ShellOptionsJC.java
index 92ea1a5..01b7ce3 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/ShellOptionsJC.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/ShellOptionsJC.java
@@ -315,6 +315,11 @@ public class ShellOptionsJC {
       clientConfig.withZkHosts(siteConf.get(Property.INSTANCE_ZK_HOST));
     }
 
+    // If the user provided the hosts, set the ZK for tracing too
+    if (null != zooKeeperHosts) {
+      clientConfig.setProperty(ClientProperty.INSTANCE_ZK_HOST, zooKeeperHosts);
+    }
+
     return clientConfig;
   }
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/36225565/shell/src/test/java/org/apache/accumulo/shell/ShellOptionsJCTest.java
----------------------------------------------------------------------
diff --git a/shell/src/test/java/org/apache/accumulo/shell/ShellOptionsJCTest.java b/shell/src/test/java/org/apache/accumulo/shell/ShellOptionsJCTest.java
index 0c4e4c7..f8d74ef 100644
--- a/shell/src/test/java/org/apache/accumulo/shell/ShellOptionsJCTest.java
+++ b/shell/src/test/java/org/apache/accumulo/shell/ShellOptionsJCTest.java
@@ -25,9 +25,6 @@ import org.junit.Test;
 
 import com.beust.jcommander.JCommander;
 
-/**
- *
- */
 public class ShellOptionsJCTest {
 
   ShellOptionsJC options;
@@ -48,4 +45,18 @@ public class ShellOptionsJCTest {
     assertEquals("true", clientConf.get(ClientProperty.INSTANCE_RPC_SASL_ENABLED));
   }
 
+  @Test
+  public void testTraceHosts() throws Exception {
+    // Set the zk hosts in the client conf directly for tracing
+    final String zk = "localhost:45454";
+    JCommander jc = new JCommander();
+
+    jc.setProgramName("accumulo shell");
+    jc.addObject(options);
+    jc.parse(new String[] {"-zh", zk});
+    ClientConfiguration clientConf = options.getClientConfiguration();
+
+    assertEquals(zk, clientConf.get(ClientProperty.INSTANCE_ZK_HOST));
+  }
+
 }


Mime
View raw message