本文整理了Java中org.I0Itec.zkclient.ZkClient.createEphemeral()
方法的一些代码示例,展示了ZkClient.createEphemeral()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZkClient.createEphemeral()
方法的具体详情如下:
包路径:org.I0Itec.zkclient.ZkClient
类名称:ZkClient
方法名:createEphemeral
暂无
代码示例来源:origin: ltsopensource/light-task-scheduler
protected String createEphemeral(String path, Object data, boolean sequential) {
try {
if (sequential) {
return zkClient.createEphemeralSequential(path, data);
} else {
zkClient.createEphemeral(path, data);
return path;
}
} catch (ZkNodeExistsException ignored) {
}
return null;
}
代码示例来源:origin: crossoverJie/cim
/**
* 写入指定节点 临时目录
*
* @param path
* @param value
*/
public void createNode(String path, String value) {
zkClient.createEphemeral(path, value);
}
代码示例来源:origin: crossoverJie/cim
/**
* 写入指定节点 临时目录
*
* @param path
*/
public void createNode(String path) {
zkClient.createEphemeral(path);
}
代码示例来源:origin: ltsopensource/light-task-scheduler
protected String createEphemeral(String path, Object data, boolean sequential) {
try {
if (sequential) {
return zkClient.createEphemeralSequential(path, data);
} else {
zkClient.createEphemeral(path, data);
return path;
}
} catch (ZkNodeExistsException ignored) {
}
return null;
}
代码示例来源:origin: networknt/light-4j
@Override
public void createEphemeral(String path, Object data) throws ZkInterruptedException, IllegalArgumentException, ZkException, RuntimeException {
zkClient.createEphemeral(path, data);
}
代码示例来源:origin: ltsopensource/light-task-scheduler
protected String createEphemeral(String path, boolean sequential) {
try {
if (sequential) {
return zkClient.createEphemeralSequential(path, true);
} else {
zkClient.createEphemeral(path);
return path;
}
} catch (ZkNodeExistsException ignored) {
}
return null;
}
代码示例来源:origin: apache/incubator-dubbo
public void createEphemeral(String path, String data) {
Assert.notNull(client, new IllegalStateException("Zookeeper is not connected yet!"));
client.createEphemeral(path, data);
}
代码示例来源:origin: ltsopensource/light-task-scheduler
protected String createEphemeral(String path, boolean sequential) {
try {
if (sequential) {
return zkClient.createEphemeralSequential(path, true);
} else {
zkClient.createEphemeral(path);
return path;
}
} catch (ZkNodeExistsException ignored) {
}
return null;
}
代码示例来源:origin: apache/incubator-dubbo
public void createEphemeral(String path) {
Assert.notNull(client, new IllegalStateException("Zookeeper is not connected yet!"));
client.createEphemeral(path);
}
代码示例来源:origin: apache/incubator-dubbo
public void createEphemeral(String path, String data) {
Assert.notNull(client, new IllegalStateException("Zookeeper is not connected yet!"));
client.createEphemeral(path, data);
}
代码示例来源:origin: apache/incubator-dubbo
public void createEphemeral(String path) {
Assert.notNull(client, new IllegalStateException("Zookeeper is not connected yet!"));
client.createEphemeral(path);
}
代码示例来源:origin: killme2008/Metamorphosis
/**
* Create an ephemeral node with the given path and data. Create parents if
* necessary.
*/
public static void createEphemeralPath(final ZkClient client, final String path, final String data)
throws Exception {
try {
client.createEphemeral(path, data);
}
catch (final ZkNoNodeException e) {
createParentPath(client, path);
client.createEphemeral(path, data);
}
}
代码示例来源:origin: killme2008/Metamorphosis
/**
* Update the value of a persistent node with the given path and data.
* create parrent directory if necessary. Never throw NodeExistException.
*/
public static void updateEphemeralPath(final ZkClient client, final String path, final String data)
throws Exception {
try {
client.writeData(path, data);
}
catch (final ZkNoNodeException e) {
createParentPath(client, path);
client.createEphemeral(path, data);
}
catch (final Exception e) {
throw e;
}
}
代码示例来源:origin: weibocom/motan
private void createNode(URL url, ZkNodeType nodeType) {
String nodeTypePath = ZkUtils.toNodeTypePath(url, nodeType);
if (!zkClient.exists(nodeTypePath)) {
zkClient.createPersistent(nodeTypePath, true);
}
zkClient.createEphemeral(ZkUtils.toNodePath(url, nodeType), url.toFullStr());
}
代码示例来源:origin: javahongxi/whatsmars
public void createEphemeral(String path, String data) {
Assert.notNull(client, new IllegalStateException("Zookeeper is not connected yet!"));
client.createEphemeral(path, data);
}
代码示例来源:origin: javahongxi/whatsmars
public void createEphemeral(String path) {
Assert.notNull(client, new IllegalStateException("Zookeeper is not connected yet!"));
client.createEphemeral(path);
}
代码示例来源:origin: net.jahhan/dubbo-remoting-zookeeper
public void createEphemeral(String path) {
try {
client.createEphemeral(path);
} catch (ZkNodeExistsException e) {
}
}
代码示例来源:origin: jobxhub/JobX
public void createEphemeral(String path) {
try {
client.createEphemeral(path);
} catch (ZkNodeExistsException e) {
}
}
代码示例来源:origin: ezbz/projectx
@Override
public ZNode createEphemeral(final String path) {
zkClient.createEphemeral(path);
return new ZNodeImpl(path);
}
代码示例来源:origin: ezbz/projectx
@Override
public ZNode createEphemeral(final String path, final Object data) {
zkClient.createEphemeral(path, formatData(data));
return new ZNodeImpl(path, data);
}
内容来源于网络,如有侵权,请联系作者删除!