- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.I0Itec.zkclient.ZkClient.writeDataReturnStat()
方法的一些代码示例,展示了ZkClient.writeDataReturnStat()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZkClient.writeDataReturnStat()
方法的具体详情如下:
包路径:org.I0Itec.zkclient.ZkClient
类名称:ZkClient
方法名:writeDataReturnStat
暂无
代码示例来源:origin: com.101tec/zkclient
public void writeData(final String path, Object datat, final int expectedVersion) {
writeDataReturnStat(path, datat, expectedVersion);
}
代码示例来源:origin: confluentinc/common
ConditionalUpdateCallback customConditionCallback) {
try {
Stat stat = client.writeDataReturnStat(path, data, expectedVersion);
log.debug(
"Conditional update of path %s with value %s and expected version %d succeeded, returning the new version: %d"
代码示例来源:origin: org.apache.samza/samza-core_2.11
/**
* publish the version number of the next JobModel
* @param oldVersion - used to validate, that no one has changed the version in the meanwhile.
* @param newVersion - new version.
*/
public void publishJobModelVersion(String oldVersion, String newVersion) {
Stat stat = new Stat();
String currentVersion = zkClient.readData(keyBuilder.getJobModelVersionPath(), stat);
metrics.reads.inc();
LOG.info("publishing new version: " + newVersion + "; oldVersion = " + oldVersion + "(" + stat
.getVersion() + ")");
if (currentVersion != null && !currentVersion.equals(oldVersion)) {
throw new SamzaException(
"Someone changed JobModelVersion while the leader was generating one: expected" + oldVersion + ", got " + currentVersion);
}
// data version is the ZK version of the data from the ZK.
int dataVersion = stat.getVersion();
try {
stat = zkClient.writeDataReturnStat(keyBuilder.getJobModelVersionPath(), newVersion, dataVersion);
metrics.writes.inc();
} catch (Exception e) {
String msg = "publish job model version failed for new version = " + newVersion + "; old version = " + oldVersion;
LOG.error(msg, e);
throw new SamzaException(msg, e);
}
LOG.info("published new version: " + newVersion + "; expected data version = " + (dataVersion + 1) +
"(actual data version after update = " + stat.getVersion() + ")");
}
代码示例来源:origin: org.apache.samza/samza-core_2.10
/**
* publish the version number of the next JobModel
* @param oldVersion - used to validate, that no one has changed the version in the meanwhile.
* @param newVersion - new version.
*/
public void publishJobModelVersion(String oldVersion, String newVersion) {
Stat stat = new Stat();
String currentVersion = zkClient.readData(keyBuilder.getJobModelVersionPath(), stat);
metrics.reads.inc();
LOG.info("publishing new version: " + newVersion + "; oldVersion = " + oldVersion + "(" + stat
.getVersion() + ")");
if (currentVersion != null && !currentVersion.equals(oldVersion)) {
throw new SamzaException(
"Someone changed JobModelVersion while the leader was generating one: expected" + oldVersion + ", got " + currentVersion);
}
// data version is the ZK version of the data from the ZK.
int dataVersion = stat.getVersion();
try {
stat = zkClient.writeDataReturnStat(keyBuilder.getJobModelVersionPath(), newVersion, dataVersion);
metrics.writes.inc();
} catch (Exception e) {
String msg = "publish job model version failed for new version = " + newVersion + "; old version = " + oldVersion;
LOG.error(msg, e);
throw new SamzaException(msg, e);
}
LOG.info("published new version: " + newVersion + "; expected data version = " + (dataVersion + 1) +
"(actual data version after update = " + stat.getVersion() + ")");
}
代码示例来源:origin: apache/samza
/**
* publish the version number of the next JobModel
* @param oldVersion - used to validate, that no one has changed the version in the meanwhile.
* @param newVersion - new version.
*/
public void publishJobModelVersion(String oldVersion, String newVersion) {
Stat stat = new Stat();
String currentVersion = zkClient.readData(keyBuilder.getJobModelVersionPath(), stat);
metrics.reads.inc();
LOG.info("publishing new version: " + newVersion + "; oldVersion = " + oldVersion + "(" + stat
.getVersion() + ")");
if (currentVersion != null && !currentVersion.equals(oldVersion)) {
throw new SamzaException(
"Someone changed JobModelVersion while the leader was generating one: expected" + oldVersion + ", got " + currentVersion);
}
// data version is the ZK version of the data from the ZK.
int dataVersion = stat.getVersion();
try {
stat = zkClient.writeDataReturnStat(keyBuilder.getJobModelVersionPath(), newVersion, dataVersion);
metrics.writes.inc();
} catch (Exception e) {
String msg = "publish job model version failed for new version = " + newVersion + "; old version = " + oldVersion;
LOG.error(msg, e);
throw new SamzaException(msg, e);
}
LOG.info("published new version: " + newVersion + "; expected data version = " + (dataVersion + 1) +
"(actual data version after update = " + stat.getVersion() + ")");
}
代码示例来源:origin: org.apache.samza/samza-core
/**
* publish the version number of the next JobModel
* @param oldVersion - used to validate, that no one has changed the version in the meanwhile.
* @param newVersion - new version.
*/
public void publishJobModelVersion(String oldVersion, String newVersion) {
Stat stat = new Stat();
String currentVersion = zkClient.readData(keyBuilder.getJobModelVersionPath(), stat);
metrics.reads.inc();
LOG.info("publishing new version: " + newVersion + "; oldVersion = " + oldVersion + "(" + stat
.getVersion() + ")");
if (currentVersion != null && !currentVersion.equals(oldVersion)) {
throw new SamzaException(
"Someone changed JobModelVersion while the leader was generating one: expected" + oldVersion + ", got " + currentVersion);
}
// data version is the ZK version of the data from the ZK.
int dataVersion = stat.getVersion();
try {
stat = zkClient.writeDataReturnStat(keyBuilder.getJobModelVersionPath(), newVersion, dataVersion);
metrics.writes.inc();
} catch (Exception e) {
String msg = "publish job model version failed for new version = " + newVersion + "; old version = " + oldVersion;
LOG.error(msg, e);
throw new SamzaException(msg, e);
}
LOG.info("published new version: " + newVersion + "; expected data version = " + (dataVersion + 1) +
"(actual data version after update = " + stat.getVersion() + ")");
}
代码示例来源:origin: org.apache.samza/samza-core_2.12
/**
* publish the version number of the next JobModel
* @param oldVersion - used to validate, that no one has changed the version in the meanwhile.
* @param newVersion - new version.
*/
public void publishJobModelVersion(String oldVersion, String newVersion) {
Stat stat = new Stat();
String currentVersion = zkClient.readData(keyBuilder.getJobModelVersionPath(), stat);
metrics.reads.inc();
LOG.info("publishing new version: " + newVersion + "; oldVersion = " + oldVersion + "(" + stat
.getVersion() + ")");
if (currentVersion != null && !currentVersion.equals(oldVersion)) {
throw new SamzaException(
"Someone changed JobModelVersion while the leader was generating one: expected" + oldVersion + ", got " + currentVersion);
}
// data version is the ZK version of the data from the ZK.
int dataVersion = stat.getVersion();
try {
stat = zkClient.writeDataReturnStat(keyBuilder.getJobModelVersionPath(), newVersion, dataVersion);
metrics.writes.inc();
} catch (Exception e) {
String msg = "publish job model version failed for new version = " + newVersion + "; old version = " + oldVersion;
LOG.error(msg, e);
throw new SamzaException(msg, e);
}
LOG.info("published new version: " + newVersion + "; expected data version = " + (dataVersion + 1) +
"(actual data version after update = " + stat.getVersion() + ")");
}
本文整理了Java中org.I0Itec.zkclient.ZkClient.fireDataChangedEvents()方法的一些代码示例,展示了ZkClient.fireDataChangedE
本文整理了Java中org.I0Itec.zkclient.ZkClient.fireAllEvents()方法的一些代码示例,展示了ZkClient.fireAllEvents()的具体用法。这些代
本文整理了Java中org.I0Itec.zkclient.ZkClient.serialize()方法的一些代码示例,展示了ZkClient.serialize()的具体用法。这些代码示例主要来源于
本文整理了Java中org.I0Itec.zkclient.ZkClient.fireStateChangedEvent()方法的一些代码示例,展示了ZkClient.fireStateChanged
本文整理了Java中org.I0Itec.zkclient.ZkClient.processStateChanged()方法的一些代码示例,展示了ZkClient.processStateChange
本文整理了Java中org.I0Itec.zkclient.ZkClient.getEventLock()方法的一些代码示例,展示了ZkClient.getEventLock()的具体用法。这些代码示
本文整理了Java中org.I0Itec.zkclient.ZkClient.waitForKeeperState()方法的一些代码示例,展示了ZkClient.waitForKeeperState(
本文整理了Java中org.I0Itec.zkclient.ZkClient.setShutdownTrigger()方法的一些代码示例,展示了ZkClient.setShutdownTrigger(
本文整理了Java中org.I0Itec.zkclient.ZkClient.fireNewSessionEvents()方法的一些代码示例,展示了ZkClient.fireNewSessionEve
本文整理了Java中org.I0Itec.zkclient.ZkClient.retryUntilConnected()方法的一些代码示例,展示了ZkClient.retryUntilConnecte
本文整理了Java中org.I0Itec.zkclient.ZkClient.watchForChilds()方法的一些代码示例,展示了ZkClient.watchForChilds()的具体用法。这
本文整理了Java中org.I0Itec.zkclient.ZkClient.create()方法的一些代码示例,展示了ZkClient.create()的具体用法。这些代码示例主要来源于Github
本文整理了Java中org.I0Itec.zkclient.ZkClient.unsubscribeAll()方法的一些代码示例,展示了ZkClient.unsubscribeAll()的具体用法。这
本文整理了Java中org.I0Itec.zkclient.ZkClient.hasListeners()方法的一些代码示例,展示了ZkClient.hasListeners()的具体用法。这些代码示
本文整理了Java中org.I0Itec.zkclient.ZkClient.writeDataReturnStat()方法的一些代码示例,展示了ZkClient.writeDataReturnSta
本文整理了Java中org.I0Itec.zkclient.ZkClient.setZkSerializer()方法的一些代码示例,展示了ZkClient.setZkSerializer()的具体用法
本文整理了Java中org.I0Itec.zkclient.ZkClient.waitUntilExists()方法的一些代码示例,展示了ZkClient.waitUntilExists()的具体用法
本文整理了Java中org.I0Itec.zkclient.ZkClient.fireChildChangedEvents()方法的一些代码示例,展示了ZkClient.fireChildChange
本文整理了Java中org.I0Itec.zkclient.ZkClient.setCurrentState()方法的一些代码示例,展示了ZkClient.setCurrentState()的具体用法
本文整理了Java中org.I0Itec.zkclient.ZkClient.getShutdownTrigger()方法的一些代码示例,展示了ZkClient.getShutdownTrigger(
我是一名优秀的程序员,十分优秀!