public MetricsGraphiteReporter(HoodieWriteConfig config, MetricRegistry registry) { this.registry = registry; this.config = config; // Check the serverHost and serverPort here this.serverHost = config.getGraphiteServerHost(); this.serverPort = config.getGraphiteServerPort(); if (serverHost == null || serverPort == 0) { throw new RuntimeException(String .format("Graphite cannot be initialized with serverHost[%s] and serverPort[%s].", serverHost, serverPort)); } this.graphiteReporter = createGraphiteReport(); }
public static MetricsReporter createReporter(HoodieWriteConfig config, MetricRegistry registry) { MetricsReporterType type = config.getMetricsReporterType(); MetricsReporter reporter = null; switch (type) { case GRAPHITE: reporter = new MetricsGraphiteReporter(config, registry); break; case INMEMORY: reporter = new InMemoryMetricsReporter(); break; default: logger.error("Reporter type[" + type + "] is not supported."); break; } return reporter; } }
public static MetricsReporter createReporter(HoodieWriteConfig config, MetricRegistry registry) { MetricsReporterType type = config.getMetricsReporterType(); MetricsReporter reporter = null; switch (type) { case GRAPHITE: reporter = new MetricsGraphiteReporter(config, registry); break; case INMEMORY: reporter = new InMemoryMetricsReporter(); break; default: logger.error("Reporter type[" + type + "] is not supported."); break; } return reporter; } }
public MetricsGraphiteReporter(HoodieWriteConfig config, MetricRegistry registry) { this.registry = registry; this.config = config; // Check the serverHost and serverPort here this.serverHost = config.getGraphiteServerHost(); this.serverPort = config.getGraphiteServerPort(); if (serverHost == null || serverPort == 0) { throw new RuntimeException(String .format("Graphite cannot be initialized with serverHost[%s] and serverPort[%s].", serverHost, serverPort)); } this.graphiteReporter = createGraphiteReport(); }