- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.I0Itec.zkclient.ZkClient.subscribeDataChanges()
方法的一些代码示例,展示了ZkClient.subscribeDataChanges()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZkClient.subscribeDataChanges()
方法的具体详情如下:
包路径:org.I0Itec.zkclient.ZkClient
类名称:ZkClient
方法名:subscribeDataChanges
暂无
代码示例来源:origin: ltsopensource/light-task-scheduler
protected void addTargetDataListener(String path, IZkDataListener listener) {
zkClient.subscribeDataChanges(path, listener);
}
代码示例来源:origin: ltsopensource/light-task-scheduler
protected void addTargetDataListener(String path, IZkDataListener listener) {
zkClient.subscribeDataChanges(path, listener);
}
代码示例来源:origin: networknt/light-4j
@Override
public void subscribeDataChanges(String path, IZkDataListener listener) {
zkClient.subscribeDataChanges(path, listener);
}
代码示例来源:origin: weibocom/motan
zkClient.subscribeDataChanges(commandPath, zkDataListener);
LoggerUtil.info(String.format("[ZookeeperRegistry] subscribe command: path=%s, info=%s", commandPath, url.toFullStr()));
} catch (Throwable e) {
代码示例来源:origin: apache/incubator-pinot
public DynamicBrokerSelector(String zkServers) {
ZkClient zkClient = new ZkClient(zkServers);
zkClient.setZkSerializer(new BytesPushThroughSerializer());
zkClient.waitUntilConnected(60, TimeUnit.SECONDS);
zkClient.subscribeDataChanges(ExternalViewReader.BROKER_EXTERNAL_VIEW_PATH, this);
evReader = new ExternalViewReader(zkClient);
refresh();
}
代码示例来源:origin: Dromara/soul
private void subscribeAppAuthDataChanges(final String realPath) {
zkClient.subscribeDataChanges(realPath, new IZkDataListener() {
@Override
public void handleDataChange(final String dataPath, final Object data) {
Optional.ofNullable(data)
.ifPresent(o -> AUTH_MAP.put(((AppAuthZkDTO) o).getAppKey(), (AppAuthZkDTO) o));
}
@Override
public void handleDataDeleted(final String dataPath) {
final String key = dataPath.substring(ZkPathConstants.APP_AUTH_PARENT.length() + 1);
AUTH_MAP.remove(key);
}
});
}
代码示例来源:origin: Dromara/soul
private void subscribeSelectorDataChanges(final String path) {
zkClient.subscribeDataChanges(path, new IZkDataListener() {
@Override
public void handleDataChange(final String dataPath, final Object data) {
代码示例来源:origin: Dromara/soul
private void subscribeRuleDataChanges(final String path) {
zkClient.subscribeDataChanges(path, new IZkDataListener() {
@Override
public void handleDataChange(final String dataPath, final Object data) {
代码示例来源:origin: Dromara/soul
private void loadWatcherPlugin() {
Arrays.stream(PluginEnum.values()).forEach(pluginEnum -> {
String pluginPath = ZkPathConstants.buildPluginPath(pluginEnum.getName());
if (!zkClient.exists(pluginPath)) {
zkClient.createPersistent(pluginPath, true);
}
PluginZkDTO data = zkClient.readData(pluginPath);
Optional.ofNullable(data).ifPresent(d -> PLUGIN_MAP.put(pluginEnum.getName(), data));
zkClient.subscribeDataChanges(pluginPath, new IZkDataListener() {
@Override
public void handleDataChange(final String dataPath, final Object data) {
Optional.ofNullable(data)
.ifPresent(o -> {
PluginZkDTO dto = (PluginZkDTO) o;
PLUGIN_MAP.put(dto.getName(), dto);
});
}
@Override
public void handleDataDeleted(final String dataPath) {
PLUGIN_MAP.remove(pluginEnum.getName());
}
});
});
}
代码示例来源:origin: com.101tec/zkclient
public void start() {
_zkClient.subscribeDataChanges(_fileName, this);
readData();
LOG.debug("Started ContentWatcher");
}
代码示例来源:origin: apache/samza
public void subscribeDataChanges(String path, IZkDataListener dataListener) {
zkClient.subscribeDataChanges(path, dataListener);
metrics.subscriptions.inc();
}
代码示例来源:origin: com.github.sgroschupf/zkclient
public void start() {
_zkClient.subscribeDataChanges(_fileName, this);
readData();
LOG.debug("Started ContentWatcher");
}
代码示例来源:origin: apache/samza
/**
* subscribe for changes of JobModel version
* @param dataListener describe this
*/
public void subscribeToJobModelVersionChange(GenerationAwareZkDataListener dataListener) {
LOG.info(" subscribing for jm version change at:" + keyBuilder.getJobModelVersionPath());
zkClient.subscribeDataChanges(keyBuilder.getJobModelVersionPath(), dataListener);
metrics.subscriptions.inc();
}
代码示例来源:origin: strimzi/strimzi-kafka-operator
@Override
public Zk watchData(String path, Handler<AsyncResult<byte[]>> watcher) {
workerPool().executeBlocking(
future -> {
try {
IZkDataListener listener = new DataWatchAdapter(watcher);
dataWatches.put(path, listener);
zookeeper.subscribeDataChanges(path, listener);
future.complete();
} catch (Throwable t) {
future.fail(t);
}
},
log("watchData"));
return this;
}
代码示例来源:origin: org.apache.samza/samza-core_2.12
/**
* subscribe for changes of JobModel version
* @param dataListener describe this
*/
public void subscribeToJobModelVersionChange(GenerationAwareZkDataListener dataListener) {
LOG.info(" subscribing for jm version change at:" + keyBuilder.getJobModelVersionPath());
zkClient.subscribeDataChanges(keyBuilder.getJobModelVersionPath(), dataListener);
metrics.subscriptions.inc();
}
代码示例来源:origin: org.apache.samza/samza-core_2.11
/**
* subscribe for changes of JobModel version
* @param dataListener describe this
*/
public void subscribeToJobModelVersionChange(GenerationAwareZkDataListener dataListener) {
LOG.info(" subscribing for jm version change at:" + keyBuilder.getJobModelVersionPath());
zkClient.subscribeDataChanges(keyBuilder.getJobModelVersionPath(), dataListener);
metrics.subscriptions.inc();
}
代码示例来源:origin: javachen/learning-hadoop
public void subscribe(String key, ConfigChangeListener listener) {
String path = ZkUtils.getZkPath(this.rootNode, key);
if (!this.zkClient.exists(path)) {
throw new RuntimeException(
"配置("
+ path
+ ")不存在, 必须先定义配置才能监听配置的变化, 请检查配置的key是否正确, 如果确认配置key正确, 那么需要保证先使用配置发布命令发布配置! ");
}
this.zkClient.subscribeDataChanges(path, new DataListenerAdapter(
listener));
}
代码示例来源:origin: org.apache.samza/samza-core_2.10
/**
* subscribe for changes of JobModel version
* @param dataListener describe this
*/
public void subscribeToJobModelVersionChange(GenerationAwareZkDataListener dataListener) {
LOG.info(" subscribing for jm version change at:" + keyBuilder.getJobModelVersionPath());
zkClient.subscribeDataChanges(keyBuilder.getJobModelVersionPath(), dataListener);
metrics.subscriptions.inc();
}
代码示例来源:origin: org.apache.samza/samza-core
/**
* subscribe for changes of JobModel version
* @param dataListener describe this
*/
public void subscribeToJobModelVersionChange(GenerationAwareZkDataListener dataListener) {
LOG.info(" subscribing for jm version change at:" + keyBuilder.getJobModelVersionPath());
zkClient.subscribeDataChanges(keyBuilder.getJobModelVersionPath(), dataListener);
metrics.subscriptions.inc();
}
代码示例来源:origin: youtongluan/sumk
public static NamePairs readAndListen(String zkUrl, String path, IZkDataListener listener) {
ZkClient client = ZkClientHolder.getZkClient(zkUrl);
if (!client.exists(path)) {
return null;
}
String data = ZkClientHolder.data2String(client.readData(path));
if (listener != null) {
client.subscribeDataChanges(path, listener);
}
return new NamePairs(data);
}
}
本文整理了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(
我是一名优秀的程序员,十分优秀!