alluxio.uri.ZookeeperAuthority.getZookeeperAddress()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(4.1k)|赞(0)|评价(0)|浏览(84)

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

ZookeeperAuthority.getZookeeperAddress介绍

暂无

代码示例

代码示例来源:origin: Alluxio/alluxio

@Test
 public void mixedDelimiters() {
  String normalized = "a:0,b:0,c:0";
  for (String test : Arrays.asList(
    "zk@a:0;b:0+c:0",
    "zk@a:0,b:0;c:0",
    "zk@a:0+b:0,c:0"
  )) {
   assertEquals(normalized,
     ((ZookeeperAuthority) Authority.fromString(test)).getZookeeperAddress());
  }
 }
}

代码示例来源:origin: Alluxio/alluxio

alluxioConfProperties.put(PropertyKey.ZOOKEEPER_ENABLED.getName(), true);
 alluxioConfProperties.put(PropertyKey.ZOOKEEPER_ADDRESS.getName(),
   authority.getZookeeperAddress());
} else if (alluxioUri.getAuthority() instanceof SingleMasterAuthority) {
 SingleMasterAuthority authority = (SingleMasterAuthority) alluxioUri.getAuthority();

代码示例来源:origin: Alluxio/alluxio

@Test
public void zookeeperAuthorityTest() {
 ZookeeperAuthority authority = (ZookeeperAuthority) Authority.fromString("zk@host:2181");
 assertEquals("zk@host:2181", authority.toString());
 assertEquals("host:2181", authority.getZookeeperAddress());
 authority = (ZookeeperAuthority) Authority
   .fromString("zk@127.0.0.1:2181,127.0.0.2:2181,127.0.0.3:2181");
 assertEquals("zk@127.0.0.1:2181,127.0.0.2:2181,127.0.0.3:2181", authority.toString());
 assertEquals("127.0.0.1:2181,127.0.0.2:2181,127.0.0.3:2181", authority.getZookeeperAddress());
 authority = (ZookeeperAuthority) Authority.fromString("zk@host1:2181;host2:2181;host3:2181");
 assertEquals("zk@host1:2181,host2:2181,host3:2181", authority.toString());
 assertEquals("host1:2181,host2:2181,host3:2181", authority.getZookeeperAddress());
 authority = (ZookeeperAuthority) Authority.fromString("zk@host1:2181+host2:2181+host3:2181");
 assertEquals("zk@host1:2181,host2:2181,host3:2181", authority.toString());
 assertEquals("host1:2181,host2:2181,host3:2181", authority.getZookeeperAddress());
}

代码示例来源:origin: Alluxio/alluxio

@Test
public void semicolonZookeeperUri() {
 AlluxioURI uri =
   new AlluxioURI("alluxio://zk@host1:2181;host2:2181;host3:2181/xy z/a b c");
 assertTrue(uri.hasAuthority());
 assertEquals("zk@host1:2181,host2:2181,host3:2181", uri.getAuthority().toString());
 assertTrue(uri.getAuthority() instanceof ZookeeperAuthority);
 ZookeeperAuthority zkAuthority = (ZookeeperAuthority) uri.getAuthority();
 assertEquals("host1:2181,host2:2181,host3:2181", zkAuthority.getZookeeperAddress());
}

代码示例来源:origin: Alluxio/alluxio

@Test
public void basicZookeeperUri() {
 AlluxioURI uri =
   new AlluxioURI("alluxio://zk@host1:2181,host2:2181,host3:2181/xy z/a b c");
 assertEquals(uri,
   new AlluxioURI("alluxio://zk@host1:2181,host2:2181,host3:2181/xy z/a b c"));
 assertEquals("alluxio", uri.getScheme());
 assertEquals("zk@host1:2181,host2:2181,host3:2181", uri.getAuthority().toString());
 assertTrue(uri.getAuthority() instanceof ZookeeperAuthority);
 ZookeeperAuthority zkAuthority = (ZookeeperAuthority) uri.getAuthority();
 assertEquals("host1:2181,host2:2181,host3:2181", zkAuthority.getZookeeperAddress());
 assertEquals(2, uri.getDepth());
 assertEquals("a b c", uri.getName());
 assertEquals("alluxio://zk@host1:2181,host2:2181,host3:2181/xy z",
   uri.getParent().toString());
 assertEquals("alluxio://zk@host1:2181,host2:2181,host3:2181/",
   uri.getParent().getParent().toString());
 assertEquals("/xy z/a b c", uri.getPath());
 assertTrue(uri.hasAuthority());
 assertTrue(uri.hasScheme());
 assertTrue(uri.isAbsolute());
 assertTrue(uri.isPathAbsolute());
 assertEquals("alluxio://zk@host1:2181,host2:2181,host3:2181/xy z/a b c/d",
   uri.join("/d").toString());
 assertEquals("alluxio://zk@host1:2181,host2:2181,host3:2181/xy z/a b c/d",
   uri.join(new AlluxioURI("/d"))
   .toString());
 assertEquals("alluxio://zk@host1:2181,host2:2181,host3:2181/xy z/a b c",
   uri.toString());
}

相关文章