accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r1187527 - /incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/util/CleanZookeeper.java
Date Fri, 21 Oct 2011 19:43:42 GMT
Author: ecn
Date: Fri Oct 21 19:43:41 2011
New Revision: 1187527

URL: http://svn.apache.org/viewvc?rev=1187527&view=rev
Log:
ACCUMULO-60: allow users to provide additional digest auth to clean up old entries in zookeeper

Modified:
    incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/util/CleanZookeeper.java

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/util/CleanZookeeper.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/util/CleanZookeeper.java?rev=1187527&r1=1187526&r2=1187527&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/util/CleanZookeeper.java
(original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/util/CleanZookeeper.java
Fri Oct 21 19:43:41 2011
@@ -31,17 +31,22 @@ public class CleanZookeeper {
   
   /**
    * @param args
-   *          should contain one element: the address of a zookeeper node
+   *          must contain one element: the address of a zookeeper node
+   *          a second parameter provides an additional authentication value
    * @throws IOException
    *           error connecting to accumulo or zookeeper
    */
   public static void main(String[] args) throws IOException {
     if (args.length < 1) {
-      System.err.println("Usage: " + CleanZookeeper.class.getName() + " hostname[:port]");
+      System.err.println("Usage: " + CleanZookeeper.class.getName() + " hostname[:port] [auth]");
       System.exit(1);
     }
     String root = Constants.ZROOT;
     ZooReaderWriter zk = ZooReaderWriter.getInstance();
+    if (args.length == 2) {
+      zk.getZooKeeper().addAuthInfo("digest", args[1].getBytes());
+    }
+    
     try {
       for (String child : zk.getChildren(root)) {
         if (Constants.ZINSTANCES.equals("/" + child)) {



Mime
View raw message