Github user revans2 commented on a diff in the pull request:
https://github.com/apache/storm/pull/2554#discussion_r167608078
--- Diff:
storm-server/src/main/java/org/apache/storm/metricstore/MetricStoreConfig.java
---
@@ -41,5 +41,23 @@ public static MetricStore configure(Map conf) throws
MetricException {
throw new MetricException("Failed to create metric store", t);
}
}
+
+ /**
+ * Configures metric processor to use the class specified in the conf.
+ * @param conf Storm config map
+ * @return WorkerMetricsProcessor prepared processor
+ * @throws MetricException on misconfiguration
+ */
+ public static WorkerMetricsProcessor configureMetricProcessor(Map
conf) throws MetricException {
+
+ try {
+ String processorClass =
(String)conf.get(DaemonConfig.STORM_METRIC_PROCESSOR_CLASS);
+ WorkerMetricsProcessor processor = (WorkerMetricsProcessor)
(Class.forName(processorClass)).newInstance();
+ processor.prepare(conf);
+ return processor;
+ } catch (Throwable t) {
--- End diff --
Can we just make this an Exception instead of a Throwable? Most Errors are
not things that we want to try and recover from.
---