Search in sources :

Example 1 with JavaClientAccumulatingBulkRequest

use of com.amazon.dataprepper.plugins.sink.opensearch.bulk.JavaClientAccumulatingBulkRequest in project data-prepper by opensearch-project.

the class BulkRetryStrategyTests method testExecuteSuccessOnFirstAttempt.

@Test
public void testExecuteSuccessOnFirstAttempt() throws Exception {
    final String testIndex = "bar";
    final FakeClient client = new FakeClient(testIndex);
    client.successOnFirstAttempt = true;
    final BulkRetryStrategy bulkRetryStrategy = new BulkRetryStrategy(client::bulk, logFailureConsumer, PLUGIN_METRICS, () -> new JavaClientAccumulatingBulkRequest(new BulkRequest.Builder()));
    final IndexOperation<SerializedJson> indexOperation1 = new IndexOperation.Builder<SerializedJson>().index(testIndex).id("1").document(arbitraryDocument()).build();
    final IndexOperation<SerializedJson> indexOperation2 = new IndexOperation.Builder<SerializedJson>().index(testIndex).id("2").document(arbitraryDocument()).build();
    final IndexOperation<SerializedJson> indexOperation3 = new IndexOperation.Builder<SerializedJson>().index(testIndex).id("3").document(arbitraryDocument()).build();
    final IndexOperation<SerializedJson> indexOperation4 = new IndexOperation.Builder<SerializedJson>().index(testIndex).id("4").document(arbitraryDocument()).build();
    final AccumulatingBulkRequest accumulatingBulkRequest = new JavaClientAccumulatingBulkRequest(new BulkRequest.Builder());
    accumulatingBulkRequest.addOperation(new BulkOperation.Builder().index(indexOperation1).build());
    accumulatingBulkRequest.addOperation(new BulkOperation.Builder().index(indexOperation2).build());
    accumulatingBulkRequest.addOperation(new BulkOperation.Builder().index(indexOperation3).build());
    accumulatingBulkRequest.addOperation(new BulkOperation.Builder().index(indexOperation4).build());
    bulkRetryStrategy.execute(accumulatingBulkRequest);
    assertEquals(1, client.attempt);
    // verify metrics
    final List<Measurement> documentsSuccessFirstAttemptMeasurements = MetricsTestUtil.getMeasurementList(new StringJoiner(MetricNames.DELIMITER).add(PIPELINE_NAME).add(PLUGIN_NAME).add(BulkRetryStrategy.DOCUMENTS_SUCCESS_FIRST_ATTEMPT).toString());
    assertEquals(1, documentsSuccessFirstAttemptMeasurements.size());
    assertEquals(4.0, documentsSuccessFirstAttemptMeasurements.get(0).getValue(), 0);
    final List<Measurement> documentsSuccessMeasurements = MetricsTestUtil.getMeasurementList(new StringJoiner(MetricNames.DELIMITER).add(PIPELINE_NAME).add(PLUGIN_NAME).add(BulkRetryStrategy.DOCUMENTS_SUCCESS).toString());
    assertEquals(1, documentsSuccessMeasurements.size());
    assertEquals(4.0, documentsSuccessMeasurements.get(0).getValue(), 0);
}
Also used : Measurement(io.micrometer.core.instrument.Measurement) JavaClientAccumulatingBulkRequest(com.amazon.dataprepper.plugins.sink.opensearch.bulk.JavaClientAccumulatingBulkRequest) BulkOperation(org.opensearch.client.opensearch.core.bulk.BulkOperation) SerializedJson(com.amazon.dataprepper.plugins.sink.opensearch.bulk.SerializedJson) AccumulatingBulkRequest(com.amazon.dataprepper.plugins.sink.opensearch.bulk.AccumulatingBulkRequest) JavaClientAccumulatingBulkRequest(com.amazon.dataprepper.plugins.sink.opensearch.bulk.JavaClientAccumulatingBulkRequest) BulkRequest(org.opensearch.client.opensearch.core.BulkRequest) AccumulatingBulkRequest(com.amazon.dataprepper.plugins.sink.opensearch.bulk.AccumulatingBulkRequest) JavaClientAccumulatingBulkRequest(com.amazon.dataprepper.plugins.sink.opensearch.bulk.JavaClientAccumulatingBulkRequest) StringJoiner(java.util.StringJoiner) Test(org.junit.jupiter.api.Test)

