gpt4 book ai didi

com.datasift.dropwizard.zookeeper.ZooKeeperFactory.getQuorumSpec()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-17 22:43:31 25 4
gpt4 key购买 nike

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

ZooKeeperFactory.getQuorumSpec介绍

[英]Retrieves a formatted specification of the ZooKeeper quorum..

The specification is formatted as: host1:port,host2:port[,hostN:port]
[中]检索ZooKeeper仲裁的格式化规范。。
规范的格式为:host1:port,host2:port[,hostN:port]

代码示例

代码示例来源:origin: datasift/dropwizard-extra

@Override
public String getConnectionString() {
  return factory.getQuorumSpec();
}

代码示例来源:origin: datasift/dropwizard-extra

zookeeper.getQuorumSpec() + zookeeper.getNamespace());
props.setProperty("zookeeper.connection.timeout.ms",
    String.valueOf(zookeeper.getConnectionTimeout().toMilliseconds()));

代码示例来源:origin: datasift/dropwizard-extra

throws IOException {
final String quorumSpec = getQuorumSpec();
final String namespace = getNamespace();

代码示例来源:origin: datasift/dropwizard-extra

/**
 * Builds an {@link HBaseClient} instance from the specified {@link HBaseClientFactory}
 * with the given {@code name}.
 *
 * @param environment the {@link Environment} to build {@link HBaseClient} instances for.
 * @param name the name for the {@link HBaseClient}.
 *
 * @return an {@link HBaseClient}, managed and configured according to the {@code
 *         configuration}.
 */
public HBaseClient build(final Environment environment, final String name) {
  final ZooKeeperFactory zkFactory = getZookeeper();
  final HBaseClient proxy = new HBaseClientProxy(
      new org.hbase.async.HBaseClient(zkFactory.getQuorumSpec(), zkFactory.getNamespace()));
  // optionally instrument and bound requests for the client
  final HBaseClient client = instrument(boundRequests(proxy), environment.metrics(), name);
  // configure client
  client.setFlushInterval(getFlushInterval());
  client.setIncrementBufferSize(getIncrementBufferSize());
  // add healthchecks for META and ROOT tables
  environment.healthChecks().register(name + "-meta", new HBaseHealthCheck(client, ".META."));
  environment.healthChecks().register(name + "-root", new HBaseHealthCheck(client, "-ROOT-"));
  // manage client
  environment.lifecycle().manage(new ManagedHBaseClient(
      client, getConnectionTimeout()));
  return client;
}

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com