Java Code Examples for org.apache.curator.framework.recipes.cache.TreeCacheEvent.Type#NODE_UPDATED

The following examples show how to use org.apache.curator.framework.recipes.cache.TreeCacheEvent.Type#NODE_UPDATED . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TriggerListenerManager.java    From shardingsphere-elasticjob-lite with Apache License 2.0 5 votes vote down vote up
@Override
protected void dataChanged(final String path, final Type eventType, final String data) {
    if (!InstanceOperation.TRIGGER.name().equals(data) || !instanceNode.isLocalInstancePath(path) || Type.NODE_UPDATED != eventType) {
        return;
    }
    instanceService.clearTriggerFlag();
    if (!JobRegistry.getInstance().isShutdown(jobName) && !JobRegistry.getInstance().isJobRunning(jobName)) {
        // TODO At present, it cannot be triggered when the job is running, and it will be changed to a stacked trigger in the future.
        JobRegistry.getInstance().getJobScheduleController(jobName).triggerJob();
    }
}
 
Example 2
Source File: FailoverListenerManager.java    From shardingsphere-elasticjob-lite with Apache License 2.0 4 votes vote down vote up
@Override
protected void dataChanged(final String path, final Type eventType, final String data) {
    if (configNode.isConfigPath(path) && Type.NODE_UPDATED == eventType && !YamlEngine.unmarshal(data, YamlJobConfiguration.class).toJobConfiguration().isFailover()) {
        failoverService.removeFailoverInfo();
    }
}
 
Example 3
Source File: RescheduleListenerManager.java    From shardingsphere-elasticjob-lite with Apache License 2.0 4 votes vote down vote up
@Override
protected void dataChanged(final String path, final Type eventType, final String data) {
    if (configNode.isConfigPath(path) && Type.NODE_UPDATED == eventType && !JobRegistry.getInstance().isShutdown(jobName)) {
        JobRegistry.getInstance().getJobScheduleController(jobName).rescheduleJob(YamlEngine.unmarshal(data, YamlJobConfiguration.class).toJobConfiguration().getCron());
    }
}
 
Example 4
Source File: ShardingListenerManager.java    From shardingsphere-elasticjob-lite with Apache License 2.0 4 votes vote down vote up
private boolean isInstanceChange(final Type eventType, final String path) {
    return instanceNode.isInstancePath(path) && Type.NODE_UPDATED != eventType;
}
 
Example 5
Source File: MonitorExecutionListenerManager.java    From shardingsphere-elasticjob-lite with Apache License 2.0 4 votes vote down vote up
@Override
protected void dataChanged(final String path, final Type eventType, final String data) {
    if (configNode.isConfigPath(path) && Type.NODE_UPDATED == eventType && !YamlEngine.unmarshal(data, YamlJobConfiguration.class).toJobConfiguration().isMonitorExecution()) {
        executionService.clearAllRunningInfo();
    }
}