Example 2 with JavaClientAccumulatingBulkRequest

use of com.amazon.dataprepper.plugins.sink.opensearch.bulk.JavaClientAccumulatingBulkRequest in project data-prepper by opensearch-project.

the class OpenSearchSink method initialize.

public void initialize() throws IOException {
    LOG.info("Initializing OpenSearch sink");
    restHighLevelClient = openSearchSinkConfig.getConnectionConfiguration().createClient();
    indexManager = indexManagerFactory.getIndexManager(indexType, restHighLevelClient, openSearchSinkConfig);
    final String dlqFile = openSearchSinkConfig.getRetryConfiguration().getDlqFile();
    if (dlqFile != null) {
        dlqWriter = Files.newBufferedWriter(Paths.get(dlqFile), StandardOpenOption.CREATE, StandardOpenOption.APPEND);
    }
    indexManager.setupIndex();
    OpenSearchTransport transport = new RestClientTransport(restHighLevelClient.getLowLevelClient(), new PreSerializedJsonpMapper());
    openSearchClient = new OpenSearchClient(transport);
    bulkRequestSupplier = () -> new JavaClientAccumulatingBulkRequest(new BulkRequest.Builder().index(indexManager.getIndexAlias()));
    bulkRetryStrategy = new BulkRetryStrategy(bulkRequest -> openSearchClient.bulk(bulkRequest.getRequest()), this::logFailure, pluginMetrics, bulkRequestSupplier);
    LOG.info("Initialized OpenSearch sink");
    objectMapper = new ObjectMapper();
}
Also used : IndexManager(com.amazon.dataprepper.plugins.sink.opensearch.index.IndexManager) LoggerFactory(org.slf4j.LoggerFactory) ByteSizeUnit(org.opensearch.common.unit.ByteSizeUnit) PreSerializedJsonpMapper(com.amazon.dataprepper.plugins.sink.opensearch.bulk.PreSerializedJsonpMapper) IndexType(com.amazon.dataprepper.plugins.sink.opensearch.index.IndexType) Supplier(java.util.function.Supplier) AbstractSink(com.amazon.dataprepper.model.sink.AbstractSink) BulkRequest(org.opensearch.client.opensearch.core.BulkRequest) BulkOperation(org.opensearch.client.opensearch.core.bulk.BulkOperation) XContentParser(org.opensearch.common.xcontent.XContentParser) Timer(io.micrometer.core.instrument.Timer) IndexManagerFactory(com.amazon.dataprepper.plugins.sink.opensearch.index.IndexManagerFactory) RestClientTransport(org.opensearch.client.transport.rest_client.RestClientTransport) BulkOperationWriter(com.amazon.dataprepper.plugins.sink.opensearch.bulk.BulkOperationWriter) Map(java.util.Map) XContentFactory(org.opensearch.common.xcontent.XContentFactory) Record(com.amazon.dataprepper.model.record.Record) RestHighLevelClient(org.opensearch.client.RestHighLevelClient) Counter(io.micrometer.core.instrument.Counter) PluginSetting(com.amazon.dataprepper.model.configuration.PluginSetting) AccumulatingBulkRequest(com.amazon.dataprepper.plugins.sink.opensearch.bulk.AccumulatingBulkRequest) JavaClientAccumulatingBulkRequest(com.amazon.dataprepper.plugins.sink.opensearch.bulk.JavaClientAccumulatingBulkRequest) Logger(org.slf4j.Logger) Sink(com.amazon.dataprepper.model.sink.Sink) Files(java.nio.file.Files) BufferedWriter(java.io.BufferedWriter) IndexOperation(org.opensearch.client.opensearch.core.bulk.IndexOperation) Collection(java.util.Collection) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) LoggingDeprecationHandler(org.opensearch.common.xcontent.LoggingDeprecationHandler) StandardOpenOption(java.nio.file.StandardOpenOption) SerializedJson(com.amazon.dataprepper.plugins.sink.opensearch.bulk.SerializedJson) OpenSearchClient(org.opensearch.client.opensearch.OpenSearchClient) IOException(java.io.IOException) OpenSearchTransport(org.opensearch.client.transport.OpenSearchTransport) Event(com.amazon.dataprepper.model.event.Event) DistributionSummary(io.micrometer.core.instrument.DistributionSummary) Paths(java.nio.file.Paths) NamedXContentRegistry(org.opensearch.common.xcontent.NamedXContentRegistry) XContentType(org.opensearch.common.xcontent.XContentType) DataPrepperPlugin(com.amazon.dataprepper.model.annotations.DataPrepperPlugin) RestClientTransport(org.opensearch.client.transport.rest_client.RestClientTransport) JavaClientAccumulatingBulkRequest(com.amazon.dataprepper.plugins.sink.opensearch.bulk.JavaClientAccumulatingBulkRequest) BulkRequest(org.opensearch.client.opensearch.core.BulkRequest) AccumulatingBulkRequest(com.amazon.dataprepper.plugins.sink.opensearch.bulk.AccumulatingBulkRequest) JavaClientAccumulatingBulkRequest(com.amazon.dataprepper.plugins.sink.opensearch.bulk.JavaClientAccumulatingBulkRequest) PreSerializedJsonpMapper(com.amazon.dataprepper.plugins.sink.opensearch.bulk.PreSerializedJsonpMapper) OpenSearchClient(org.opensearch.client.opensearch.OpenSearchClient) OpenSearchTransport(org.opensearch.client.transport.OpenSearchTransport) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper)

