Closed HotSince91 closed 1 year ago
Zookeeper officially log , display or name zxid as hex string,so I format zxid related fields (exactly ephermalOwner, mZxid, pZxid, cZxid) to hex using source code from zookeeper (org.apache.zookeeper.cli.StatPrinter::print()) in the node info view.
package org.apache.zookeeper.cli; import java.io.PrintStream; import java.util.Date; import org.apache.zookeeper.data.Stat; /** * utility for printing stat values s */ public class StatPrinter { protected PrintStream out; public StatPrinter(PrintStream out) { this.out = out; } public void print(Stat stat) { out.println("cZxid = 0x" + Long.toHexString(stat.getCzxid())); out.println("ctime = " + new Date(stat.getCtime()).toString()); out.println("mZxid = 0x" + Long.toHexString(stat.getMzxid())); out.println("mtime = " + new Date(stat.getMtime()).toString()); out.println("pZxid = 0x" + Long.toHexString(stat.getPzxid())); out.println("cversion = " + stat.getCversion()); out.println("dataVersion = " + stat.getVersion()); out.println("aclVersion = " + stat.getAversion()); out.println("ephemeralOwner = 0x" + Long.toHexString(stat.getEphemeralOwner())); out.println("dataLength = " + stat.getDataLength()); out.println("numChildren = " + stat.getNumChildren()); } }
For backward compatiblility, these fields can also be switched back to long value when click on coodinate labels like ctime label do.
thx for your contribution, you need to fixed the code checkstyle before merge it @HotSince91
thx again
Zookeeper officially log , display or name zxid as hex string,so I format zxid related fields (exactly ephermalOwner, mZxid, pZxid, cZxid) to hex using source code from zookeeper (org.apache.zookeeper.cli.StatPrinter::print()) in the node info view.
For backward compatiblility, these fields can also be switched back to long value when click on coodinate labels like ctime label do.