EdColeman commented on a change in pull request #2324:
URL: https://github.com/apache/accumulo/pull/2324#discussion_r735990065
##########
File path: core/src/main/java/org/apache/accumulo/fate/zookeeper/ZooUtil.java
##########
@@ -121,4 +131,33 @@ public static void recursiveDelete(ZooKeeper zooKeeper,
String zPath, NodeMissin
}
}
+ /**
+ * For debug: print the ZooKeeper Stat with value labels for a more user
friendly string. The
+ * format matches the zookeeper cli stat command.
+ *
+ * @param stat
+ * Zookeeper Stat structure
+ * @return a formatted string.
+ */
+ public static String printStat(final Stat stat) {
+
+ if (Objects.isNull(stat)) {
+ return "null";
+ }
+
+ return "\ncZxid = " + String.format("0x%x", stat.getCzxid()) + "\nctime = "
Review comment:
For whatever reason, my ide likes to provide the option to convert
StringBuilder to concatenation. I think this is because under the hood, it does
use StringBuilder anyway so its a matter of readability preference. In this
case I think it does make it easier to read the code - this is a debug /
troubleshooting utility and is inefficient is other ways (String.format) but
the end goal was to make it easy to visually compare with the ZooKeeper output.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]