Example 3 with JavaClientAccumulatingBulkRequest

use of com.amazon.dataprepper.plugins.sink.opensearch.bulk.JavaClientAccumulatingBulkRequest in project data-prepper by opensearch-project.

the class BulkRetryStrategyTests method testExecuteNonRetryableResponse.

@Test
public void testExecuteNonRetryableResponse() throws Exception {
    final String testIndex = "bar";
    final FakeClient client = new FakeClient(testIndex);
    client.retryable = false;
    client.nonRetryableException = false;
    final BulkRetryStrategy bulkRetryStrategy = new BulkRetryStrategy(client::bulk, logFailureConsumer, PLUGIN_METRICS, () -> new JavaClientAccumulatingBulkRequest(new BulkRequest.Builder()));
    final IndexOperation<SerializedJson> indexOperation1 = new IndexOperation.Builder<SerializedJson>().index(testIndex).id("1").document(arbitraryDocument()).build();
    final IndexOperation<SerializedJson> indexOperation2 = new IndexOperation.Builder<SerializedJson>().index(testIndex).id("2").document(arbitraryDocument()).build();
    final IndexOperation<SerializedJson> indexOperation3 = new IndexOperation.Builder<SerializedJson>().index(testIndex).id("3").document(arbitraryDocument()).build();
    final IndexOperation<SerializedJson> indexOperation4 = new IndexOperation.Builder<SerializedJson>().index(testIndex).id("4").document(arbitraryDocument()).build();
    final AccumulatingBulkRequest accumulatingBulkRequest = new JavaClientAccumulatingBulkRequest(new BulkRequest.Builder());
    accumulatingBulkRequest.addOperation(new BulkOperation.Builder().index(indexOperation1).build());
    accumulatingBulkRequest.addOperation(new BulkOperation.Builder().index(indexOperation2).build());
    accumulatingBulkRequest.addOperation(new BulkOperation.Builder().index(indexOperation3).build());
    accumulatingBulkRequest.addOperation(new BulkOperation.Builder().index(indexOperation4).build());
    bulkRetryStrategy.execute(accumulatingBulkRequest);
    assertEquals(1, client.attempt);
    ArgumentCaptor<BulkOperation> loggerWriteRequestArgCaptor = ArgumentCaptor.forClass(BulkOperation.class);
    ArgumentCaptor<Throwable> loggerExceptionArgCaptor = ArgumentCaptor.forClass(Throwable.class);
    verify(logFailureConsumer, times(3)).accept(loggerWriteRequestArgCaptor.capture(), isA(RuntimeException.class));
    final List<BulkOperation> allLoggerWriteRequests = loggerWriteRequestArgCaptor.getAllValues();
    for (int i = 0; i < allLoggerWriteRequests.size(); i++) {
        final BulkOperation actualFailedWrite = allLoggerWriteRequests.get(i);
        MatcherAssert.assertThat(actualFailedWrite.index().index(), equalTo(testIndex));
        String expectedIndexName = Integer.toString(i + 2);
        MatcherAssert.assertThat(actualFailedWrite.index().id(), equalTo(expectedIndexName));
    }
    // verify metrics
    final List<Measurement> documentsSuccessMeasurements = MetricsTestUtil.getMeasurementList(new StringJoiner(MetricNames.DELIMITER).add(PIPELINE_NAME).add(PLUGIN_NAME).add(BulkRetryStrategy.DOCUMENTS_SUCCESS).toString());
    assertEquals(1, documentsSuccessMeasurements.size());
    assertEquals(1.0, documentsSuccessMeasurements.get(0).getValue(), 0);
    final List<Measurement> documentErrorsMeasurements = MetricsTestUtil.getMeasurementList(new StringJoiner(MetricNames.DELIMITER).add(PIPELINE_NAME).add(PLUGIN_NAME).add(BulkRetryStrategy.DOCUMENT_ERRORS).toString());
    assertEquals(1, documentErrorsMeasurements.size());
    assertEquals(3.0, documentErrorsMeasurements.get(0).getValue(), 0);
}
Also used : Measurement(io.micrometer.core.instrument.Measurement) JavaClientAccumulatingBulkRequest(com.amazon.dataprepper.plugins.sink.opensearch.bulk.JavaClientAccumulatingBulkRequest) BulkOperation(org.opensearch.client.opensearch.core.bulk.BulkOperation) SerializedJson(com.amazon.dataprepper.plugins.sink.opensearch.bulk.SerializedJson) AccumulatingBulkRequest(com.amazon.dataprepper.plugins.sink.opensearch.bulk.AccumulatingBulkRequest) JavaClientAccumulatingBulkRequest(com.amazon.dataprepper.plugins.sink.opensearch.bulk.JavaClientAccumulatingBulkRequest) BulkRequest(org.opensearch.client.opensearch.core.BulkRequest) AccumulatingBulkRequest(com.amazon.dataprepper.plugins.sink.opensearch.bulk.AccumulatingBulkRequest) JavaClientAccumulatingBulkRequest(com.amazon.dataprepper.plugins.sink.opensearch.bulk.JavaClientAccumulatingBulkRequest) StringJoiner(java.util.StringJoiner) Test(org.junit.jupiter.api.Test)

