本文整理汇总了Java中org.apache.curator.framework.recipes.cache.TreeCacheEvent.Type.NODE_REMOVED属性的典型用法代码示例。如果您正苦于以下问题:Java Type.NODE_REMOVED属性的具体用法?Java Type.NODE_REMOVED怎么用?Java Type.NODE_REMOVED使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.apache.curator.framework.recipes.cache.TreeCacheEvent.Type
的用法示例。
在下文中一共展示了Type.NODE_REMOVED属性的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: dataChanged
@Override
protected void dataChanged(final CuratorFramework client, final TreeCacheEvent event, final String path) {
if (!serverNode.isLocalJobPausedPath(path)) {
return;
}
JobScheduleController jobScheduleController = JobRegistry.getInstance().getJobScheduleController(jobName);
if (null == jobScheduleController) {
return;
}
if (Type.NODE_ADDED == event.getType()) {
jobScheduleController.pauseJob();
}
if (Type.NODE_REMOVED == event.getType()) {
jobScheduleController.resumeJob();
serverService.clearJobPausedStatus();
}
}
示例2: 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;
}
}
示例3: dataChanged
@Override
protected void dataChanged(final CuratorFramework client, final TreeCacheEvent event, final String path) {
if (Type.NODE_REMOVED == event.getType() && guaranteeNode.isStartedRootNode(path)) {
for (ElasticJobListener each : elasticJobListeners) {
if (each instanceof AbstractDistributeOnceElasticJobListener) {
((AbstractDistributeOnceElasticJobListener) each).notifyWaitingTaskStart();
}
}
}
}
示例4: 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));
}
}
}
示例5: isLeaderCrashed
private boolean isLeaderCrashed() {
return electionNode.isLeaderHostPath(path) && Type.NODE_REMOVED == event.getType();
}
示例6: isServerEnabled
private boolean isServerEnabled() {
return serverNode.isLocalServerDisabledPath(path) && Type.NODE_REMOVED == event.getType();
}
示例7: isServerResumed
private boolean isServerResumed() {
return serverNode.isLocalJobPausedPath(path) && Type.NODE_REMOVED == event.getType();
}
示例8: isJobCrashAndNeedFailover
private boolean isJobCrashAndNeedFailover(final Integer item, final TreeCacheEvent event) {
return null != item && Type.NODE_REMOVED == event.getType() && !executionService.isCompleted(item) && configService.isFailover();
}