Package org.apache.hadoop.metrics.util

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


      new RegionServerDynamicMetrics();
    return metrics;
  }

  public synchronized void setNumericMetric(String name, long amt) {
    MetricsLongValue m = (MetricsLongValue)registry.get(name);
    if (m == null) {
      m = new MetricsLongValue(name, this.registry);
      try {
        if (updateMbeanInfoIfMetricsListChanged != null) {
          updateMbeanInfoIfMetricsListChanged.invoke(this.rsDynamicStatistics,
              new Object[]{});
        }
      } catch (Exception e) {
        LOG.error(e);
      }
    }
    m.set(amt);
  }
View Full Code Here


        for (Entry<Integer, MetricsLongValue> e: codecStatsMap.entrySet()) {
          e.getValue().set(0);
        }
        for (Entry<Integer, Long> e : blockHistograms.get(id).entrySet()) {
          if (e.getKey() < RaidNodeMetrics.MAX_MONITORED_MISPLACED_BLOCKS - 1) {
            MetricsLongValue v = codecStatsMap.get(e.getKey());
            v.set(e.getValue());
          } else {
            extra += e.getValue();
          }
        }
        MetricsLongValue v = codecStatsMap.get(
            RaidNodeMetrics.MAX_MONITORED_MISPLACED_BLOCKS - 1);
        v.set(extra);
      }
    }
    lastBlockHistograms = blockHistograms;
    lastUpdateFinishTime = RaidNode.now();
    lastUpdateUsedTime = lastUpdateFinishTime - lastUpdateStartTime;
View Full Code Here

  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);
    }
  }
View Full Code Here

    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));
      }
    }
  }
View Full Code Here

 
  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));
  }
View Full Code Here

      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));
    }
  }
View Full Code Here

  }

  private void createParityMetrics(
      Map<String, MetricsLongValue> m,
      String code, String name) {
    m.put(code, new MetricsLongValue(name, registry));
  }
View Full Code Here

      new RegionServerDynamicMetrics(regionServer);
    return metrics;
  }

  public synchronized void setNumericMetric(String name, long amt) {
    MetricsLongValue m = (MetricsLongValue)registry.get(name);
    if (m == null) {
      m = new MetricsLongValue(name, this.registry);
      this.needsUpdateMessage = true;
    }
    m.set(amt);
  }
View Full Code Here

    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);
View Full Code Here

        }

        for (HBaseAction action : HBaseAction.values()) {
            hbaseRates.put(action, new MetricsTimeVaryingRate(action.name().toLowerCase(), registry));
        }
        lastMutationEventTimestamp = new MetricsLongValue("timestampLastMutation", registry);
        context = MetricsUtil.getContext("repository");
        metricsRecord = MetricsUtil.createRecord(context, recordName);
        context.registerUpdater(this);
        mbean = new RepositoryMetricsMXBean(this.registry);
    }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.metrics.util.MetricsLongValue

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.