gpt4 book ai didi

com.twitter.distributedlog.ZooKeeperClientBuilder.statsLogger()方法的使用及代码示例

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

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

ZooKeeperClientBuilder.statsLogger介绍

[英]Build zookeeper client with given stats logger statsLogger.
[中]使用给定的统计记录器statsLogger构建zookeeper客户端。

代码示例

代码示例来源:origin: twitter/distributedlog

/**
 * Return a zookeeper client builder for testing.
 *
 * @return a zookeeper client builder
 */
public static ZooKeeperClientBuilder newBuilder() {
  return ZooKeeperClientBuilder.newBuilder()
      .retryPolicy(RetryPolicyUtils.DEFAULT_INFINITE_RETRY_POLICY)
      .connectionTimeoutMs(10000)
      .sessionTimeoutMs(60000)
      .zkAclId(null)
      .statsLogger(NullStatsLogger.INSTANCE);
}

代码示例来源:origin: twitter/distributedlog

.uri(uri)
      .retryPolicy(retryPolicy)
      .statsLogger(statsLogger.scope("dlzk_dlm_writer_shared"));
  this.ownWriterZKC = true;
} else {
        .retryPolicy(retryPolicy)
        .zkAclId(conf.getZkAclId())
        .statsLogger(statsLogger.scope("dlzk_dlm_reader_shared"));
    this.ownReaderZKC = true;

代码示例来源:origin: twitter/distributedlog

private static ZooKeeperClientBuilder createDLZKClientBuilder(String zkcName,
                              DistributedLogConfiguration conf,
                              String zkServers,
                              StatsLogger statsLogger) {
  RetryPolicy retryPolicy = null;
  if (conf.getZKNumRetries() > 0) {
    retryPolicy = new BoundExponentialBackoffRetryPolicy(
      conf.getZKRetryBackoffStartMillis(),
      conf.getZKRetryBackoffMaxMillis(), conf.getZKNumRetries());
  }
  ZooKeeperClientBuilder builder = ZooKeeperClientBuilder.newBuilder()
    .name(zkcName)
    .sessionTimeoutMs(conf.getZKSessionTimeoutMilliseconds())
    .retryThreadCount(conf.getZKClientNumberRetryThreads())
    .requestRateLimit(conf.getZKRequestRateLimit())
    .zkServers(zkServers)
    .retryPolicy(retryPolicy)
    .statsLogger(statsLogger)
    .zkAclId(conf.getZkAclId());
  LOG.info("Created shared zooKeeper client builder {}: zkServers = {}, numRetries = {}, sessionTimeout = {}, retryBackoff = {},"
       + " maxRetryBackoff = {}, zkAclId = {}.", new Object[] { zkcName, zkServers, conf.getZKNumRetries(),
      conf.getZKSessionTimeoutMilliseconds(), conf.getZKRetryBackoffStartMillis(),
      conf.getZKRetryBackoffMaxMillis(), conf.getZkAclId() });
  return builder;
}

代码示例来源:origin: twitter/distributedlog

private static ZooKeeperClientBuilder createBKZKClientBuilder(String zkcName,
                               DistributedLogConfiguration conf,
                               String zkServers,
                               StatsLogger statsLogger) {
  RetryPolicy retryPolicy = null;
  if (conf.getZKNumRetries() > 0) {
    retryPolicy = new BoundExponentialBackoffRetryPolicy(
        conf.getBKClientZKRetryBackoffStartMillis(),
        conf.getBKClientZKRetryBackoffMaxMillis(),
        conf.getBKClientZKNumRetries());
  }
  ZooKeeperClientBuilder builder = ZooKeeperClientBuilder.newBuilder()
      .name(zkcName)
      .sessionTimeoutMs(conf.getBKClientZKSessionTimeoutMilliSeconds())
      .retryThreadCount(conf.getZKClientNumberRetryThreads())
      .requestRateLimit(conf.getBKClientZKRequestRateLimit())
      .zkServers(zkServers)
      .retryPolicy(retryPolicy)
      .statsLogger(statsLogger)
      .zkAclId(conf.getZkAclId());
  LOG.info("Created shared zooKeeper client builder {}: zkServers = {}, numRetries = {}, sessionTimeout = {}, retryBackoff = {},"
      + " maxRetryBackoff = {}, zkAclId = {}.", new Object[] { zkcName, zkServers, conf.getBKClientZKNumRetries(),
      conf.getBKClientZKSessionTimeoutMilliSeconds(), conf.getBKClientZKRetryBackoffStartMillis(),
      conf.getBKClientZKRetryBackoffMaxMillis(), conf.getZkAclId() });
  return builder;
}

代码示例来源:origin: twitter/distributedlog

/**
   * Create a zookeeper client builder with provided <i>conf</i> for testing.
   *
   * @param conf distributedlog configuration
   * @return zookeeper client builder
   */
  public static ZooKeeperClientBuilder newBuilder(DistributedLogConfiguration conf) {
    return ZooKeeperClientBuilder.newBuilder()
        .retryPolicy(RetryPolicyUtils.DEFAULT_INFINITE_RETRY_POLICY)
        .sessionTimeoutMs(conf.getZKSessionTimeoutMilliseconds())
        .zkAclId(conf.getZkAclId())
        .retryThreadCount(conf.getZKClientNumberRetryThreads())
        .requestRateLimit(conf.getZKRequestRateLimit())
        .statsLogger(NullStatsLogger.INSTANCE);
  }
}

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