Example 4 with JavaClientAccumulatingBulkRequest

use of com.amazon.dataprepper.plugins.sink.opensearch.bulk.JavaClientAccumulatingBulkRequest in project data-prepper by opensearch-project.

the class BulkRetryStrategyTests method testExecuteRetryable.

@Test
public void testExecuteRetryable() throws Exception {
    final String testIndex = "bar";
    final FakeClient client = new FakeClient(testIndex);
    final BulkRetryStrategy bulkRetryStrategy = new BulkRetryStrategy(client::bulk, logFailureConsumer, PLUGIN_METRICS, () -> new JavaClientAccumulatingBulkRequest(new BulkRequest.Builder()));
    final IndexOperation<SerializedJson> indexOperation1 = new IndexOperation.Builder<SerializedJson>().index(testIndex).id("1").document(arbitraryDocument()).build();
    final IndexOperation<SerializedJson> indexOperation2 = new IndexOperation.Builder<SerializedJson>().index(testIndex).id("2").document(arbitraryDocument()).build();
    final IndexOperation<SerializedJson> indexOperation3 = new IndexOperation.Builder<SerializedJson>().index(testIndex).id("3").document(arbitraryDocument()).build();
    final IndexOperation<SerializedJson> indexOperation4 = new IndexOperation.Builder<SerializedJson>().index(testIndex).id("4").document(arbitraryDocument()).build();
    final AccumulatingBulkRequest accumulatingBulkRequest = new JavaClientAccumulatingBulkRequest(new BulkRequest.Builder());
    accumulatingBulkRequest.addOperation(new BulkOperation.Builder().index(indexOperation1).build());
    accumulatingBulkRequest.addOperation(new BulkOperation.Builder().index(indexOperation2).build());
    accumulatingBulkRequest.addOperation(new BulkOperation.Builder().index(indexOperation3).build());
    accumulatingBulkRequest.addOperation(new BulkOperation.Builder().index(indexOperation4).build());
    bulkRetryStrategy.execute(accumulatingBulkRequest);
    assertEquals(3, client.attempt);
    assertEquals(2, client.finalResponse.items().size());
    assertFalse(client.finalResponse.errors());
    assertEquals("3", client.finalRequest.operations().get(0).index().id());
    assertEquals("4", client.finalRequest.operations().get(1).index().id());
    ArgumentCaptor<BulkOperation> loggerWriteRequestArgCaptor = ArgumentCaptor.forClass(BulkOperation.class);
    ArgumentCaptor<Throwable> loggerThrowableArgCaptor = ArgumentCaptor.forClass(Throwable.class);
    verify(logFailureConsumer).accept(loggerWriteRequestArgCaptor.capture(), loggerThrowableArgCaptor.capture());
    MatcherAssert.assertThat(loggerWriteRequestArgCaptor.getValue(), notNullValue());
    MatcherAssert.assertThat(loggerWriteRequestArgCaptor.getValue().index().index(), equalTo(testIndex));
    MatcherAssert.assertThat(loggerWriteRequestArgCaptor.getValue().index().id(), equalTo("2"));
    MatcherAssert.assertThat(loggerThrowableArgCaptor.getValue(), notNullValue());
    // verify metrics
    final List<Measurement> documentsSuccessFirstAttemptMeasurements = MetricsTestUtil.getMeasurementList(new StringJoiner(MetricNames.DELIMITER).add(PIPELINE_NAME).add(PLUGIN_NAME).add(BulkRetryStrategy.DOCUMENTS_SUCCESS_FIRST_ATTEMPT).toString());
    assertEquals(1, documentsSuccessFirstAttemptMeasurements.size());
    assertEquals(1.0, documentsSuccessFirstAttemptMeasurements.get(0).getValue(), 0);
    final List<Measurement> documentsSuccessMeasurements = MetricsTestUtil.getMeasurementList(new StringJoiner(MetricNames.DELIMITER).add(PIPELINE_NAME).add(PLUGIN_NAME).add(BulkRetryStrategy.DOCUMENTS_SUCCESS).toString());
    assertEquals(1, documentsSuccessMeasurements.size());
    assertEquals(3.0, documentsSuccessMeasurements.get(0).getValue(), 0);
    final List<Measurement> documentErrorsMeasurements = MetricsTestUtil.getMeasurementList(new StringJoiner(MetricNames.DELIMITER).add(PIPELINE_NAME).add(PLUGIN_NAME).add(BulkRetryStrategy.DOCUMENT_ERRORS).toString());
    assertEquals(1, documentErrorsMeasurements.size());
    assertEquals(1.0, documentErrorsMeasurements.get(0).getValue(), 0);
}
Also used : Measurement(io.micrometer.core.instrument.Measurement) JavaClientAccumulatingBulkRequest(com.amazon.dataprepper.plugins.sink.opensearch.bulk.JavaClientAccumulatingBulkRequest) BulkOperation(org.opensearch.client.opensearch.core.bulk.BulkOperation) SerializedJson(com.amazon.dataprepper.plugins.sink.opensearch.bulk.SerializedJson) AccumulatingBulkRequest(com.amazon.dataprepper.plugins.sink.opensearch.bulk.AccumulatingBulkRequest) JavaClientAccumulatingBulkRequest(com.amazon.dataprepper.plugins.sink.opensearch.bulk.JavaClientAccumulatingBulkRequest) BulkRequest(org.opensearch.client.opensearch.core.BulkRequest) AccumulatingBulkRequest(com.amazon.dataprepper.plugins.sink.opensearch.bulk.AccumulatingBulkRequest) JavaClientAccumulatingBulkRequest(com.amazon.dataprepper.plugins.sink.opensearch.bulk.JavaClientAccumulatingBulkRequest) StringJoiner(java.util.StringJoiner) Test(org.junit.jupiter.api.Test)

