org.apache.hadoop.hbase.zookeeper.ZKConfig.validateClusterKey()方法的使用及代码示例

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

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

ZKConfig.validateClusterKey介绍

[英]Verifies that the given key matches the expected format for a ZooKeeper cluster key. The Quorum for the ZK cluster can have one the following formats (see examples below):

  1. s1,s2,s3 (no client port in the list, the client port could be obtained from clientPort)
  2. s1:p1,s2:p2,s3:p3 (with client port, which could be same or different for each server, in this case, the clientPort would be ignored)
  3. s1:p1,s2,s3:p3 (mix of (1) and (2) - if port is not specified in a server, it would use the clientPort; otherwise, it would use the specified port)
    [中]验证给定密钥是否与ZooKeeper群集密钥的预期格式匹配。ZK集群的仲裁可以采用以下格式之一(参见下面的示例):
    1.s1、s2、s3(列表中没有客户端端口,客户端端口可以从clientPort获取)
    1.s1:p1、s2:p2、s3:p3(带有客户端端口,每个服务器的客户端端口可能相同或不同,在这种情况下,客户端端口将被忽略)
    1.s1:p1、s2、s3:p3(1)和(2)的混合)-如果服务器中未指定端口,它将使用clientPort;否则,它将使用指定的端口)

代码示例

代码示例来源:origin: apache/hbase

private void checkClusterKey(String clusterKey) throws DoNotRetryIOException {
 try {
  ZKConfig.validateClusterKey(clusterKey);
 } catch (IOException e) {
  throw new DoNotRetryIOException("Invalid cluster key: " + clusterKey, e);
 }
}

代码示例来源:origin: apache/hbase

ZKConfig.validateClusterKey(quorumAddress);
conf.set(TableOutputFormat.QUORUM_ADDRESS,quorumAddress);

代码示例来源:origin: apache/hbase

@Test
public void testClusterKey() throws Exception {
 testKey("server", 2181, "/hbase");
 testKey("server1,server2,server3", 2181, "/hbase");
 try {
  ZKConfig.validateClusterKey("2181:/hbase");
 } catch (IOException ex) {
  // OK
 }
}

代码示例来源:origin: com.aliyun.hbase/alihbase-mapreduce

ZKConfig.validateClusterKey(quorumAddress);
conf.set(TableOutputFormat.QUORUM_ADDRESS,quorumAddress);

代码示例来源:origin: org.apache.hbase/hbase-mapreduce

ZKConfig.validateClusterKey(quorumAddress);
conf.set(TableOutputFormat.QUORUM_ADDRESS,quorumAddress);

代码示例来源:origin: harbby/presto-connectors

ZKConfig.validateClusterKey(quorumAddress);
conf.set(TableOutputFormat.QUORUM_ADDRESS,quorumAddress);

代码示例来源:origin: org.apache.hbase/hbase-common

@Test
public void testClusterKey() throws Exception {
 testKey("server", 2181, "/hbase");
 testKey("server1,server2,server3", 2181, "/hbase");
 try {
  ZKConfig.validateClusterKey("2181:/hbase");
 } catch (IOException ex) {
  // OK
 }
}

代码示例来源:origin: com.aliyun.hbase/alihbase-common

@Test
public void testClusterKey() throws Exception {
 testKey("server", 2181, "/hbase");
 testKey("server1,server2,server3", 2181, "/hbase");
 try {
  ZKConfig.validateClusterKey("2181:/hbase");
 } catch (IOException ex) {
  // OK
 }
}

相关文章