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 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)
      • index

        public void index​(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
      • setTimeSeriesMetaDataDao

        public void setTimeSeriesMetaDataDao​(TimeSeriesMetaDataDao timeSeriesMetaDataDao)