From 83ac55a7da281fdd0784080edc2fd359cb3caa3a Mon Sep 17 00:00:00 2001 From: Andre Kurait Date: Thu, 9 May 2024 11:15:48 -0500 Subject: [PATCH] Fix Javadoc Signed-off-by: Andre Kurait --- .../StreamChannelConnectionCaptureSerializer.java | 4 ++-- .../utils/SequentialSpanCompressingReducer.java | 15 ++++++++++----- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/TrafficCapture/captureOffloader/src/main/java/org/opensearch/migrations/trafficcapture/StreamChannelConnectionCaptureSerializer.java b/TrafficCapture/captureOffloader/src/main/java/org/opensearch/migrations/trafficcapture/StreamChannelConnectionCaptureSerializer.java index 345c31f1d..65b4a0ec9 100644 --- a/TrafficCapture/captureOffloader/src/main/java/org/opensearch/migrations/trafficcapture/StreamChannelConnectionCaptureSerializer.java +++ b/TrafficCapture/captureOffloader/src/main/java/org/opensearch/migrations/trafficcapture/StreamChannelConnectionCaptureSerializer.java @@ -152,7 +152,7 @@ public int currentOutputStreamWriteableSpaceLeft() throws IOException { * it returns a completed future with null. * * @param requiredSize The size required to write to the current stream. - * @return CompletableFuture A future that completes immediately with null if there is enough space, + * @return CompletableFuture{@code } A future that completes immediately with null if there is enough space, * or completes with the future returned by flushCommitAndResetStream if a flush is needed. * @throws IOException if there are I/O errors when checking the stream's space or flushing. */ @@ -262,7 +262,7 @@ private void writeByteStringToCurrentStream(int fieldNum, String str) throws IOE * otherwise a continuation. Returns a CompletableFuture that resolves upon the stream's closure. * * @param isFinal Indicates if this should be the final operation on the stream. - * @return CompletableFuture A future that completes when the stream is closed. Returns null if already closed or no stream exists and 'isFinal' is false. + * @return CompletableFuture{@code } A future that completes when the stream is closed. Returns null if already closed or no stream exists and 'isFinal' is false. * @throws IOException if there are I/O errors during the operation. */ diff --git a/TrafficCapture/coreUtilities/src/main/java/org/opensearch/migrations/utils/SequentialSpanCompressingReducer.java b/TrafficCapture/coreUtilities/src/main/java/org/opensearch/migrations/utils/SequentialSpanCompressingReducer.java index a797059ec..35399dafe 100644 --- a/TrafficCapture/coreUtilities/src/main/java/org/opensearch/migrations/utils/SequentialSpanCompressingReducer.java +++ b/TrafficCapture/coreUtilities/src/main/java/org/opensearch/migrations/utils/SequentialSpanCompressingReducer.java @@ -3,11 +3,16 @@ import lombok.AllArgsConstructor; /** - * This class can be used to reduce a stream of Integers into a string (calling getFinalAccumulation()) To use - * ``` - * Stream<Integer>...reduce(new SequentialSpanCompressingReducer(-1), SequentialSpanCompressingReducer::addNext, - * (c, d) -> { throw new IllegalStateException("parallel streams aren't allowed"); }) - * ``` + * This class can be used to reduce a stream of Integers into a string (calling getFinalAccumulation()). + * + * Example usage: + *
{@code
+ * Stream stream = ...
+ * String result = stream.reduce(new SequentialSpanCompressingReducer(-1),
+ *                                SequentialSpanCompressingReducer::addNext,
+ *                                (c, d) -> { throw new IllegalStateException("parallel streams aren't allowed"); })
+ *                      .getFinalAccumulation();
+ * }
*/ @AllArgsConstructor public class SequentialSpanCompressingReducer {