accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vi...@apache.org
Subject svn commit: r1453576 - in /accumulo/branches/1.5: core/src/main/java/org/apache/accumulo/core/util/LoginProperties.java core/src/main/java/org/apache/accumulo/core/util/shell/Shell.java start/src/main/java/org/apache/accumulo/start/Main.java
Date Wed, 06 Mar 2013 21:26:24 GMT
Author: vines
Date: Wed Mar  6 21:26:24 2013
New Revision: 1453576

URL: http://svn.apache.org/r1453576
Log:
ACCUMULO-1157 - bin/accumulo login-info will now dump properties.
Also, undeprecated a private method in the shell


Added:
    accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/util/LoginProperties.java
  (with props)
Modified:
    accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/util/shell/Shell.java
    accumulo/branches/1.5/start/src/main/java/org/apache/accumulo/start/Main.java

Added: accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/util/LoginProperties.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/util/LoginProperties.java?rev=1453576&view=auto
==============================================================================
--- accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/util/LoginProperties.java
(added)
+++ accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/util/LoginProperties.java
Wed Mar  6 21:26:24 2013
@@ -0,0 +1,80 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.accumulo.core.util;
+
+import java.util.Set;
+import java.util.UUID;
+
+import org.apache.accumulo.core.cli.ClientOpts;
+import org.apache.accumulo.core.client.Instance;
+import org.apache.accumulo.core.client.ZooKeeperInstance;
+import org.apache.accumulo.core.conf.AccumuloConfiguration;
+import org.apache.accumulo.core.conf.Property;
+import org.apache.accumulo.core.security.handler.Authenticator;
+import org.apache.hadoop.fs.Path;
+
+/**
+ * 
+ */
+public class LoginProperties {
+  
+  /**
+   * @param args
+   */
+  public static void main(String[] args) {
+    ClientOpts opts = new ClientOpts();
+    opts.parseArgs(LoginProperties.class.getName(), args);
+    String indent = "    ";
+    
+    try {
+      String or = null;
+      System.out.println("Acceptable login properties are: ");
+      Instance instance;
+      if (opts.instance == null) {
+        @SuppressWarnings("deprecation")
+        AccumuloConfiguration deprecatedSiteConfiguration = AccumuloConfiguration.getSiteConfiguration();
+        instance = getDefaultInstance(deprecatedSiteConfiguration);
+      } else
+        instance = opts.getInstance();
+      for (Set<Authenticator.AuthProperty> set : instance.getAuthenticator().getProperties())
{
+        if (or == null)
+          or = "OR";
+        else
+          System.out.println(or);
+        String and = null;
+        for (Authenticator.AuthProperty ap : set) {
+          if (and == null)
+            and = indent + "AND";
+          else
+            System.out.println(and);
+          System.out.println(indent + ap);
+        }
+      }
+      
+    } catch (Exception e) {
+      throw new RuntimeException(e);
+    }
+  }
+  
+  @SuppressWarnings("deprecation")
+  private static Instance getDefaultInstance(AccumuloConfiguration conf) {
+    String keepers = conf.get(Property.INSTANCE_ZK_HOST);
+    Path instanceDir = new Path(conf.get(Property.INSTANCE_DFS_DIR), "instance_id");
+    return new ZooKeeperInstance(UUID.fromString(ZooKeeperInstance.getInstanceIDFromHdfs(instanceDir)),
keepers);
+  }
+  
+}

Propchange: accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/util/LoginProperties.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/util/shell/Shell.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/util/shell/Shell.java?rev=1453576&r1=1453575&r2=1453576&view=diff
==============================================================================
--- accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/util/shell/Shell.java
(original)
+++ accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/util/shell/Shell.java
Wed Mar  6 21:26:24 2013
@@ -362,10 +362,7 @@ public class Shell extends ShellOptions 
     }
   }
   
-  /**
-   * @deprecated Not for client use
-   */
-  @Deprecated
+  @SuppressWarnings("deprecation")
   private static Instance getDefaultInstance(AccumuloConfiguration conf) {
     String keepers = conf.get(Property.INSTANCE_ZK_HOST);
     Path instanceDir = new Path(conf.get(Property.INSTANCE_DFS_DIR), "instance_id");

Modified: accumulo/branches/1.5/start/src/main/java/org/apache/accumulo/start/Main.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/start/src/main/java/org/apache/accumulo/start/Main.java?rev=1453576&r1=1453575&r2=1453576&view=diff
==============================================================================
--- accumulo/branches/1.5/start/src/main/java/org/apache/accumulo/start/Main.java (original)
+++ accumulo/branches/1.5/start/src/main/java/org/apache/accumulo/start/Main.java Wed Mar
 6 21:26:24 2013
@@ -115,6 +115,6 @@ public class Main {
   }
   
   private static void printUsage() {
-    System.out.println("accumulo init | master | tserver | monitor | shell | admin | gc |
classpath | rfile-info | tracer | proxy | <accumulo class> args");
+    System.out.println("accumulo init | master | tserver | monitor | shell | admin | gc |
classpath | rfile-info | login-info | tracer | proxy | <accumulo class> args");
   }
 }



Mime
View raw message