gpt4 book ai didi

org.apache.samza.zk.ZkUtils.getSortedActiveProcessorsIDs()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-14 23:57:31 27 4
gpt4 key购买 nike

本文整理了Java中org.apache.samza.zk.ZkUtils.getSortedActiveProcessorsIDs()方法的一些代码示例,展示了ZkUtils.getSortedActiveProcessorsIDs()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZkUtils.getSortedActiveProcessorsIDs()方法的具体详情如下:
包路径:org.apache.samza.zk.ZkUtils
类名称:ZkUtils
方法名:getSortedActiveProcessorsIDs

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

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com