org.apache.hadoop.metrics.util.MetricsLongValue Java Examples

The following examples show how to use org.apache.hadoop.metrics.util.MetricsLongValue. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RaidNodeMetrics.java    From RDFS with Apache License 2.0 6 votes vote down vote up
private void initParityMetrics() {
  parityFiles = createParityMap();
  parityBlocks = createParityMap();
  parityBytes = createParityMap();
  parityLogical = createParityMap();
  for (Codec codec : Codec.getCodecs()) {
    String code = codec.id;
    String head = (code + "_parity_").toLowerCase();
    createParityMetrics(parityFiles, code, head + "files");
    createParityMetrics(parityBlocks, code, head + "blocks");
    createParityMetrics(parityBytes, code, head + "bytes");
    createParityMetrics(parityLogical, code, head + "logical");
    String savingName = ("saving_" + code).toLowerCase();
    savingForCode.put(code, new MetricsLongValue(savingName, registry));
  }
}
 
Example #2
Source File: RaidNodeMetrics.java    From RDFS with Apache License 2.0 5 votes vote down vote up
private void initPlacementMetrics() {
  codecToMisplacedBlocks = new HashMap<String, Map<Integer, MetricsLongValue>>();
  for (Codec codec : Codec.getCodecs()) {
    Map<Integer, MetricsLongValue> m = new HashMap<Integer, MetricsLongValue>();
    for (int i = 0; i < MAX_MONITORED_MISPLACED_BLOCKS; ++i) {
      m.put(i, new MetricsLongValue(misplacedMetricHeader +
                                 "_" + codec.id + "_" + i, registry));
    }
    codecToMisplacedBlocks.put(codec.id, m);
  }
}
 
Example #3
Source File: RaidNodeMetrics.java    From RDFS with Apache License 2.0 5 votes vote down vote up
public synchronized void initCorruptFilesMetrics(Configuration conf) {
  if (corruptFiles == null) {
    String[] dirs = DistBlockIntegrityMonitor.getCorruptMonitorDirs(conf);
    corruptFiles = new HashMap<String, MetricsLongValue>();
    for (String dir: dirs) {
      String name = dir + "_corrupt_files";
      corruptFiles.put(dir, new MetricsLongValue(name, registry));
    }
  }
}
 
Example #4
Source File: RaidNodeMetrics.java    From RDFS with Apache License 2.0 5 votes vote down vote up
private Map<String, Map<RaidState, MetricsLongValue>> createSourceMap() {
  Map<String, Map<RaidState, MetricsLongValue>> result =
      new HashMap<String, Map<RaidState, MetricsLongValue>>();
  for (Codec codec : Codec.getCodecs()) {
    Map<RaidState, MetricsLongValue> m =
        new HashMap<RaidState, MetricsLongValue>();
    for (RaidState state : RaidState.values()) {
      m.put(state, null);
    }
    m = new EnumMap<RaidState, MetricsLongValue>(m);
    result.put(codec.id, m);
  }
  return result;
}
 
Example #5
Source File: RaidNodeMetrics.java    From RDFS with Apache License 2.0 5 votes vote down vote up
private Map<String, MetricsLongValue> createParityMap() {
  Map<String, MetricsLongValue> m =
      new HashMap<String, MetricsLongValue>();
  for (Codec codec : Codec.getCodecs()) {
    m.put(codec.id, null);
  }
  return m;
}
 
Example #6
Source File: SepMetrics.java    From hbase-indexer with Apache License 2.0 5 votes vote down vote up
public SepMetrics(String recordName) {
    this.recordName = recordName;
    metricsRegistry = new MetricsRegistry();
    sepProcessingRate = new MetricsTimeVaryingRate("sepProcessed", metricsRegistry);
    lastTimestampInputProcessed = new MetricsLongValue("lastSepTimestamp", metricsRegistry);

    context = MetricsUtil.getContext("repository");
    metricsRecord = MetricsUtil.createRecord(context, recordName);
    context.registerUpdater(this);
    mbean = new SepMetricsMXBean(this.metricsRegistry);
}
 
Example #7
Source File: RaidNodeMetrics.java    From RDFS with Apache License 2.0 4 votes vote down vote up
private void createSourceMetrics(
    Map<String, Map<RaidState, MetricsLongValue>> m,
    String code, RaidState state, String name) {
  Map<RaidState, MetricsLongValue> innerMap = m.get(code);
  innerMap.put(state, new MetricsLongValue(name, registry));
}
 
Example #8
Source File: RaidNodeMetrics.java    From RDFS with Apache License 2.0 4 votes vote down vote up
private void createParityMetrics(
    Map<String, MetricsLongValue> m,
    String code, String name) {
  m.put(code, new MetricsLongValue(name, registry));
}