@Override public Object execute() throws Exception { registry.getCollectorClassNames().stream().sorted().forEachOrdered(e -> { System.out.printf("%s\n", e); }); return null; } }
@Override public Object execute() throws Exception { registry.getCollectorClassNames().stream().sorted().forEachOrdered(e -> { System.out.printf("%s\n", e); }); return null; }
@Override public Object execute() throws Exception { registry.getCollectorClassNames().stream().sorted().forEachOrdered(e -> { System.out.printf("%s\n", e); }); return null; }
@Override public int complete(Session session, CommandLine commandLine, List<String> candidates) { StringsCompleter serviceNames = new StringsCompleter(); serviceNames.getStrings().addAll(registry.getCollectorClassNames()); return serviceNames.complete(session, commandLine, candidates); }
private void instantiateCollectors() { LOG.debug("instantiateCollectors: Loading collectors"); /* * Load up an instance of each collector from the config * so that the event processor will have them for * new incoming events to create collectable service objects. */ Collection<Collector> collectors = m_collectdConfigFactory.getCollectdConfig().getCollectors(); for (Collector collector : collectors) { String svcName = collector.getService(); try { LOG.debug("instantiateCollectors: Loading collector {}, classname {}", svcName, collector.getClassName()); final ServiceCollector sc = m_serviceCollectorRegistry.getCollectorByClassName(collector.getClassName()); if (sc == null) { throw new IllegalArgumentException(String.format("No collector found with class name '%s'. Available collectors include: %s", collector.getClassName(), m_serviceCollectorRegistry.getCollectorClassNames())); } sc.initialize(); setServiceCollector(svcName, sc); } catch (Throwable t) { LOG.warn("instantiateCollectors: Failed to load collector {} for service {}", collector.getClassName(), svcName, t); } } }