This is an automated email from the ASF dual-hosted git repository.

domgarguilo pushed a commit to branch 2.1
in repository https://gitbox.apache.org/repos/asf/accumulo-testing.git


The following commit(s) were added to refs/heads/2.1 by this push:
     new 0a364eb  Correctly render Text output in randomwalk debug message 
(#300)
0a364eb is described below

commit 0a364eb2347775b2f8b7cd36408b3dc1faf9f2aa
Author: Dom G. <[email protected]>
AuthorDate: Wed Oct 22 12:03:21 2025 -0400

    Correctly render Text output in randomwalk debug message (#300)
    
    Add a case to the randomwalk debug state output to correctly render Text 
objects
---
 src/main/java/org/apache/accumulo/testing/randomwalk/Module.java | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/accumulo/testing/randomwalk/Module.java 
b/src/main/java/org/apache/accumulo/testing/randomwalk/Module.java
index aec30a3..9b5c2e5 100644
--- a/src/main/java/org/apache/accumulo/testing/randomwalk/Module.java
+++ b/src/main/java/org/apache/accumulo/testing/randomwalk/Module.java
@@ -43,7 +43,9 @@ import javax.xml.validation.Schema;
 import javax.xml.validation.SchemaFactory;
 
 import org.apache.accumulo.core.client.security.tokens.PasswordToken;
+import org.apache.accumulo.core.data.Key;
 import org.apache.accumulo.core.util.threads.ThreadPools;
+import org.apache.hadoop.io.Text;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.w3c.dom.Document;
@@ -352,7 +354,11 @@ public class Module extends Node {
               logMsg += value;
             else if (value instanceof byte[])
               logMsg += new String((byte[]) value, UTF_8);
-            else if (value instanceof PasswordToken)
+            else if (value instanceof Text) {
+              Text text = (Text) value;
+              logMsg +=
+                  Key.toPrintableString(text.getBytes(), 0, text.getLength(), 
text.getLength());
+            } else if (value instanceof PasswordToken)
               logMsg += new String(((PasswordToken) value).getPassword(), 
UTF_8);
             else
               logMsg += value.getClass() + " - " + value;

Reply via email to