@Test public void testIllegalPatternType() throws Exception { String str = "{" + "\n metricFilter : {" + "\n includes : { " + "\n \"ILLEGAL\" : \"glob:*\"" + "\n }" + "\n }}"; Config config = ConfigFactory.parseString(str); try { PatternMetricFilter.parse(new Configs(), config); fail(); } catch (MorphlineCompilationException e) { ; } }
public static MetricFilter parse(Configs configs, Config config) { Preconditions.checkNotNull(configs); Preconditions.checkNotNull(config); Config filterConfig = configs.getConfig(config, "metricFilter", null); if (filterConfig == null) { return MetricFilter.ALL; } else { return new PatternMetricFilter(filterConfig); } }
PatternMetricFilter implements MetricFilter { public static MetricFilter parse(Configs configs, Config config) { Preconditions.checkNotNull(configs); Preconditions.checkNotNull(config); Config filterConfig = configs.getConfig(config, "metricFilter", null); if (filterConfig == null) { return MetricFilter.ALL; } else { return new PatternMetricFilter(filterConfig); } } }
PatternMetricFilter implements MetricFilter { public static MetricFilter parse(Configs configs, Config config) { Preconditions.checkNotNull(configs); Preconditions.checkNotNull(config); Config filterConfig = configs.getConfig(config, "metricFilter", null); if (filterConfig == null) { return MetricFilter.ALL; } else { return new PatternMetricFilter(filterConfig); } } private  PatternMetricFilter(Config config); }
PatternMetricFilter implements MetricFilter { public static MetricFilter parse(Configs configs, Config config) { Preconditions.checkNotNull(configs); Preconditions.checkNotNull(config); Config filterConfig = configs.getConfig(config, "metricFilter", null); if (filterConfig == null) { return MetricFilter.ALL; } else { return new PatternMetricFilter(filterConfig); } } private  PatternMetricFilter(Config config); static MetricFilter parse(Configs configs, Config config); @Override boolean matches(String name, Metric metric); @Override String toString(); }
PatternMetricFilter implements MetricFilter { public static MetricFilter parse(Configs configs, Config config) { Preconditions.checkNotNull(configs); Preconditions.checkNotNull(config); Config filterConfig = configs.getConfig(config, "metricFilter", null); if (filterConfig == null) { return MetricFilter.ALL; } else { return new PatternMetricFilter(filterConfig); } } private  PatternMetricFilter(Config config); static MetricFilter parse(Configs configs, Config config); @Override boolean matches(String name, Metric metric); @Override String toString();  }