use of com.amazon.dataprepper.plugins.buffer.blockingbuffer.BlockingBuffer in project data-prepper by opensearch-project.
the class ZipkinOpenSearchToOtel method getBuffer.
private static BlockingBuffer<Record<Object>> getBuffer() {
final HashMap<String, Object> integerHashMap = new HashMap<>();
integerHashMap.put("buffer_size", 5);
return new BlockingBuffer<>(new PluginSetting("blocking_buffer", integerHashMap));
}
use of com.amazon.dataprepper.plugins.buffer.blockingbuffer.BlockingBuffer in project data-prepper by opensearch-project.
the class OTelTraceSourceTest method getBuffer.
private BlockingBuffer<Record<Object>> getBuffer() {
final HashMap<String, Object> integerHashMap = new HashMap<>();
integerHashMap.put("buffer_size", 1);
integerHashMap.put("batch_size", 1);
return new BlockingBuffer<>(new PluginSetting("blocking_buffer", integerHashMap));
}
use of com.amazon.dataprepper.plugins.buffer.blockingbuffer.BlockingBuffer in project data-prepper by opensearch-project.
the class OTelMetricsSourceTest method getBuffer.
private BlockingBuffer<Record<ExportMetricsServiceRequest>> getBuffer() {
final HashMap<String, Object> integerHashMap = new HashMap<>();
integerHashMap.put("buffer_size", 1);
integerHashMap.put("batch_size", 1);
return new BlockingBuffer<>(new PluginSetting("blocking_buffer", integerHashMap));
}
use of com.amazon.dataprepper.plugins.buffer.blockingbuffer.BlockingBuffer in project data-prepper by opensearch-project.
the class PipelineTests method testPipelineState.
@Test
public void testPipelineState() {
final Source<Record<String>> testSource = new TestSource();
final TestSink testSink = new TestSink();
final Pipeline testPipeline = new Pipeline(TEST_PIPELINE_NAME, testSource, new BlockingBuffer(TEST_PIPELINE_NAME), Collections.emptyList(), Collections.singletonList(testSink), TEST_PROCESSOR_THREADS, TEST_READ_BATCH_TIMEOUT);
assertThat("Pipeline isStopRequested is expected to be false", testPipeline.isStopRequested(), is(false));
assertThat("Pipeline is expected to have a default buffer", testPipeline.getBuffer(), notNullValue());
assertTrue("Pipeline processors should be empty", testPipeline.getProcessorSets().isEmpty());
testPipeline.execute();
assertThat("Pipeline isStopRequested is expected to be false", testPipeline.isStopRequested(), is(false));
testPipeline.shutdown();
assertThat("Pipeline isStopRequested is expected to be true", testPipeline.isStopRequested(), is(true));
assertThat("Sink shutdown should be called", testSink.isShutdown, is(true));
}
use of com.amazon.dataprepper.plugins.buffer.blockingbuffer.BlockingBuffer in project data-prepper by opensearch-project.
the class PipelineTests method testPipelineStateWithPrepper.
@Test
public void testPipelineStateWithPrepper() {
final Source<Record<String>> testSource = new TestSource();
final TestSink testSink = new TestSink();
final TestProcessor testProcessor = new TestPrepper(new PluginSetting("test_processor", new HashMap<>()));
final Pipeline testPipeline = new Pipeline(TEST_PIPELINE_NAME, testSource, new BlockingBuffer(TEST_PIPELINE_NAME), Collections.singletonList(Collections.singletonList(testProcessor)), Collections.singletonList(testSink), TEST_PROCESSOR_THREADS, TEST_READ_BATCH_TIMEOUT);
assertThat("Pipeline isStopRequested is expected to be false", testPipeline.isStopRequested(), is(false));
assertThat("Pipeline is expected to have a default buffer", testPipeline.getBuffer(), notNullValue());
assertEquals("Pipeline processorSets size should be 1", 1, testPipeline.getProcessorSets().size());
testPipeline.execute();
assertThat("Pipeline isStopRequested is expected to be false", testPipeline.isStopRequested(), is(false));
testPipeline.shutdown();
assertThat("Pipeline isStopRequested is expected to be true", testPipeline.isStopRequested(), is(true));
assertThat("Sink shutdown should be called", testSink.isShutdown, is(true));
assertThat("Processor shutdown should be called", testProcessor.isShutdown, is(true));
}
Aggregations