getZooKeeper().createExt(znode, null, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT, true);
} catch (KeeperException.NodeExistsException e) {
LOG.warn("Node exists: {}", znode);
if(getZooKeeper().exists(znode, false) == null) {
String znodeValue = InetAddress.getLocalHost().getHostName() + ":"
+ NettyMasterCoordinator.this.messageServerPort + ":" + 1;
getZooKeeper().createExt(znode, znodeValue.getBytes(Charset.forName("UTF-8")), Ids.OPEN_ACL_UNSAFE,
CreateMode.PERSISTENT, false);
LOG.info("Master znode initialization with server info {}", znodeValue);
} else {
String existZnodeValue = new String(getZooKeeper().getData(znode, null, null), Charset.forName("UTF-8"));
int version = NumberFormatUtils.getInt(existZnodeValue.split(":")[2], true);
String znodeValue = InetAddress.getLocalHost().getHostName() + ":"
+ NettyMasterCoordinator.this.messageServerPort + ":" + (version + 1);
getZooKeeper().createOrSetExt(znode, znodeValue.getBytes(Charset.forName("UTF-8")),
Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT, false, -1);
LOG.info("Master znode re-initialization with server info {}", znodeValue);