From e90bf5b3ca7d066afc27ce96564fc31e6e47aa0d Mon Sep 17 00:00:00 2001 From: Amanda Xiang Date: Thu, 2 Jan 2025 12:31:33 +0100 Subject: [PATCH] Fix JavaDoc and Checkstyle errors Signed-off-by: Amanda Xiang --- .../source/neptune/client/NeptuneStreamEventListener.java | 6 +++--- .../neptune/converter/NeptuneStreamRecordValidator.java | 4 ++-- .../neptune/stream/DataStreamPartitionCheckpoint.java | 1 + .../source/neptune/stream/StreamAcknowledgementManager.java | 1 - .../plugins/source/neptune/stream/StreamWorkerTest.java | 5 ----- 5 files changed, 6 insertions(+), 11 deletions(-) diff --git a/data-prepper-plugins/neptune-source/src/main/java/org/opensearch/dataprepper/plugins/source/neptune/client/NeptuneStreamEventListener.java b/data-prepper-plugins/neptune-source/src/main/java/org/opensearch/dataprepper/plugins/source/neptune/client/NeptuneStreamEventListener.java index a5e9951d92..6b3deee4b9 100644 --- a/data-prepper-plugins/neptune-source/src/main/java/org/opensearch/dataprepper/plugins/source/neptune/client/NeptuneStreamEventListener.java +++ b/data-prepper-plugins/neptune-source/src/main/java/org/opensearch/dataprepper/plugins/source/neptune/client/NeptuneStreamEventListener.java @@ -24,15 +24,15 @@ public interface NeptuneStreamEventListener { /** * - * @param exception - * @param streamPosition current commitNum and OpNum in the stream. + * @param exception any encountered exception during stream processing + * @param streamPosition current commitNum and OpNum in the stream * @return boolean if the execution should continue after that exception is encountered. */ boolean onNeptuneStreamException(final Exception exception, final StreamPosition streamPosition); /** * - * @param streamPosition + * @param streamPosition current commitNum and OpNum in the stream * @return boolean if stream processing should be stopped */ boolean shouldStopNeptuneStream(final StreamPosition streamPosition); diff --git a/data-prepper-plugins/neptune-source/src/main/java/org/opensearch/dataprepper/plugins/source/neptune/converter/NeptuneStreamRecordValidator.java b/data-prepper-plugins/neptune-source/src/main/java/org/opensearch/dataprepper/plugins/source/neptune/converter/NeptuneStreamRecordValidator.java index e31588691d..955b68e86e 100644 --- a/data-prepper-plugins/neptune-source/src/main/java/org/opensearch/dataprepper/plugins/source/neptune/converter/NeptuneStreamRecordValidator.java +++ b/data-prepper-plugins/neptune-source/src/main/java/org/opensearch/dataprepper/plugins/source/neptune/converter/NeptuneStreamRecordValidator.java @@ -29,8 +29,8 @@ /** * Validates if the record from Neptune Streams is a valid record. - * (1) If {@link NeptuneSourceConfig#isEnableNonStringIndexing()} is true, then all datatypes are valid and mapped to - * OS datatypes as defined in https://docs.aws.amazon.com/neptune/latest/userguide/full-text-search-non-string-indexing-mapping.html. + * (1) If enableNonStringIndexing in {@link NeptuneSourceConfig} is true, then all datatypes are valid and mapped to + * OS datatypes as defined in Mapping of SPARQL and Gremlin datatypes to OpenSearch * (2) Otherwise, only String datatypes are supported and any non-string record is dropped. */ public class NeptuneStreamRecordValidator { diff --git a/data-prepper-plugins/neptune-source/src/main/java/org/opensearch/dataprepper/plugins/source/neptune/stream/DataStreamPartitionCheckpoint.java b/data-prepper-plugins/neptune-source/src/main/java/org/opensearch/dataprepper/plugins/source/neptune/stream/DataStreamPartitionCheckpoint.java index 3b8313ce24..a0ad8f2a2b 100644 --- a/data-prepper-plugins/neptune-source/src/main/java/org/opensearch/dataprepper/plugins/source/neptune/stream/DataStreamPartitionCheckpoint.java +++ b/data-prepper-plugins/neptune-source/src/main/java/org/opensearch/dataprepper/plugins/source/neptune/stream/DataStreamPartitionCheckpoint.java @@ -48,6 +48,7 @@ private void setProgressState(final StreamCheckpoint progress) { * Note that this should be called on a regular basis even there are no changes to resume token * As the checkpoint will also extend the timeout for the lease * + * @param checkpointProgress checkpoint progress object, including info e.g. stream position, record count */ public void checkpoint(final StreamCheckpoint checkpointProgress) { LOG.debug("Checkpoint stream partition with record number {}", checkpointProgress.getRecordCount()); diff --git a/data-prepper-plugins/neptune-source/src/main/java/org/opensearch/dataprepper/plugins/source/neptune/stream/StreamAcknowledgementManager.java b/data-prepper-plugins/neptune-source/src/main/java/org/opensearch/dataprepper/plugins/source/neptune/stream/StreamAcknowledgementManager.java index cddb57e2cb..2d1522a3d2 100644 --- a/data-prepper-plugins/neptune-source/src/main/java/org/opensearch/dataprepper/plugins/source/neptune/stream/StreamAcknowledgementManager.java +++ b/data-prepper-plugins/neptune-source/src/main/java/org/opensearch/dataprepper/plugins/source/neptune/stream/StreamAcknowledgementManager.java @@ -7,7 +7,6 @@ import org.opensearch.dataprepper.plugins.source.neptune.stream.model.StreamCheckpoint; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import software.amazon.awssdk.services.s3.endpoints.internal.Value; import java.time.Duration; import java.time.Instant; diff --git a/data-prepper-plugins/neptune-source/src/test/java/org/opensearch/dataprepper/plugins/source/neptune/stream/StreamWorkerTest.java b/data-prepper-plugins/neptune-source/src/test/java/org/opensearch/dataprepper/plugins/source/neptune/stream/StreamWorkerTest.java index 99097b5954..c11cff8f0b 100644 --- a/data-prepper-plugins/neptune-source/src/test/java/org/opensearch/dataprepper/plugins/source/neptune/stream/StreamWorkerTest.java +++ b/data-prepper-plugins/neptune-source/src/test/java/org/opensearch/dataprepper/plugins/source/neptune/stream/StreamWorkerTest.java @@ -3,7 +3,6 @@ import io.micrometer.core.instrument.Counter; import io.micrometer.core.instrument.DistributionSummary; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; @@ -14,13 +13,9 @@ import org.opensearch.dataprepper.plugins.source.neptune.converter.StreamRecordConverter; import org.opensearch.dataprepper.plugins.source.neptune.coordination.partition.StreamPartition; import org.opensearch.dataprepper.plugins.source.neptune.coordination.state.StreamProgressState; -import org.opensearch.dataprepper.plugins.source.neptune.model.S3PartitionStatus; -import java.util.List; -import java.util.Optional; import java.util.Random; -import static org.junit.jupiter.api.Assertions.assertThrows; import static org.mockito.Mockito.when; import static org.opensearch.dataprepper.plugins.source.neptune.stream.StreamWorker.BYTES_PROCESSED; import static org.opensearch.dataprepper.plugins.source.neptune.stream.StreamWorker.BYTES_RECEIVED;