use of org.apache.flink.shaded.curator5.org.apache.curator.framework.recipes.cache.TreeCacheEvent in project elastic-job by dangdangdotcom.
the class ShardingListenerManagerTest method assertShardingTotalCountChangedJobListenerWhenIsNotConfigPath.
@Test
public void assertShardingTotalCountChangedJobListenerWhenIsNotConfigPath() {
shardingListenerManager.new ShardingTotalCountChangedJobListener().dataChanged(null, new TreeCacheEvent(TreeCacheEvent.Type.NODE_ADDED, new ChildData("/test_job/config/other", null, "".getBytes())), "/test_job/config/other");
verify(shardingService, times(0)).setReshardingFlag();
}
use of org.apache.flink.shaded.curator5.org.apache.curator.framework.recipes.cache.TreeCacheEvent in project elastic-job by dangdangdotcom.
the class ShardingListenerManagerTest method assertListenServersChangedJobListenerWhenIsNotServerStatusPath.
@Test
public void assertListenServersChangedJobListenerWhenIsNotServerStatusPath() {
shardingListenerManager.new ListenServersChangedJobListener().dataChanged(null, new TreeCacheEvent(TreeCacheEvent.Type.NODE_ADDED, new ChildData("/test_job/servers/" + ip + "/other", null, "".getBytes())), "/test_job/servers/" + ip + "/other");
verify(shardingService, times(0)).setReshardingFlag();
}
use of org.apache.flink.shaded.curator5.org.apache.curator.framework.recipes.cache.TreeCacheEvent in project elastic-job by dangdangdotcom.
the class ShardingListenerManagerTest method assertListenServersChangedJobListenerWhenIsServerStatusPathAndAdd.
@Test
public void assertListenServersChangedJobListenerWhenIsServerStatusPathAndAdd() {
shardingListenerManager.new ListenServersChangedJobListener().dataChanged(null, new TreeCacheEvent(TreeCacheEvent.Type.NODE_ADDED, new ChildData("/test_job/servers/" + ip + "/status", null, "".getBytes())), "/test_job/servers/" + ip + "/status");
verify(shardingService).setReshardingFlag();
}
use of org.apache.flink.shaded.curator5.org.apache.curator.framework.recipes.cache.TreeCacheEvent in project elastic-job by dangdangdotcom.
the class ShardingListenerManagerTest method assertListenServersChangedJobListenerWhenIsServerStatusPathButUpdateAndIsServerDisabledPath.
@Test
public void assertListenServersChangedJobListenerWhenIsServerStatusPathButUpdateAndIsServerDisabledPath() {
shardingListenerManager.new ListenServersChangedJobListener().dataChanged(null, new TreeCacheEvent(TreeCacheEvent.Type.NODE_UPDATED, new ChildData("/test_job/servers/" + ip + "/disabled", null, "".getBytes())), "/test_job/servers/" + ip + "/disabled");
verify(shardingService).setReshardingFlag();
}
use of org.apache.flink.shaded.curator5.org.apache.curator.framework.recipes.cache.TreeCacheEvent in project elastic-job by dangdangdotcom.
the class ShardingListenerManagerTest method assertShardingTotalCountChangedJobListenerWhenIsConfigPathAndCurrentShardingTotalCountIsEqualToNewShardingTotalCount.
@Test
public void assertShardingTotalCountChangedJobListenerWhenIsConfigPathAndCurrentShardingTotalCountIsEqualToNewShardingTotalCount() {
shardingListenerManager.setCurrentShardingTotalCount(3);
shardingListenerManager.new ShardingTotalCountChangedJobListener().dataChanged(null, new TreeCacheEvent(TreeCacheEvent.Type.NODE_ADDED, new ChildData("/test_job/config", null, LiteJsonConstants.getJobJson().getBytes())), "/test_job/config");
verify(shardingService, times(0)).setReshardingFlag();
verify(executionService, times(0)).setNeedFixExecutionInfoFlag();
}
Aggregations