gpt4 book ai didi

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

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

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

ZooKeeperFactory.getNamespace介绍

[英]Returns the namespace to prepend to all paths accessed by the ZooKeeper client.

Since ZooKeeper is a shared space, this is a useful way to localise a service to a namespace.
[中]将名称空间返回给ZooKeeper客户端访问的所有路径。
因为ZooKeeper是一个共享空间,所以这是一种将服务定位到名称空间的有用方法。

代码示例

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

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

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

final String namespace = factory.getNamespace();
final CuratorFrameworkFactory.Builder builder = CuratorFrameworkFactory.builder()
    .zookeeperFactory(new DropwizardConfiguredZooKeeperFactory(environment, name))

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

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;
}

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