@Test public void testGetMetricReportors() { Configuration conf = new Configuration(); CacheConfig.setMetricsReporters(conf, "JmX, , ganglia , , ,,"); Set<MetricsReporterType> reporterSet = getMetricsReporters(conf); assertEquals(reporterSet.size(), 2, "Number of reporter not correct"); assertTrue(reporterSet.contains(MetricsReporterType.JMX), "Metrics reporters not resolved correctly"); assertTrue(reporterSet.contains(MetricsReporterType.GANGLIA), "Metrics reporters not resolved correctly"); }
public static Set<MetricsReporterType> getMetricsReporters(Configuration configuration) { return Stream.of(CacheConfig.getMetricsReporters(configuration).split(",")) .map(String::trim) .filter(s -> !s.isEmpty()) .map(String::toUpperCase) .map(MetricsReporterType::valueOf) .collect(Collectors.toSet()); }
ClusterUtil { public static Set<MetricsReporterType> getMetricsReporters(Configuration configuration) { return Stream.of(CacheConfig.getMetricsReporters(configuration).split(",")) .map(String::trim) .filter(s -> !s.isEmpty()) .map(String::toUpperCase) .map(MetricsReporterType::valueOf) .collect(Collectors.toSet()); } }
ClusterUtil { public static Set<MetricsReporterType> getMetricsReporters(Configuration configuration) { return Stream.of(CacheConfig.getMetricsReporters(configuration).split(",")) .map(String::trim) .filter(s -> !s.isEmpty()) .map(String::toUpperCase) .map(MetricsReporterType::valueOf) .collect(Collectors.toSet()); } private  ClusterUtil(); }
ClusterUtil { public static Set<MetricsReporterType> getMetricsReporters(Configuration configuration) { return Stream.of(CacheConfig.getMetricsReporters(configuration).split(",")) .map(String::trim) .filter(s -> !s.isEmpty()) .map(String::toUpperCase) .map(MetricsReporterType::valueOf) .collect(Collectors.toSet()); } private  ClusterUtil(); static String getMasterHostname(Configuration conf); static Configuration applyRubixSiteConfig(Configuration conf); static Set<MetricsReporterType> getMetricsReporters(Configuration configuration); }
ClusterUtil { public static Set<MetricsReporterType> getMetricsReporters(Configuration configuration) { return Stream.of(CacheConfig.getMetricsReporters(configuration).split(",")) .map(String::trim) .filter(s -> !s.isEmpty()) .map(String::toUpperCase) .map(MetricsReporterType::valueOf) .collect(Collectors.toSet()); } private  ClusterUtil(); static String getMasterHostname(Configuration conf); static Configuration applyRubixSiteConfig(Configuration conf); static Set<MetricsReporterType> getMetricsReporters(Configuration configuration); static volatile AtomicReference<Boolean> rubixSiteExists; }