Examples of MetricMutable


Examples of org.apache.hadoop.metrics2.lib.MetricMutable

   * @return a metric object
   */
  public MetricMutableGaugeLong getLongGauge(String gaugeName,
      long potentialStartingValue) {
    // Try and get the guage.
    MetricMutable metric = metricsMap.get(gaugeName);

    // If it's not there then try and put a new one in the storage.
    if (metric == null) {

      // Create the potential new gauge.
View Full Code Here

Examples of org.apache.hadoop.metrics2.lib.MetricMutable

   * @return a metric object
   */
  public MetricMutableCounterLong getLongCounter(String counterName,
      long potentialStartingValue) {
    // See getLongGauge for description on how this works.
    MetricMutable counter = metricsMap.get(counterName);
    if (counter == null) {
      MetricMutableCounterLong newCounter = mf.newCounter(counterName, "",
          potentialStartingValue);
      counter = metricsMap.putIfAbsent(counterName, newCounter);
      if (counter == null) {
View Full Code Here

Examples of org.apache.hadoop.metrics2.lib.MetricMutable

    return (MetricMutableCounterLong) counter;
  }

  public MetricMutableHistogram getHistogram(String histoName) {
    // See getLongGauge for description on how this works.
    MetricMutable histo = metricsMap.get(histoName);
    if (histo == null) {
      MetricMutableHistogram newHisto = new MetricMutableHistogram(histoName,
          "");
      histo = metricsMap.putIfAbsent(histoName, newHisto);
      if (histo == null) {
View Full Code Here

Examples of org.apache.hadoop.metrics2.lib.MetricMutable

    return (MetricMutableHistogram) histo;
  }

  public MetricMutableQuantiles getQuantile(String histoName) {
    // See getLongGauge for description on how this works.
    MetricMutable histo = metricsMap.get(histoName);
    if (histo == null) {
      MetricMutableQuantiles newHisto = new MetricMutableQuantiles(histoName,
          "");
      histo = metricsMap.putIfAbsent(histoName, newHisto);
      if (histo == null) {
View Full Code Here

Examples of org.apache.hadoop.metrics2.lib.MetricMutable

  private <T extends MetricMutable> T addNewMetricIfAbsent(String name, T ret,
      Class<T> metricClass) {
    // If the value we get back is null then the put was successful and we will
    // return that. Otherwise metric should contain the thing that was in
    // before the put could be completed.
    MetricMutable metric = metricsMap.putIfAbsent(name, ret);
    if (metric == null) {
      return ret;
    }

    return returnExistingWithCast(metric, metricClass, name);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.