accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vi...@apache.org
Subject svn commit: r1453623 - in /accumulo/branches/1.5: conf/examples/1GB/native-standalone/ conf/examples/1GB/standalone/ conf/examples/2GB/native-standalone/ conf/examples/2GB/standalone/ conf/examples/3GB/native-standalone/ conf/examples/3GB/standalone/ c...
Date Wed, 06 Mar 2013 23:55:56 GMT
Author: vines
Date: Wed Mar  6 23:55:55 2013
New Revision: 1453623

URL: http://svn.apache.org/r1453623
Log:
ACCUMULO-1156 - a good start on killing use of deprecated code


Modified:
    accumulo/branches/1.5/conf/examples/1GB/native-standalone/accumulo-site.xml
    accumulo/branches/1.5/conf/examples/1GB/standalone/accumulo-site.xml
    accumulo/branches/1.5/conf/examples/2GB/native-standalone/accumulo-site.xml
    accumulo/branches/1.5/conf/examples/2GB/standalone/accumulo-site.xml
    accumulo/branches/1.5/conf/examples/3GB/native-standalone/accumulo-site.xml
    accumulo/branches/1.5/conf/examples/3GB/standalone/accumulo-site.xml
    accumulo/branches/1.5/conf/examples/512MB/native-standalone/accumulo-site.xml
    accumulo/branches/1.5/conf/examples/512MB/standalone/accumulo-site.xml
    accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/conf/Property.java
    accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/conf/PropertyType.java
    accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/monitor/servlets/trace/Basic.java

Modified: accumulo/branches/1.5/conf/examples/1GB/native-standalone/accumulo-site.xml
URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/conf/examples/1GB/native-standalone/accumulo-site.xml?rev=1453623&r1=1453622&r2=1453623&view=diff
==============================================================================
--- accumulo/branches/1.5/conf/examples/1GB/native-standalone/accumulo-site.xml (original)
+++ accumulo/branches/1.5/conf/examples/1GB/native-standalone/accumulo-site.xml Wed Mar  6
23:55:55 2013
@@ -59,13 +59,13 @@
   </property>
 
   <property>
-    <name>trace.password</name>
+    <name>trace.login.password</name>
     <!-- change this to the root user's password, and/or change the user below -->
-    <value>secret</value>
+    <value>password=secret</value>
   </property>
 
   <property>
-    <name>trace.user</name>
+    <name>trace.principal</name>
     <value>root</value>
   </property>
 

Modified: accumulo/branches/1.5/conf/examples/1GB/standalone/accumulo-site.xml
URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/conf/examples/1GB/standalone/accumulo-site.xml?rev=1453623&r1=1453622&r2=1453623&view=diff
==============================================================================
--- accumulo/branches/1.5/conf/examples/1GB/standalone/accumulo-site.xml (original)
+++ accumulo/branches/1.5/conf/examples/1GB/standalone/accumulo-site.xml Wed Mar  6 23:55:55
2013
@@ -59,13 +59,13 @@
   </property>
 
   <property>
-    <name>trace.password</name>
+    <name>trace.login.password</name>
     <!-- change this to the root user's password, and/or change the user below -->
-    <value>secret</value>
+    <value>password=secret</value>
   </property>
 
   <property>
-    <name>trace.user</name>
+    <name>trace.principal</name>
     <value>root</value>
   </property>
 

Modified: accumulo/branches/1.5/conf/examples/2GB/native-standalone/accumulo-site.xml
URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/conf/examples/2GB/native-standalone/accumulo-site.xml?rev=1453623&r1=1453622&r2=1453623&view=diff
==============================================================================
--- accumulo/branches/1.5/conf/examples/2GB/native-standalone/accumulo-site.xml (original)
+++ accumulo/branches/1.5/conf/examples/2GB/native-standalone/accumulo-site.xml Wed Mar  6
23:55:55 2013
@@ -59,13 +59,13 @@
   </property>
 
   <property>
-    <name>trace.password</name>
+    <name>trace.login.password</name>
     <!-- change this to the root user's password, and/or change the user below -->
-    <value>secret</value>
+    <value>password=secret</value>
   </property>
 
   <property>
-    <name>trace.user</name>
+    <name>trace.principal</name>
     <value>root</value>
   </property>
 

Modified: accumulo/branches/1.5/conf/examples/2GB/standalone/accumulo-site.xml
URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/conf/examples/2GB/standalone/accumulo-site.xml?rev=1453623&r1=1453622&r2=1453623&view=diff
==============================================================================
--- accumulo/branches/1.5/conf/examples/2GB/standalone/accumulo-site.xml (original)
+++ accumulo/branches/1.5/conf/examples/2GB/standalone/accumulo-site.xml Wed Mar  6 23:55:55
2013
@@ -65,15 +65,15 @@
     </property>
     
     <property>
