当前位置: 首页>>代码示例>>Java>>正文


Java SimpleConfiguration.getInt方法代码示例

本文整理汇总了Java中org.apache.fluo.api.config.SimpleConfiguration.getInt方法的典型用法代码示例。如果您正苦于以下问题:Java SimpleConfiguration.getInt方法的具体用法?Java SimpleConfiguration.getInt怎么用?Java SimpleConfiguration.getInt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.fluo.api.config.SimpleConfiguration的用法示例。


在下文中一共展示了SimpleConfiguration.getInt方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getTableOptimizations

import org.apache.fluo.api.config.SimpleConfiguration; //导入方法依赖的package包/类
@Override
public TableOptimizations getTableOptimizations(String key, SimpleConfiguration appConfig) {
  int numTablets = appConfig.getInt(PREFIX + key + ".numTablets");

  String prefix = key + ":";

  List<Bytes> splits = new ArrayList<>(numTablets - 1);

  int numSplits = numTablets - 1;
  int distance = (((int) Math.pow(Character.MAX_RADIX, HASH_LEN) - 1) / numTablets) + 1;
  int split = distance;
  for (int i = 0; i < numSplits; i++) {
    splits.add(Bytes.of(prefix
        + Strings.padStart(Integer.toString(split, Character.MAX_RADIX), HASH_LEN, '0')));
    split += distance;
  }

  splits.add(Bytes.of(prefix + "~"));


  TableOptimizations tableOptim = new TableOptimizations();
  tableOptim.setSplits(splits);
  tableOptim.setTabletGroupingRegex(Pattern.quote(prefix.toString()));

  return tableOptim;
}
 
开发者ID:apache,项目名称:fluo-recipes,代码行数:27,代码来源:RowHasher.java

示例2: start

import org.apache.fluo.api.config.SimpleConfiguration; //导入方法依赖的package包/类
@Override
public List<AutoCloseable> start(Params params) {
  SimpleConfiguration config =
      new FluoConfiguration(params.getConfiguration()).getReporterConfiguration("graphite");

  if (!config.getBoolean("enable", false)) {
    return Collections.emptyList();
  }

  String host = config.getString("host");
  String prefix = config.getString("prefix", "");
  int port = config.getInt("port", 8080);
  TimeUnit rateUnit = TimeUnit.valueOf(config.getString("rateUnit", "seconds").toUpperCase());
  TimeUnit durationUnit =
      TimeUnit.valueOf(config.getString("durationUnit", "milliseconds").toUpperCase());

  Graphite graphite = new Graphite(host, port);
  GraphiteReporter reporter =
      GraphiteReporter.forRegistry(params.getMetricRegistry()).convertDurationsTo(durationUnit)
          .convertRatesTo(rateUnit).prefixedWith(prefix).build(graphite);
  reporter.start(config.getInt("frequency", 60), TimeUnit.SECONDS);

  log.info("Reporting metrics to graphite server {}:{}", host, port);

  return Collections.singletonList((AutoCloseable) reporter);
}
 
开发者ID:apache,项目名称:fluo,代码行数:27,代码来源:GraphiteReporterStarter.java

示例3: Options

import org.apache.fluo.api.config.SimpleConfiguration; //导入方法依赖的package包/类
Options(String mapId, SimpleConfiguration appConfig) {
  this.mapId = mapId;

  this.numBuckets = appConfig.getInt(PREFIX + mapId + ".buckets");
  this.combinerType = appConfig.getString(PREFIX + mapId + ".combiner");
  this.keyType = appConfig.getString(PREFIX + mapId + ".key");
  this.valueType = appConfig.getString(PREFIX + mapId + ".val");
  this.updateObserverType = appConfig.getString(PREFIX + mapId + ".updateObserver", null);
  this.bufferSize = appConfig.getLong(PREFIX + mapId + ".bufferSize", DEFAULT_BUFFER_SIZE);
  this.bucketsPerTablet =
      appConfig.getInt(PREFIX + mapId + ".bucketsPerTablet", DEFAULT_BUCKETS_PER_TABLET);
}
 
开发者ID:apache,项目名称:fluo-recipes,代码行数:13,代码来源:CollisionFreeMap.java

示例4: load

import org.apache.fluo.api.config.SimpleConfiguration; //导入方法依赖的package包/类
static FluentConfigurator load(String queueId, SimpleConfiguration appConfig) {
  FluentConfigurator fc = new FluentConfigurator(queueId);
  fc.buckets = appConfig.getInt(PREFIX + queueId + ".buckets");
  fc.keyType = appConfig.getString(PREFIX + queueId + ".key");
  fc.valueType = appConfig.getString(PREFIX + queueId + ".val");
  fc.bufferSize = appConfig.getLong(PREFIX + queueId + ".bufferSize", DEFAULT_BUFFER_SIZE);
  fc.bucketsPerTablet =
      appConfig.getInt(PREFIX + queueId + ".bucketsPerTablet", DEFAULT_BUCKETS_PER_TABLET);
  fc.exporterType = appConfig.getString(PREFIX + queueId + ".exporter", null);
  return fc;
}
 
开发者ID:apache,项目名称:fluo-recipes,代码行数:12,代码来源:FluentConfigurator.java

示例5: getBucketsPerTablet

import org.apache.fluo.api.config.SimpleConfiguration; //导入方法依赖的package包/类
static int getBucketsPerTablet(String cqId, SimpleConfiguration appConfig) {
  return appConfig.getInt(PREFIX + cqId + ".bucketsPerTablet", DEFAULT_BUCKETS_PER_TABLET);
}
 
开发者ID:apache,项目名称:fluo-recipes,代码行数:4,代码来源:CqConfigurator.java

示例6: getNumBucket

import org.apache.fluo.api.config.SimpleConfiguration; //导入方法依赖的package包/类
static int getNumBucket(String cqId, SimpleConfiguration appConfig) {
  return appConfig.getInt(PREFIX + cqId + ".buckets");
}
 
开发者ID:apache,项目名称:fluo-recipes,代码行数:4,代码来源:CqConfigurator.java


注:本文中的org.apache.fluo.api.config.SimpleConfiguration.getInt方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。