Package org.apache.hadoop.metrics2

Examples of org.apache.hadoop.metrics2.MetricsException


        return newGauge;
      }
    }

    if (!(metric instanceof MutableGaugeLong)) {
      throw new MetricsException("Metric already exists in registry for metric name: " + gaugeName +
              " and not of type MetricMutableGaugeLong");
    }

    return (MutableGaugeLong) metric;
  }
View Full Code Here


      }
    }


    if (!(counter instanceof MutableCounterLong)) {
      throw new MetricsException("Metric already exists in registry for metric name: " +
              counterName + " and not of type MetricMutableCounterLong");
    }

    return (MutableCounterLong) counter;
  }
View Full Code Here

      }
    }


    if (!(histo instanceof MutableHistogram)) {
      throw new MetricsException("Metric already exists in registry for metric name: " +
          histoName + " and not of type MutableHistogram");
    }

    return (MutableHistogram) histo;
  }
View Full Code Here

      }
    }


    if (!(histo instanceof MetricMutableQuantiles)) {
      throw new MetricsException("Metric already exists in registry for metric name: " +
          histoName + " and not of type MutableHistogram");
    }

    return (MetricMutableQuantiles) histo;
  }
View Full Code Here

  @SuppressWarnings("unchecked")
  private<T> T returnExistingWithCast(MutableMetric metric,
                                      Class<T> metricClass, String name) {
    if (!metricClass.isAssignableFrom(metric.getClass())) {
      throw new MetricsException("Metric already exists in registry for metric name: " +
              name + " and not of type " + metricClass +
              " but instead of type " + metric.getClass());
    }

    return (T) metric;
View Full Code Here

    MetricsTag tag = new MetricsTag(name, description, value);

    if (!override) {
      MetricsTag existing = tagsMap.putIfAbsent(name, tag);
      if (existing != null) {
        throw new MetricsException("Tag "+ name +" already exists!");
      }
      return this;
    }

    tagsMap.put(name, tag);
View Full Code Here

        return newGauge;
      }
    }

    if (!(metric instanceof MetricMutableGaugeLong)) {
      throw new MetricsException("Metric already exists in registry for metric name: " +
              name + " and not of type MetricMutableGaugeLong");
    }

    return (MetricMutableGaugeLong) metric;
  }
View Full Code Here

        return newCounter;
      }
    }

    if (!(counter instanceof MetricMutableCounterLong)) {
      throw new MetricsException("Metric already exists in registry for metric name: " +
              name + "and not of type MetricMutableCounterLong");
    }

    return (MetricMutableCounterLong) counter;
  }
View Full Code Here

        return newHisto;
      }
    }

    if (!(histo instanceof MetricMutableHistogram)) {
      throw new MetricsException("Metric already exists in registry for metric name: " +
          name + "and not of type MetricMutableHistogram");
    }

    return (MetricMutableHistogram) histo;
  }
View Full Code Here

        return newHisto;
      }
    }

    if (!(histo instanceof MetricMutableQuantiles)) {
      throw new MetricsException("Metric already exists in registry for metric name: " +
          name + "and not of type MetricMutableQuantiles");
    }

    return (MetricMutableQuantiles) histo;
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.metrics2.MetricsException

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.