private void createMyEphemeralNode() throws KeeperException { ZKUtil.createEphemeralNodeAndWatch(this.zooKeeper, getMyEphemeralNodePath(), FConstants.EMPTY_BYTE_ARRAY); }
/** * Set master address into the <code>master</code> znode or into the backup * subdirectory of backup masters; switch off the passed in <code>znode</code> * path. * * @param zkw * The ZooKeeperWatcher to use. * @param znode * Where to create the znode; could be at the top level or it could * be under backup masters * @param master * ServerName of the current master * @return true if node created, false if not; a watch is set in both cases * @throws org.apache.zookeeper.KeeperException */ public static boolean setMasterAddress(final ZooKeeperWatcher zkw, final String znode, final ServerName master) throws KeeperException { return ZKUtil.createEphemeralNodeAndWatch(zkw, znode, toByteArray(master)); }
if (!watchAndCheckExists(zkw, znode)) { return createEphemeralNodeAndWatch(zkw, znode, data);
entityGroup.getEntityGroupName(), serverName); String node = ZKAssign.getNodeName(zkw, entityGroup.getEncodedName()); if (!ZKUtil.createEphemeralNodeAndWatch(zkw, node, data.toByteArray())) { throw new IOException("Failed create of ephemeral " + node);