-      <name>trace.password</name>
+      <name>trace.login.password</name>
       <!-- 
         change this to the root user's password, and/or change the user below 
        -->
-      <value>secret</value>
+      <value>password=secret</value>
     </property>
     
     <property>
-      <name>trace.user</name>
+      <name>trace.principal</name>
       <value>root</value>
     </property>
     

Modified: accumulo/branches/1.5/conf/examples/3GB/native-standalone/accumulo-site.xml
URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/conf/examples/3GB/native-standalone/accumulo-site.xml?rev=1453623&r1=1453622&r2=1453623&view=diff
==============================================================================
--- accumulo/branches/1.5/conf/examples/3GB/native-standalone/accumulo-site.xml (original)
+++ accumulo/branches/1.5/conf/examples/3GB/native-standalone/accumulo-site.xml Wed Mar  6
23:55:55 2013
@@ -59,13 +59,13 @@
   </property>
 
   <property>
-    <name>trace.password</name>
+    <name>trace.login.password</name>
     <!-- change this to the root user's password, and/or change the user below -->
-    <value>secret</value>
+    <value>password=secret</value>
   </property>
 
   <property>
-    <name>trace.user</name>
+    <name>trace.principal</name>
     <value>root</value>
   </property>
 

Modified: accumulo/branches/1.5/conf/examples/3GB/standalone/accumulo-site.xml
URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/conf/examples/3GB/standalone/accumulo-site.xml?rev=1453623&r1=1453622&r2=1453623&view=diff
==============================================================================
--- accumulo/branches/1.5/conf/examples/3GB/standalone/accumulo-site.xml (original)
+++ accumulo/branches/1.5/conf/examples/3GB/standalone/accumulo-site.xml Wed Mar  6 23:55:55
2013
@@ -59,13 +59,13 @@
   </property>
 
   <property>
-    <name>trace.password</name>
+    <name>trace.login.password</name>
     <!-- change this to the root user's password, and/or change the user below -->
-    <value>secret</value>
+    <value>password=secret</value>
   </property>
 
   <property>
-    <name>trace.user</name>
+    <name>trace.principal</name>
     <value>root</value>
   </property>
 

Modified: accumulo/branches/1.5/conf/examples/512MB/native-standalone/accumulo-site.xml
URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/conf/examples/512MB/native-standalone/accumulo-site.xml?rev=1453623&r1=1453622&r2=1453623&view=diff
==============================================================================
--- accumulo/branches/1.5/conf/examples/512MB/native-standalone/accumulo-site.xml (original)
+++ accumulo/branches/1.5/conf/examples/512MB/native-standalone/accumulo-site.xml Wed Mar
 6 23:55:55 2013
@@ -59,13 +59,13 @@
   </property>
 
   <property>
-    <name>trace.password</name>
+    <name>trace.login.password</name>
     <!-- change this to the root user's password, and/or change the user below -->
-    <value>secret</value>
+    <value>password=secret</value>
   </property>
 
   <property>
-    <name>trace.user</name>
+    <name>trace.principal</name>
     <value>root</value>
   </property>
 

Modified: accumulo/branches/1.5/conf/examples/512MB/standalone/accumulo-site.xml
URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/conf/examples/512MB/standalone/accumulo-site.xml?rev=1453623&r1=1453622&r2=1453623&view=diff
==============================================================================
--- accumulo/branches/1.5/conf/examples/512MB/standalone/accumulo-site.xml (original)
+++ accumulo/branches/1.5/conf/examples/512MB/standalone/accumulo-site.xml Wed Mar  6 23:55:55
2013
@@ -65,13 +65,13 @@
   </property>
 
   <property>
-    <name>trace.password</name>
+    <name>trace.login.password</name>
     <!-- change this to the root user's password, and/or change the user below -->
-    <value>secret</value>
+    <value>password=secret</value>
   </property>
 
   <property>
-    <name>trace.user</name>
+    <name>trace.principal</name>
     <value>root</value>
   </property>
 