Example 5 with JavaClientAccumulatingBulkRequest

use of com.amazon.dataprepper.plugins.sink.opensearch.bulk.JavaClientAccumulatingBulkRequest in project data-prepper by opensearch-project.

the class BulkRetryStrategyTests method testExecuteNonRetryableException.

@Test
public void testExecuteNonRetryableException() throws Exception {
    final String testIndex = "bar";
    final FakeClient client = new FakeClient(testIndex);
    client.retryable = false;
    final BulkRetryStrategy bulkRetryStrategy = new BulkRetryStrategy(client::bulk, logFailureConsumer, PLUGIN_METRICS, () -> new JavaClientAccumulatingBulkRequest(new BulkRequest.Builder()));
    final IndexOperation<SerializedJson> indexOperation1 = new IndexOperation.Builder<SerializedJson>().index(testIndex).id("1").document(arbitraryDocument()).build();
    final IndexOperation<SerializedJson> indexOperation2 = new IndexOperation.Builder<SerializedJson>().index(testIndex).id("2").document(arbitraryDocument()).build();
    final IndexOperation<SerializedJson> indexOperation3 = new IndexOperation.Builder<SerializedJson>().index(testIndex).id("3").document(arbitraryDocument()).build();
    final IndexOperation<SerializedJson> indexOperation4 = new IndexOperation.Builder<SerializedJson>().index(testIndex).id("4").document(arbitraryDocument()).build();
    final AccumulatingBulkRequest accumulatingBulkRequest = new JavaClientAccumulatingBulkRequest(new BulkRequest.Builder());
    accumulatingBulkRequest.addOperation(new BulkOperation.Builder().index(indexOperation1).build());
    accumulatingBulkRequest.addOperation(new BulkOperation.Builder().index(indexOperation2).build());
    accumulatingBulkRequest.addOperation(new BulkOperation.Builder().index(indexOperation3).build());
    accumulatingBulkRequest.addOperation(new BulkOperation.Builder().index(indexOperation4).build());
    bulkRetryStrategy.execute(accumulatingBulkRequest);
    assertEquals(1, client.attempt);
    ArgumentCaptor<BulkOperation> loggerWriteRequestArgCaptor = ArgumentCaptor.forClass(BulkOperation.class);
    ArgumentCaptor<Throwable> loggerExceptionArgCaptor = ArgumentCaptor.forClass(Throwable.class);
    verify(logFailureConsumer, times(4)).accept(loggerWriteRequestArgCaptor.capture(), isA(IllegalArgumentException.class));
    final List<BulkOperation> allLoggerWriteRequests = loggerWriteRequestArgCaptor.getAllValues();
    for (int i = 0; i < allLoggerWriteRequests.size(); i++) {
        final BulkOperation actualFailedWrite = allLoggerWriteRequests.get(i);
        MatcherAssert.assertThat(actualFailedWrite.index().index(), equalTo(testIndex));
        String expectedIndexName = Integer.toString(i + 1);
        MatcherAssert.assertThat(actualFailedWrite.index().id(), equalTo(expectedIndexName));
    }
    // verify metrics
    final List<Measurement> documentsSuccessMeasurements = MetricsTestUtil.getMeasurementList(new StringJoiner(MetricNames.DELIMITER).add(PIPELINE_NAME).add(PLUGIN_NAME).add(BulkRetryStrategy.DOCUMENTS_SUCCESS).toString());
    assertEquals(1, documentsSuccessMeasurements.size());
    assertEquals(0.0, documentsSuccessMeasurements.get(0).getValue(), 0);
    final List<Measurement> documentErrorsMeasurements = MetricsTestUtil.getMeasurementList(new StringJoiner(MetricNames.DELIMITER).add(PIPELINE_NAME).add(PLUGIN_NAME).add(BulkRetryStrategy.DOCUMENT_ERRORS).toString());
    assertEquals(1, documentErrorsMeasurements.size());
    assertEquals(4.0, documentErrorsMeasurements.get(0).getValue(), 0);
}
Also used : Measurement(io.micrometer.core.instrument.Measurement) JavaClientAccumulatingBulkRequest(com.amazon.dataprepper.plugins.sink.opensearch.bulk.JavaClientAccumulatingBulkRequest) BulkOperation(org.opensearch.client.opensearch.core.bulk.BulkOperation) SerializedJson(com.amazon.dataprepper.plugins.sink.opensearch.bulk.SerializedJson) AccumulatingBulkRequest(com.amazon.dataprepper.plugins.sink.opensearch.bulk.AccumulatingBulkRequest) JavaClientAccumulatingBulkRequest(com.amazon.dataprepper.plugins.sink.opensearch.bulk.JavaClientAccumulatingBulkRequest) BulkRequest(org.opensearch.client.opensearch.core.BulkRequest) AccumulatingBulkRequest(com.amazon.dataprepper.plugins.sink.opensearch.bulk.AccumulatingBulkRequest) JavaClientAccumulatingBulkRequest(com.amazon.dataprepper.plugins.sink.opensearch.bulk.JavaClientAccumulatingBulkRequest) StringJoiner(java.util.StringJoiner) Test(org.junit.jupiter.api.Test)

