public class NewtsWriter extends Object implements com.lmax.disruptor.WorkHandler<SampleBatchEvent>, org.springframework.beans.factory.DisposableBean
SampleRepository.
Calls to #insert() publish the samples to a ring buffer so
that they don't block while the data is being persisted.| Constructor and Description |
|---|
NewtsWriter(Integer maxBatchSize,
Integer ringBufferSize,
Integer numWriterThreads,
com.codahale.metrics.MetricRegistry registry) |
| Modifier and Type | Method and Description |
|---|---|
void |
destroy() |
void |
index(List<org.opennms.newts.api.Sample> samples) |
void |
insert(List<org.opennms.newts.api.Sample> samples) |
void |
onEvent(SampleBatchEvent event) |
void |
setIndexer(org.opennms.newts.api.search.Indexer indexer) |
void |
setSampleRepository(org.opennms.newts.api.SampleRepository sampleRepository) |
public void destroy()
throws Exception
destroy in interface org.springframework.beans.factory.DisposableBeanExceptionpublic void insert(List<org.opennms.newts.api.Sample> samples)
public void index(List<org.opennms.newts.api.Sample> samples)
public void onEvent(SampleBatchEvent event) throws Exception
onEvent in interface com.lmax.disruptor.WorkHandler<SampleBatchEvent>Exceptionpublic void setSampleRepository(org.opennms.newts.api.SampleRepository sampleRepository)
public void setIndexer(org.opennms.newts.api.search.Indexer indexer)
Copyright © 2020. All rights reserved.