本文整理了Java中org.apache.samza.zk.ZkUtils.writeTaskLocality()
方法的一些代码示例,展示了ZkUtils.writeTaskLocality()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZkUtils.writeTaskLocality()
方法的具体详情如下:
包路径:org.apache.samza.zk.ZkUtils
类名称:ZkUtils
方法名:writeTaskLocality
暂无
代码示例来源:origin: apache/samza
for (ContainerModel containerModel : jobModel.getContainers().values()) {
for (TaskName taskName : containerModel.getTasks().keySet()) {
zkUtils.writeTaskLocality(taskName, locationId);
代码示例来源:origin: apache/samza
@Test
public void testReadAfterWriteTaskLocality() {
zkUtils.writeTaskLocality(new TaskName("task-1"), new LocationId("LocationId-1"));
zkUtils.writeTaskLocality(new TaskName("task-2"), new LocationId("LocationId-2"));
Map<TaskName, LocationId> taskLocality = ImmutableMap.of(new TaskName("task-1"), new LocationId("LocationId-1"),
new TaskName("task-2"), new LocationId("LocationId-2"));
Assert.assertEquals(taskLocality, zkUtils.readTaskLocality());
}
代码示例来源:origin: apache/samza
@Test
public void testWriteTaskLocalityShouldUpdateTheExistingValue() {
zkUtils.writeTaskLocality(new TaskName("task-1"), new LocationId("LocationId-1"));
Map<TaskName, LocationId> taskLocality = ImmutableMap.of(new TaskName("task-1"), new LocationId("LocationId-1"));
Assert.assertEquals(taskLocality, zkUtils.readTaskLocality());
zkUtils.writeTaskLocality(new TaskName("task-1"), new LocationId("LocationId-2"));
taskLocality = ImmutableMap.of(new TaskName("task-1"), new LocationId("LocationId-2"));
Assert.assertEquals(taskLocality, zkUtils.readTaskLocality());
}
代码示例来源:origin: apache/samza
@Test
public void testReadTaskLocalityShouldReturnAllTheExistingLocalityValue() {
zkUtils.writeTaskLocality(new TaskName("task-1"), new LocationId("LocationId-1"));
zkUtils.writeTaskLocality(new TaskName("task-2"), new LocationId("LocationId-2"));
zkUtils.writeTaskLocality(new TaskName("task-3"), new LocationId("LocationId-3"));
zkUtils.writeTaskLocality(new TaskName("task-4"), new LocationId("LocationId-4"));
zkUtils.writeTaskLocality(new TaskName("task-5"), new LocationId("LocationId-5"));
Map<TaskName, LocationId> taskLocality = ImmutableMap.of(new TaskName("task-1"), new LocationId("LocationId-1"),
new TaskName("task-2"), new LocationId("LocationId-2"),
new TaskName("task-3"), new LocationId("LocationId-3"),
new TaskName("task-4"), new LocationId("LocationId-4"),
new TaskName("task-5"), new LocationId("LocationId-5"));
Assert.assertEquals(taskLocality, zkUtils.readTaskLocality());
}
内容来源于网络,如有侵权,请联系作者删除!