Aggregations

AccumulatingBulkRequest (com.amazon.dataprepper.plugins.sink.opensearch.bulk.AccumulatingBulkRequest)5 JavaClientAccumulatingBulkRequest (com.amazon.dataprepper.plugins.sink.opensearch.bulk.JavaClientAccumulatingBulkRequest)5 SerializedJson (com.amazon.dataprepper.plugins.sink.opensearch.bulk.SerializedJson)5 BulkRequest (org.opensearch.client.opensearch.core.BulkRequest)5 BulkOperation (org.opensearch.client.opensearch.core.bulk.BulkOperation)5 Measurement (io.micrometer.core.instrument.Measurement)4 StringJoiner (java.util.StringJoiner)4 Test (org.junit.jupiter.api.Test)4 DataPrepperPlugin (com.amazon.dataprepper.model.annotations.DataPrepperPlugin)1 PluginSetting (com.amazon.dataprepper.model.configuration.PluginSetting)1 Event (com.amazon.dataprepper.model.event.Event)1 Record (com.amazon.dataprepper.model.record.Record)1 AbstractSink (com.amazon.dataprepper.model.sink.AbstractSink)1 Sink (com.amazon.dataprepper.model.sink.Sink)1 BulkOperationWriter (com.amazon.dataprepper.plugins.sink.opensearch.bulk.BulkOperationWriter)1 PreSerializedJsonpMapper (com.amazon.dataprepper.plugins.sink.opensearch.bulk.PreSerializedJsonpMapper)1 IndexManager (com.amazon.dataprepper.plugins.sink.opensearch.index.IndexManager)1 IndexManagerFactory (com.amazon.dataprepper.plugins.sink.opensearch.index.IndexManagerFactory)1 IndexType (com.amazon.dataprepper.plugins.sink.opensearch.index.IndexType)1 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1