本文整理了Java中com.liveramp.hank.coordinator.zk.ZkRingGroup.<init>()
方法的一些代码示例,展示了ZkRingGroup.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZkRingGroup.<init>()
方法的具体详情如下:
包路径:com.liveramp.hank.coordinator.zk.ZkRingGroup
类名称:ZkRingGroup
方法名:<init>
暂无
代码示例来源:origin: LiveRamp/hank
public static ZkRingGroup create(ZooKeeperPlus zk, String path, ZkDomainGroup domainGroup, Coordinator coordinator) throws KeeperException, InterruptedException, IOException {
zk.create(path, domainGroup.getName().getBytes());
zk.create(ZkPath.append(path, CLIENTS_PATH), null);
zk.create(ZkPath.append(path, SERVERS_PATH), null);
zk.create(ZkPath.append(path, DotComplete.NODE_NAME), null);
return new ZkRingGroup(zk, path, domainGroup, coordinator);
}
代码示例来源:origin: LiveRamp/hank
@Test
public void testLoad() throws Exception {
create(ring_group, ZkPath.append(dg_root, "myDomainGroup"));
createRing(1);
createRing(2);
createRing(3);
MockDomainGroup dg = new MockDomainGroup("myDomainGroup");
ZkRingGroup rg = new ZkRingGroup(getZk(), ring_group, dg, coordinator);
assertEquals("ring group name", "myRingGroup", rg.getName());
assertEquals("num rings", 3, rg.getRings().size());
assertEquals("domain group config", dg, rg.getDomainGroup());
assertEquals("ring group for localhost:2", 2, rg.getRingForHost(new PartitionServerAddress("localhost", 2)).getRingNumber());
assertEquals("ring group by number", 3, rg.getRing(3).getRingNumber());
}
代码示例来源:origin: LiveRamp/hank
ZkRingGroup rg = new ZkRingGroup(getZk(), ring_group, dg, coordinator);
内容来源于网络,如有侵权,请联系作者删除!