Class TimeseriesWriter

  • All Implemented Interfaces:
    com.lmax.disruptor.WorkHandler<SampleBatchEvent>, org.springframework.beans.factory.DisposableBean

    public class TimeseriesWriter
    extends java.lang.Object
    implements com.lmax.disruptor.WorkHandler<SampleBatchEvent>, org.springframework.beans.factory.DisposableBean
    Used to write samples to the TimeSeriesStorage. Calls to publish the samples to a ring buffer so that they don't block while the data is being persisted.
    Author:
    jwhite
    • Constructor Summary

      Constructors 
      Constructor Description
      TimeseriesWriter​(java.lang.Integer ringBufferSize, java.lang.Integer numWriterThreads, com.codahale.metrics.MetricRegistry registry)  
    • Constructor Detail

      • TimeseriesWriter

        @Inject
        public TimeseriesWriter​(@Named("timeseries.ring_buffer_size")
                                java.lang.Integer ringBufferSize,
                                @Named("timeseries.writer_threads")
                                java.lang.Integer numWriterThreads,
                                @Named("timeseriesMetricRegistry")
                                com.codahale.metrics.MetricRegistry registry)
    • Method Detail

      • destroy

        public void destroy()
        Specified by:
        destroy in interface org.springframework.beans.factory.DisposableBean
      • insert

        public void insert​(java.util.List<org.opennms.integration.api.v1.timeseries.Sample> samples)
      • onEvent

        public void onEvent​(SampleBatchEvent event)
                     throws java.lang.Exception
        Specified by:
        onEvent in interface com.lmax.disruptor.WorkHandler<SampleBatchEvent>
        Throws:
        java.lang.Exception