You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by vi...@apache.org on 2013/03/05 21:05:58 UTC
svn commit: r1452970 - in /accumulo/trunk: ./
test/src/main/java/org/apache/accumulo/test/randomwalk/Module.java
test/src/main/java/org/apache/accumulo/test/randomwalk/State.java
Author: vines
Date: Tue Mar 5 20:05:57 2013
New Revision: 1452970
URL: http://svn.apache.org/r1452970
Log:
ACCUMULO-1151 - Now dumping state.properties, dumping PasswordToken contents, and spitting out Connector.whoami()
Modified:
accumulo/trunk/ (props changed)
accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/Module.java
accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/State.java
Propchange: accumulo/trunk/
------------------------------------------------------------------------------
Merged /accumulo/branches/1.5:r1452947-1452968
Modified: accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/Module.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/Module.java?rev=1452970&r1=1452969&r2=1452970&view=diff
==============================================================================
--- accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/Module.java (original)
+++ accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/Module.java Tue Mar 5 20:05:57 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/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/State.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/State.java?rev=1452970&r1=1452969&r2=1452970&view=diff
==============================================================================
--- accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/State.java (original)
+++ accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/State.java Tue Mar 5 20:05:57 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);
}