accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vi...@apache.org
Subject svn commit: r1452968 - in /accumulo/branches/1.5/test/src/main/java/org/apache/accumulo/test/randomwalk: Module.java State.java
Date Tue, 05 Mar 2013 20:05:23 GMT
Author: vines
Date: Tue Mar  5 20:05:23 2013
New Revision: 1452968

URL: http://svn.apache.org/r1452968
Log:
ACCUMULO-1151 - Now dumping state.properties, dumping PasswordToken contents, and spitting
out Connector.whoami()


Modified:
    accumulo/branches/1.5/test/src/main/java/org/apache/accumulo/test/randomwalk/Module.java
    accumulo/branches/1.5/test/src/main/java/org/apache/accumulo/test/randomwalk/State.java

Modified: accumulo/branches/1.5/test/src/main/java/org/apache/accumulo/test/randomwalk/Module.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/test/src/main/java/org/apache/accumulo/test/randomwalk/Module.java?rev=1452968&r1=1452967&r2=1452968&view=diff
==============================================================================
--- accumulo/branches/1.5/test/src/main/java/org/apache/accumulo/test/randomwalk/Module.java
(original)
+++ accumulo/branches/1.5/test/src/main/java/org/apache/accumulo/test/randomwalk/Module.java
Tue Mar  5 20:05:23 2013
@@ -33,6 +33,7 @@ import javax.xml.parsers.DocumentBuilder
 import javax.xml.validation.Schema;
 import javax.xml.validation.SchemaFactory;
 
+import org.apache.accumulo.core.client.security.tokens.PasswordToken;
 import org.apache.log4j.Level;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
@@ -252,14 +253,31 @@ public class Module extends Node {
         if (test)
           stopTimer(nextNode);
       } catch (Exception e) {
+        log.debug("Connector belongs to user: " + state.getConnector().whoami());
         log.debug("Properties for node: " + nextNodeId);
         for (Entry<Object,Object> entry : nodeProps.entrySet()) {
           log.debug("  " + entry.getKey() + ": " + entry.getValue());
         }
-        log.debug("State information: ");
+        log.debug("Overall Properties");
+        for (Entry<Object,Object> entry : state.getProperties().entrySet()) {
+          log.debug("  " + entry.getKey() + ": " + entry.getValue());
+        }
+        log.debug("State information");
         for (String key : new TreeSet<String>(state.getMap().keySet()))  {
           Object value = state.getMap().get(key);
-          log.debug("  " + key + ": " + value + ' ' + (value != null && ! (value
instanceof String)? ((value.getClass().equals(byte[].class))? new String((byte[]) value):value.getClass()
+ " - " + value):""));
+          String logMsg = "  " + key + ": " + value + ' ';
+          if (value == null)
+            logMsg += "null";
+          else if (value instanceof String)
+            logMsg += value;
+          else if (value instanceof byte[])
+            logMsg += new String((byte[])value);
+          else if (value instanceof PasswordToken)
+            logMsg += new String(((PasswordToken) value).getPassword());
+          else
+            logMsg += value.getClass()+ " - " + value;
+          
+          log.debug(logMsg);
         }
         throw new Exception("Error running node " + nextNodeId, e);
       }

Modified: accumulo/branches/1.5/test/src/main/java/org/apache/accumulo/test/randomwalk/State.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/test/src/main/java/org/apache/accumulo/test/randomwalk/State.java?rev=1452968&r1=1452967&r2=1452968&view=diff
==============================================================================
--- accumulo/branches/1.5/test/src/main/java/org/apache/accumulo/test/randomwalk/State.java
(original)
+++ accumulo/branches/1.5/test/src/main/java/org/apache/accumulo/test/randomwalk/State.java
Tue Mar  5 20:05:23 2013
@@ -82,6 +82,14 @@ public class State {
     return stateMap;
   }
   
+  /**
+   * 
+   * @return a copy of Properties, so accidental changes don't affect the framework
+   */
+  public Properties getProperties() {
+    return new Properties(props);
+  }
+  
   public String getString(String key) {
     return (String) stateMap.get(key);
   }



Mime
View raw message