HBASE-12739 Avoid too large identifier of ZooKeeperWatcher (Liu Shaohui)
This commit is contained in:
parent
4880e5d83b
commit
2b090d6832
|
@ -56,6 +56,7 @@ public class ZooKeeperWatcher implements Watcher, Abortable, Closeable {
|
|||
|
||||
// Identifier for this watcher (for logging only). It is made of the prefix
|
||||
// passed on construction and the zookeeper sessionid.
|
||||
private String prefix;
|
||||
private String identifier;
|
||||
|
||||
// zookeeper quorum
|
||||
|
@ -154,9 +155,10 @@ public class ZooKeeperWatcher implements Watcher, Abortable, Closeable {
|
|||
this.constructorCaller = e;
|
||||
}
|
||||
this.quorum = ZKConfig.getZKQuorumServersString(conf);
|
||||
this.prefix = identifier;
|
||||
// Identifier will get the sessionid appended later below down when we
|
||||
// handle the syncconnect event.
|
||||
this.identifier = identifier;
|
||||
this.identifier = identifier + "0x0";
|
||||
this.abortable = abortable;
|
||||
setNodeNames(conf);
|
||||
this.recoverableZooKeeper = ZKUtil.connect(conf, quorum, this, identifier);
|
||||
|
@ -382,7 +384,7 @@ public class ZooKeeperWatcher implements Watcher, Abortable, Closeable {
|
|||
this.constructorCaller);
|
||||
throw new NullPointerException("ZK is null");
|
||||
}
|
||||
this.identifier = this.identifier + "-0x" +
|
||||
this.identifier = this.prefix + "-0x" +
|
||||
Long.toHexString(this.recoverableZooKeeper.getSessionId());
|
||||
// Update our identifier. Otherwise ignore.
|
||||
LOG.debug(this.identifier + " connected");
|
||||
|
|
Loading…
Reference in New Issue