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

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

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

ZKUtil.transformClusterKey介绍

[英]Separate the given key into the three configurations it should contain: hbase.zookeeper.quorum, hbase.zookeeper.client.port and zookeeper.znode.parent
[中]将给定的密钥分为它应该包含的三种配置:hbase。动物园管理员。法定人数,hbase。动物园管理员。客户港口和动物园管理员。兹诺德。父母亲

代码示例

代码示例来源:origin: co.cask.hbase/hbase

  1. /**
  2. * Apply the settings in the given key to the given configuration, this is
  3. * used to communicate with distant clusters
  4. * @param conf configuration object to configure
  5. * @param key string that contains the 3 required configuratins
  6. * @throws IOException
  7. */
  8. public static void applyClusterKeyToConf(Configuration conf, String key)
  9. throws IOException{
  10. String[] parts = transformClusterKey(key);
  11. conf.set(HConstants.ZOOKEEPER_QUORUM, parts[0]);
  12. conf.set(HConstants.ZOOKEEPER_CLIENT_PORT, parts[1]);
  13. conf.set(HConstants.ZOOKEEPER_ZNODE_PARENT, parts[2]);
  14. }

代码示例来源:origin: co.cask.hbase/hbase

  1. public static void initCredentials(Job job) throws IOException {
  2. if (User.isHBaseSecurityEnabled(job.getConfiguration())) {
  3. try {
  4. // init credentials for remote cluster
  5. String quorumAddress = job.getConfiguration().get(
  6. TableOutputFormat.QUORUM_ADDRESS);
  7. if (quorumAddress != null) {
  8. String[] parts = ZKUtil.transformClusterKey(quorumAddress);
  9. Configuration peerConf = HBaseConfiguration.create(job
  10. .getConfiguration());
  11. peerConf.set(HConstants.ZOOKEEPER_QUORUM, parts[0]);
  12. peerConf.set("hbase.zookeeper.client.port", parts[1]);
  13. peerConf.set(HConstants.ZOOKEEPER_ZNODE_PARENT, parts[2]);
  14. User.getCurrent().obtainAuthTokenForJob(peerConf, job);
  15. }
  16. User.getCurrent().obtainAuthTokenForJob(job.getConfiguration(), job);
  17. } catch (InterruptedException ie) {
  18. LOG.info("Interrupted obtaining user authentication token");
  19. Thread.interrupted();
  20. }
  21. }
  22. }

代码示例来源:origin: XiaoMi/themis

  1. ZKUtil.transformClusterKey(quorumAddress);
  2. conf.set(TableOutputFormat.QUORUM_ADDRESS, quorumAddress);

代码示例来源:origin: co.cask.hbase/hbase

  1. ZKUtil.transformClusterKey(quorumAddress);
  2. conf.set(TableOutputFormat.QUORUM_ADDRESS,quorumAddress);

相关文章