Modified: accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/conf/Property.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/conf/Property.java?rev=1453623&r1=1453622&r2=1453623&view=diff
==============================================================================
--- accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/conf/Property.java (original)
+++ accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/conf/Property.java Wed
Mar  6 23:55:55 2013
@@ -224,8 +224,12 @@ public enum Property {
   TRACE_PREFIX("trace.", null, PropertyType.PREFIX, "Properties in this category affect the
behavior of distributed tracing."),
   TRACE_PORT("trace.port.client", "12234", PropertyType.PORT, "The listening port for the
trace server"),
   TRACE_TABLE("trace.table", "trace", PropertyType.STRING, "The name of the table to store
distributed traces"),
+  @Deprecated
   TRACE_USER("trace.user", "root", PropertyType.STRING, "The name of the user to store distributed
traces"),
+  TRACE_PRINCIPAL("trace.principal", "root", PropertyType.STRING, "The principal to store
distributed traces"),
+  @Deprecated
   TRACE_PASSWORD("trace.password", "secret", PropertyType.STRING, "The password for the user
used to store distributed traces"),
+  TRACE_LOGIN_PROPERTIES("trace.login", null, PropertyType.PREFIX, "The login credentials
prefix for the principal used to store distributed traces"),
   
   // per table properties
   TABLE_PREFIX("table.", null, PropertyType.PREFIX, "Properties in this category affect tablet
server treatment of tablets, but can be configured "

Modified: accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/conf/PropertyType.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/conf/PropertyType.java?rev=1453623&r1=1453622&r2=1453623&view=diff
==============================================================================
--- accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/conf/PropertyType.java
(original)
+++ accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/conf/PropertyType.java
Wed Mar  6 23:55:55 2013
@@ -57,7 +57,7 @@ public enum PropertyType {
       return new Path(value).isAbsolute();
     }
   },
-
+  
   CLASSNAME("java class", "[\\w$.]*", "A fully qualified java class name representing a class
on the classpath.<br />"
       + "An example is 'java.lang.String', rather than 'String'"),
   

Modified: accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/monitor/servlets/trace/Basic.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/monitor/servlets/trace/Basic.java?rev=1453623&r1=1453622&r2=1453623&view=diff
==============================================================================
--- accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/monitor/servlets/trace/Basic.java
(original)
+++ accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/monitor/servlets/trace/Basic.java
Wed Mar  6 23:55:55 2013
@@ -17,6 +17,8 @@
 package org.apache.accumulo.server.monitor.servlets.trace;
 
 import java.util.Date;
+import java.util.Map;
+import java.util.Properties;
 
 import javax.servlet.http.HttpServletRequest;
 
@@ -25,6 +27,8 @@ import org.apache.accumulo.core.client.A
 import org.apache.accumulo.core.client.Connector;
 import org.apache.accumulo.core.client.Scanner;
 import org.apache.accumulo.core.client.TableNotFoundException;
+import org.apache.accumulo.core.client.security.tokens.AuthenticationToken;
+import org.apache.accumulo.core.client.security.tokens.PasswordToken;
 import org.apache.accumulo.core.conf.AccumuloConfiguration;
 import org.apache.accumulo.core.conf.Property;
 import org.apache.accumulo.core.trace.TraceFormatter;
@@ -61,17 +65,28 @@ abstract class Basic extends BasicServle
     return TraceFormatter.formatDate(new Date(millis));
   }
   
-  protected Scanner getScanner(StringBuilder sb) throws AccumuloException {
+  protected Scanner getScanner(StringBuilder sb) throws AccumuloException, AccumuloSecurityException
{
     AccumuloConfiguration conf = Monitor.getSystemConfiguration();
-    String user = conf.get(Property.TRACE_USER);
-    byte[] passwd = conf.get(Property.TRACE_PASSWORD).getBytes();
+    String principal = conf.get(Property.TRACE_PRINCIPAL);
+    if (principal == null)
+      principal = conf.get(Property.TRACE_USER);
+    AuthenticationToken at;
+    Map<String, String> loginMap = conf.getAllPropertiesWithPrefix(Property.TRACE_LOGIN_PROPERTIES);
+    if (loginMap == null)
+      at = new PasswordToken(conf.get(Property.TRACE_PASSWORD).getBytes());
+    else{
+      Properties props = new Properties();
+      props.putAll(loginMap);
+      at = HdfsZooInstance.getInstance().getAuthenticator().login(props);
+    }
+    
     String table = conf.get(Property.TRACE_TABLE);
     try {
-      Connector conn = HdfsZooInstance.getInstance().getConnector(user, passwd);
+      Connector conn = HdfsZooInstance.getInstance().getConnector(principal, at);
       if (!conn.tableOperations().exists(table)) {
         return new NullScanner();
       }
-      Scanner scanner = conn.createScanner(table, conn.securityOperations().getUserAuthorizations(user));
+      Scanner scanner = conn.createScanner(table, conn.securityOperations().getUserAuthorizations(principal));
       return scanner;
     } catch (AccumuloSecurityException ex) {
       sb.append("<h2>Unable to read trace table: check trace username and password
configuration.</h2>\n");



Mime
View raw message