當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。