Search in sources :

Example 1 with StreamingUpdateOptions

use of org.wikidata.query.rdf.updater.consumer.options.StreamingUpdateOptions in project wikidata-query-rdf by wikimedia.

the class StreamingUpdate method main.

public static void main(String[] args) {
    log.info("Starting StreamingUpdater");
    StreamingUpdateOptions options = OptionsUtils.handleOptions(StreamingUpdateOptions.class, args);
    MetricRegistry metrics = new MetricRegistry();
    JmxReporter reporter = JmxReporter.forRegistry(metrics).inDomain(options.metricDomain()).build();
    StreamingUpdaterConsumer updater = build(options, metrics);
    Thread streamingUpdaterThread = Thread.currentThread();
    streamingUpdaterThread.setUncaughtExceptionHandler((t, e) -> log.error("Uncaught exception in the updater thread: ", e));
    addShutdownHook(updater, streamingUpdaterThread, reporter);
    reporter.start();
    updater.run();
}
Also used : StreamingUpdateOptions(org.wikidata.query.rdf.updater.consumer.options.StreamingUpdateOptions) MetricRegistry(com.codahale.metrics.MetricRegistry) JmxReporter(com.codahale.metrics.jmx.JmxReporter)

Aggregations

MetricRegistry (com.codahale.metrics.MetricRegistry)1 JmxReporter (com.codahale.metrics.jmx.JmxReporter)1 StreamingUpdateOptions (org.wikidata.query.rdf.updater.consumer.options.StreamingUpdateOptions)1