本文整理汇总了Java中org.apache.curator.framework.recipes.cache.TreeCacheEvent.Type.NODE_UPDATED属性的典型用法代码示例。如果您正苦于以下问题:Java Type.NODE_UPDATED属性的具体用法?Java Type.NODE_UPDATED怎么用?Java Type.NODE_UPDATED使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.apache.curator.framework.recipes.cache.TreeCacheEvent.Type
的用法示例。
在下文中一共展示了Type.NODE_UPDATED属性的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: childEvent
@Override
public void childEvent(CuratorFramework client, TreeCacheEvent event) throws Exception {
ChildData eventData = event.getData();
if (event.getType() == Type.CONNECTION_RECONNECTED) {
LOGGER.traceMarker("ZK-Event", "========= Reconnect =========");
registerZkNodeAndWatch();
return;
}
if (event.getType() == Type.CONNECTION_LOST) {
LOGGER.traceMarker("ZK-Event", "========= Lost =========");
return;
}
if (event.getType() == Type.INITIALIZED) {
LOGGER.traceMarker("ZK-Event", "========= Initialized =========");
return;
}
if (event.getType() == Type.NODE_ADDED) {
LOGGER.traceMarker("ZK-Event", "========= Node Added: %s =========", eventData.getPath());
return;
}
if (event.getType() == Type.NODE_UPDATED) {
LOGGER.traceMarker("ZK-Event", "========= Node Updated: %s =========", eventData.getPath());
onDataChanged(eventData.getPath());
return;
}
if (event.getType() == Type.NODE_REMOVED) {
LOGGER.traceMarker("ZK-Event", "========= Node Removed: %s =========", eventData.getPath());
close();
return;
}
}
示例2: dataChanged
@Override
protected void dataChanged(final CuratorFramework client, final TreeCacheEvent event, final String path) {
if (configNode.isMonitorExecutionPath(path) && Type.NODE_UPDATED == event.getType()) {
if (!Boolean.valueOf(new String(event.getData().getData()))) {
executionService.removeExecutionInfo();
}
}
}
示例3: dataChanged
@Override
protected void dataChanged(final CuratorFramework client, final TreeCacheEvent event, final String path) {
if (configNode.isFailoverPath(path) && Type.NODE_UPDATED == event.getType()) {
if (!Boolean.valueOf(new String(event.getData().getData()))) {
failoverService.removeFailoverInfo();
}
}
}
示例4: dataChanged
@Override
protected void dataChanged(final CuratorFramework client, final TreeCacheEvent event, final String path) {
if (configNode.isCronPath(path) && Type.NODE_UPDATED == event.getType()) {
String cronExpression = new String(event.getData().getData());
JobScheduleController jobScheduler = JobRegistry.getInstance().getJobScheduleController(jobName);
if (null != jobScheduler) {
jobScheduler.rescheduleJob(cronExpression);
}
}
}
示例5: dataChanged
@Override
protected void dataChanged(final CuratorFramework client, final TreeCacheEvent event, final String path) {
// 全局分片策略监听
if (GlobalNodePath.isShardingStrategyPath(path)) {
if (Type.NODE_UPDATED == event.getType()) {
JobShardingStrategyCache.reLoadGlobalStrategy(globalConfigurationService, getStrategyPath(path));
}
if (Type.NODE_REMOVED == event.getType()) {
JobShardingStrategyCache.removeStrategy(getStrategyPath(path));
}
}
}
示例6: isServersCrashed
private boolean isServersCrashed(final TreeCacheEvent event, final String path) {
return serverNode.isServerStatusPath(path) && Type.NODE_UPDATED != event.getType();
}
示例7: pushEvent
/**
* 发布事件
*
* @param event 配置节点变更事件
* @param path 配置节点路径
* @param value 配置节点新值
* @param oldvalue 配置节点原始值
*/
private void pushEvent(final TreeCacheEvent event, String path, String value) {
if (event.getType() == Type.NODE_UPDATED) {
ElasticConfigEventBus.pushEvent(ElasticConfigEvent.builder().path(path).value(value)
.eventType(eventMap.get(event.getType())).build());
}
}