本文整理了Java中org.apache.samza.zk.ZkUtils.getSortedActiveProcessorsIDs()
方法的一些代码示例,展示了ZkUtils.getSortedActiveProcessorsIDs()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZkUtils.getSortedActiveProcessorsIDs()
方法的具体详情如下:
包路径:org.apache.samza.zk.ZkUtils
类名称:ZkUtils
方法名:getSortedActiveProcessorsIDs
[英]Method is used to get the list of currently active/registered processor ids
[中]方法用于获取当前活动/注册的处理器ID的列表
代码示例来源:origin: org.apache.samza/samza-core_2.10
void doOnProcessorChange(List<String> processors) {
List<String> currentProcessorIds = zkUtils.getSortedActiveProcessorsIDs();
Set<String> uniqueProcessorIds = new HashSet<>(currentProcessorIds);
代码示例来源:origin: org.apache.samza/samza-core_2.12
void doOnProcessorChange(List<String> processors) {
List<String> currentProcessorIds = zkUtils.getSortedActiveProcessorsIDs();
Set<String> uniqueProcessorIds = new HashSet<>(currentProcessorIds);
代码示例来源:origin: org.apache.samza/samza-core
void doOnProcessorChange(List<String> processors) {
List<String> currentProcessorIds = zkUtils.getSortedActiveProcessorsIDs();
Set<String> uniqueProcessorIds = new HashSet<>(currentProcessorIds);
代码示例来源:origin: org.apache.samza/samza-core_2.11
void doOnProcessorChange(List<String> processors) {
List<String> currentProcessorIds = zkUtils.getSortedActiveProcessorsIDs();
Set<String> uniqueProcessorIds = new HashSet<>(currentProcessorIds);
代码示例来源:origin: apache/samza
@Test
public void testGetProcessorsIDs() {
Assert.assertEquals(0, zkUtils.getSortedActiveProcessorsIDs().size());
zkUtils.registerProcessorAndGetId(new ProcessorData("host1", "1"));
List<String> l = zkUtils.getSortedActiveProcessorsIDs();
Assert.assertEquals(1, l.size());
new ZkUtils(KEY_BUILDER, zkClient, CONNECTION_TIMEOUT_MS, SESSION_TIMEOUT_MS, new NoOpMetricsRegistry()).registerProcessorAndGetId(
new ProcessorData("host2", "2"));
l = zkUtils.getSortedActiveProcessorsIDs();
Assert.assertEquals(2, l.size());
Assert.assertEquals(" ID1 didn't match", "1", l.get(0));
Assert.assertEquals(" ID2 didn't match", "2", l.get(1));
}
代码示例来源:origin: apache/samza
@Test
public void testDeleteProcessorNodeShouldDeleteTheCorrectProcessorNode() {
String testProcessorId1 = "processorId1";
String testProcessorId2 = "processorId2";
ZkUtils zkUtils = getZkUtils();
ZkUtils zkUtils1 = getZkUtils();
zkUtils.registerProcessorAndGetId(new ProcessorData("host1", testProcessorId1));
zkUtils1.registerProcessorAndGetId(new ProcessorData("host2", testProcessorId2));
zkUtils.deleteProcessorNode(testProcessorId1);
List<String> expectedProcessors = ImmutableList.of(testProcessorId2);
List<String> actualProcessors = zkUtils.getSortedActiveProcessorsIDs();
Assert.assertEquals(expectedProcessors, actualProcessors);
}
内容来源于网络,如有侵权,请联系作者删除!