当前位置: 首页>>代码示例>>Java>>正文


Java Type.NODE_REMOVED属性代码示例

本文整理汇总了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();
    }
}
 
开发者ID:artoderk,项目名称:elastic-jobx,代码行数:17,代码来源:JobOperationListenerManager.java

示例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;
    }
}
 
开发者ID:FlowCI,项目名称:flow-platform,代码行数:37,代码来源:AgentManager.java

示例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();
            }
        }
    }
}
 
开发者ID:artoderk,项目名称:elastic-jobx,代码行数:10,代码来源:GuaranteeListenerManager.java

示例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));
        }
    }

}
 
开发者ID:artoderk,项目名称:elastic-jobx,代码行数:13,代码来源:GlobalConfigListenerManager.java

示例5: isLeaderCrashed

private boolean isLeaderCrashed() {
    return electionNode.isLeaderHostPath(path) && Type.NODE_REMOVED == event.getType();
}
 
开发者ID:artoderk,项目名称:elastic-jobx,代码行数:3,代码来源:ElectionListenerManager.java

示例6: isServerEnabled

private boolean isServerEnabled() {
    return serverNode.isLocalServerDisabledPath(path) && Type.NODE_REMOVED == event.getType();
}
 
开发者ID:artoderk,项目名称:elastic-jobx,代码行数:3,代码来源:ElectionListenerManager.java

示例7: isServerResumed

private boolean isServerResumed() {
    return serverNode.isLocalJobPausedPath(path) && Type.NODE_REMOVED == event.getType();
}
 
开发者ID:artoderk,项目名称:elastic-jobx,代码行数:3,代码来源:ElectionListenerManager.java

示例8: isJobCrashAndNeedFailover

private boolean isJobCrashAndNeedFailover(final Integer item, final TreeCacheEvent event) {
    return null != item && Type.NODE_REMOVED == event.getType() && !executionService.isCompleted(item) && configService.isFailover();
}
 
开发者ID:artoderk,项目名称:elastic-jobx,代码行数:3,代码来源:FailoverListenerManager.java


注:本文中的org.apache.curator.framework.recipes.cache.TreeCacheEvent.Type.NODE_REMOVED属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。