From 1dc7e2bd24643d3c1047d01852efb2ef85f043ae Mon Sep 17 00:00:00 2001 From: Mashhur Date: Wed, 8 Apr 2026 16:53:34 -0700 Subject: [PATCH 1/7] Optimize DLQ segment directory scans with single-pass DirectoryStream lookups Replace listSegmentPathsSortedBySegmentId (which materialized all paths, sorted O(N log N), then took the first element) with purpose-built maxSegmentId and oldestSegmentPath utilities that use Files.newDirectoryStream with OS-level glob filtering and a single O(N) pass. Also narrow listFiles to compare only the filename component instead of the full path, and consolidate duplicate segment ID parsing in DeadLetterQueueWriter to reuse extractSegmentId. --- .../common/io/DeadLetterQueueUtils.java | 43 ++++++++++++++++--- .../common/io/DeadLetterQueueWriter.java | 20 +++------ 2 files changed, 44 insertions(+), 19 deletions(-) diff --git a/logstash-core/src/main/java/org/logstash/common/io/DeadLetterQueueUtils.java b/logstash-core/src/main/java/org/logstash/common/io/DeadLetterQueueUtils.java index 06a6a507462..5daab900864 100644 --- a/logstash-core/src/main/java/org/logstash/common/io/DeadLetterQueueUtils.java +++ b/logstash-core/src/main/java/org/logstash/common/io/DeadLetterQueueUtils.java @@ -24,10 +24,11 @@ import java.io.IOException; import java.nio.ByteBuffer; import java.nio.channels.FileChannel; +import java.nio.file.DirectoryStream; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.StandardOpenOption; -import java.util.Comparator; +import java.util.Optional; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -48,7 +49,7 @@ static int extractSegmentId(final Path p) { static Stream listFiles(Path path, String suffix) throws IOException { try(final Stream files = Files.list(path)) { - return files.filter(p -> p.toString().endsWith(suffix)) + return files.filter(p -> p.getFileName().toString().endsWith(suffix)) .collect(Collectors.toList()).stream(); } } @@ -57,9 +58,41 @@ static Stream listSegmentPaths(Path path) throws IOException { return listFiles(path, ".log"); } - static Stream listSegmentPathsSortedBySegmentId(Path path) throws IOException { - return listSegmentPaths(path) - .sorted(Comparator.comparingInt(DeadLetterQueueUtils::extractSegmentId)); + /** + * Single-pass scan using OS-level glob filtering; avoids materializing + * all paths into a collection when only the numeric maximum is needed. + */ + static int maxSegmentId(Path path) throws IOException { + int max = 0; + try (DirectoryStream stream = Files.newDirectoryStream(path, "*.log")) { + for (Path p : stream) { + max = Math.max(max, extractSegmentId(p)); + } + } + return max; + } + + /** + * Single-pass scan that finds the segment path with the smallest segment ID, + * optionally skipping entries that don't satisfy {@code minFileSize}. `minFileSize` is to take files that have content to process. + * Returns empty when no matching segment exists. + */ + static Optional oldestSegmentPath(Path path, long minFileSize) throws IOException { + Path oldest = null; + int oldestId = Integer.MAX_VALUE; + try (DirectoryStream stream = Files.newDirectoryStream(path, "*.log")) { + for (Path p : stream) { + if (minFileSize > 0 && p.toFile().length() <= minFileSize) { + continue; + } + int id = extractSegmentId(p); + if (id < oldestId) { + oldestId = id; + oldest = p; + } + } + } + return Optional.ofNullable(oldest); } /** diff --git a/logstash-core/src/main/java/org/logstash/common/io/DeadLetterQueueWriter.java b/logstash-core/src/main/java/org/logstash/common/io/DeadLetterQueueWriter.java index 94a25ad93d1..35e53fb2b4d 100644 --- a/logstash-core/src/main/java/org/logstash/common/io/DeadLetterQueueWriter.java +++ b/logstash-core/src/main/java/org/logstash/common/io/DeadLetterQueueWriter.java @@ -73,9 +73,6 @@ import org.logstash.FileLockFactory; import org.logstash.Timestamp; -import static org.logstash.common.io.DeadLetterQueueUtils.listFiles; -import static org.logstash.common.io.DeadLetterQueueUtils.listSegmentPaths; -import static org.logstash.common.io.DeadLetterQueueUtils.listSegmentPathsSortedBySegmentId; import static org.logstash.common.io.RecordIOReader.SegmentStatus; import static org.logstash.common.io.RecordIOWriter.BLOCK_SIZE; import static org.logstash.common.io.RecordIOWriter.RECORD_HEADER_SIZE; @@ -303,10 +300,7 @@ private DeadLetterQueueWriter(final Path queuePath, final long maxSegmentSize, f cleanupTempFiles(); updateOldestSegmentReference(); - currentSegmentIndex = listSegmentPaths(queuePath) - .map(s -> s.getFileName().toString().split("\\.")[0]) - .mapToInt(Integer::parseInt) - .max().orElse(0); + currentSegmentIndex = DeadLetterQueueUtils.maxSegmentId(queuePath); nextWriter(); this.lastEntryTimestamp = Timestamp.now(); this.flusherService = flusherService; @@ -577,9 +571,7 @@ private long deleteTailSegment(Path segment, String motivation) throws IOExcepti // package-private for testing void updateOldestSegmentReference() throws IOException { final Optional previousOldestSegmentPath = oldestSegmentPath; - oldestSegmentPath = listSegmentPathsSortedBySegmentId(this.queuePath) - .filter(p -> p.toFile().length() > 1) // take the files that have content to process - .findFirst(); + oldestSegmentPath = DeadLetterQueueUtils.oldestSegmentPath(this.queuePath, 1); if (!oldestSegmentPath.isPresent()) { oldestSegmentTimestamp = Optional.empty(); return; @@ -634,7 +626,7 @@ static Optional readTimestampOfLastEventInSegment(Path segmentPath) t // package-private for testing void dropTailSegment() throws IOException { // remove oldest segment - final Optional oldestSegment = listSegmentPathsSortedBySegmentId(queuePath).findFirst(); + final Optional oldestSegment = DeadLetterQueueUtils.oldestSegmentPath(queuePath, 0); if (oldestSegment.isPresent()) { final Path beheadedSegment = oldestSegment.get(); deleteTailSegment(beheadedSegment, "dead letter queue size exceeded dead_letter_queue.max_bytes size(" + maxQueueSize + ")"); @@ -716,7 +708,7 @@ private void sealSegment(int segmentIndex, SealReason motivation) throws IOExcep } private long computeQueueSize() throws IOException { - return listSegmentPaths(this.queuePath) + return DeadLetterQueueUtils.listSegmentPaths(this.queuePath) .mapToLong(DeadLetterQueueWriter::safeFileSize) .sum(); } @@ -753,12 +745,12 @@ private void nextWriter() throws IOException { // segment file with the same base name exists, or rename the // temp file to the segment file, which can happen when a process ends abnormally private void cleanupTempFiles() throws IOException { - listFiles(queuePath, ".log.tmp") + DeadLetterQueueUtils.listFiles(queuePath, ".log.tmp") .forEach(this::cleanupTempFile); } // check if there is a corresponding .log file - if yes delete the temp file, if no atomic move the - // temp file to be a new segment file.. + // temp file to be a new segment file. private void cleanupTempFile(final Path tempFile) { String segmentName = tempFile.getFileName().toString().split("\\.")[0]; Path segmentFile = queuePath.resolve(String.format("%s.log", segmentName)); From f6c75e809b5b645dc4f75c29a1d2c432460939bc Mon Sep 17 00:00:00 2001 From: Mashhur Date: Fri, 10 Apr 2026 13:17:44 -0700 Subject: [PATCH 2/7] Move file size condition after the extract segment ID. --- .../java/org/logstash/common/io/DeadLetterQueueUtils.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/logstash-core/src/main/java/org/logstash/common/io/DeadLetterQueueUtils.java b/logstash-core/src/main/java/org/logstash/common/io/DeadLetterQueueUtils.java index 5daab900864..f2fa31ab423 100644 --- a/logstash-core/src/main/java/org/logstash/common/io/DeadLetterQueueUtils.java +++ b/logstash-core/src/main/java/org/logstash/common/io/DeadLetterQueueUtils.java @@ -82,11 +82,11 @@ static Optional oldestSegmentPath(Path path, long minFileSize) throws IOEx int oldestId = Integer.MAX_VALUE; try (DirectoryStream stream = Files.newDirectoryStream(path, "*.log")) { for (Path p : stream) { - if (minFileSize > 0 && p.toFile().length() <= minFileSize) { - continue; - } int id = extractSegmentId(p); if (id < oldestId) { + if (minFileSize > 0 && Files.size(p) <= minFileSize) { + continue; + } oldestId = id; oldest = p; } From d1960dc306aab0cb5d15edd18303d7149410bc8b Mon Sep 17 00:00:00 2001 From: Mashhur Date: Fri, 10 Apr 2026 13:37:54 -0700 Subject: [PATCH 3/7] Add unit tests --- .../common/io/DeadLetterQueueWriter.java | 1 + .../common/io/DeadLetterQueueReaderTest.java | 22 -- .../common/io/DeadLetterQueueUtilsTest.java | 209 ++++++++++++++++++ 3 files changed, 210 insertions(+), 22 deletions(-) create mode 100644 logstash-core/src/test/java/org/logstash/common/io/DeadLetterQueueUtilsTest.java diff --git a/logstash-core/src/main/java/org/logstash/common/io/DeadLetterQueueWriter.java b/logstash-core/src/main/java/org/logstash/common/io/DeadLetterQueueWriter.java index 35e53fb2b4d..19f3622b61d 100644 --- a/logstash-core/src/main/java/org/logstash/common/io/DeadLetterQueueWriter.java +++ b/logstash-core/src/main/java/org/logstash/common/io/DeadLetterQueueWriter.java @@ -648,6 +648,7 @@ private static boolean alreadyProcessed(final Event event) { return event.includes(DEAD_LETTER_QUEUE_METADATA_KEY); } + // main method for flush scheduler private void scheduledFlushCheck() { logger.trace("Running scheduled check"); lock.lock(); diff --git a/logstash-core/src/test/java/org/logstash/common/io/DeadLetterQueueReaderTest.java b/logstash-core/src/test/java/org/logstash/common/io/DeadLetterQueueReaderTest.java index 90f53df7739..da8ae7e91eb 100644 --- a/logstash-core/src/test/java/org/logstash/common/io/DeadLetterQueueReaderTest.java +++ b/logstash-core/src/test/java/org/logstash/common/io/DeadLetterQueueReaderTest.java @@ -1124,26 +1124,4 @@ public void testReaderLockProhibitMultipleInstances() throws IOException { } } } - - @Test - public void testExtractSegmentIdWithValidFileName() { - Path validPath = Paths.get("123.log"); - assertEquals(123, DeadLetterQueueUtils.extractSegmentId(validPath)); - - Path singleDigitPath = Paths.get("1.log"); - assertEquals(1, DeadLetterQueueUtils.extractSegmentId(singleDigitPath)); - - Path largeNumberPath = Paths.get("999999.log"); - assertEquals(999999, DeadLetterQueueUtils.extractSegmentId(largeNumberPath)); - } - - @Test - public void testExtractSegmentIdWithNoLogExtensionThrowsException() { - Path noExtensionPath = Paths.get("123.txt"); - IllegalArgumentException exception = Assert.assertThrows( - IllegalArgumentException.class, - () -> DeadLetterQueueUtils.extractSegmentId(noExtensionPath) - ); - assertThat(exception.getMessage(), containsString("Invalid segment file name")); - } } diff --git a/logstash-core/src/test/java/org/logstash/common/io/DeadLetterQueueUtilsTest.java b/logstash-core/src/test/java/org/logstash/common/io/DeadLetterQueueUtilsTest.java new file mode 100644 index 00000000000..6e7d9bdee22 --- /dev/null +++ b/logstash-core/src/test/java/org/logstash/common/io/DeadLetterQueueUtilsTest.java @@ -0,0 +1,209 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.logstash.common.io; + +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TemporaryFolder; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.Optional; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.containsString; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertThrows; +import static org.junit.Assert.assertTrue; + +public class DeadLetterQueueUtilsTest { + + @Rule + public TemporaryFolder temporaryFolder = new TemporaryFolder(); + + private Path dir; + + @Before + public void setUp() throws Exception { + dir = temporaryFolder.newFolder().toPath(); + } + + private void createSegmentFile(int id, int size) throws IOException { + Files.write(dir.resolve(id + ".log"), new byte[size]); + } + + private void createSegmentFile(int id) throws IOException { + createSegmentFile(id, 1024); + } + + // --- extractSegmentId --- + + @Test + public void testExtractSegmentIdWithValidFileName() { + assertEquals(123, DeadLetterQueueUtils.extractSegmentId(Paths.get("123.log"))); + assertEquals(1, DeadLetterQueueUtils.extractSegmentId(Paths.get("1.log"))); + assertEquals(999999, DeadLetterQueueUtils.extractSegmentId(Paths.get("999999.log"))); + } + + @Test + public void testExtractSegmentIdWithNoLogExtensionThrowsException() { + IllegalArgumentException exception = assertThrows( + IllegalArgumentException.class, + () -> DeadLetterQueueUtils.extractSegmentId(Paths.get("123.txt")) + ); + assertThat(exception.getMessage(), containsString("Invalid segment file name")); + } + + // --- maxSegmentId --- + + @Test + public void testMaxSegmentIdEmptyDirectory() throws IOException { + assertEquals(0, DeadLetterQueueUtils.maxSegmentId(dir)); + } + + @Test + public void testMaxSegmentIdSingleSegment() throws IOException { + createSegmentFile(5); + assertEquals(5, DeadLetterQueueUtils.maxSegmentId(dir)); + } + + @Test + public void testMaxSegmentIdMultipleSegments() throws IOException { + createSegmentFile(1); + createSegmentFile(3); + createSegmentFile(7); + createSegmentFile(2); + assertEquals(7, DeadLetterQueueUtils.maxSegmentId(dir)); + } + + @Test + public void testMaxSegmentIdNonContiguousIds() throws IOException { + createSegmentFile(10); + createSegmentFile(500); + createSegmentFile(42); + assertEquals(500, DeadLetterQueueUtils.maxSegmentId(dir)); + } + + @Test + public void testMaxSegmentIdIgnoresNonLogFiles() throws IOException { + createSegmentFile(3); + Files.write(dir.resolve("5.log.tmp"), new byte[100]); + Files.write(dir.resolve("notes.txt"), new byte[100]); + assertEquals(3, DeadLetterQueueUtils.maxSegmentId(dir)); + } + + // --- oldestSegmentPath (no minFileSize) --- + + @Test + public void testOldestSegmentPathEmptyDirectory() throws IOException { + Optional result = DeadLetterQueueUtils.oldestSegmentPath(dir, 0); + assertFalse(result.isPresent()); + } + + @Test + public void testOldestSegmentPathSingleSegment() throws IOException { + createSegmentFile(5); + Optional result = DeadLetterQueueUtils.oldestSegmentPath(dir, 0); + assertTrue(result.isPresent()); + assertEquals("5.log", result.get().getFileName().toString()); + } + + @Test + public void testOldestSegmentPathMultipleSegments() throws IOException { + createSegmentFile(3); + createSegmentFile(1); + createSegmentFile(7); + Optional result = DeadLetterQueueUtils.oldestSegmentPath(dir, 0); + assertTrue(result.isPresent()); + assertEquals("1.log", result.get().getFileName().toString()); + } + + @Test + public void testOldestSegmentPathNonContiguousIds() throws IOException { + createSegmentFile(100); + createSegmentFile(42); + createSegmentFile(999); + Optional result = DeadLetterQueueUtils.oldestSegmentPath(dir, 0); + assertTrue(result.isPresent()); + assertEquals("42.log", result.get().getFileName().toString()); + } + + @Test + public void testOldestSegmentPathIgnoresNonLogFiles() throws IOException { + createSegmentFile(10); + Files.write(dir.resolve("1.log.tmp"), new byte[100]); + Files.write(dir.resolve("data.txt"), new byte[100]); + Optional result = DeadLetterQueueUtils.oldestSegmentPath(dir, 0); + assertTrue(result.isPresent()); + assertEquals("10.log", result.get().getFileName().toString()); + } + + // --- oldestSegmentPath (with minFileSize) --- + + @Test + public void testOldestSegmentPathWithMinSizeSkipsSmallFiles() throws IOException { + createSegmentFile(1, 0); + createSegmentFile(2, 1); + createSegmentFile(3, 100); + Optional result = DeadLetterQueueUtils.oldestSegmentPath(dir, 1); + assertTrue(result.isPresent()); + assertEquals("3.log", result.get().getFileName().toString()); + } + + @Test + public void testOldestSegmentPathWithMinSizeReturnsSmallestQualifyingId() throws IOException { + createSegmentFile(5, 0); + createSegmentFile(10, 512); + createSegmentFile(3, 512); + createSegmentFile(7, 0); + Optional result = DeadLetterQueueUtils.oldestSegmentPath(dir, 1); + assertTrue(result.isPresent()); + assertEquals("3.log", result.get().getFileName().toString()); + } + + @Test + public void testOldestSegmentPathWithMinSizeAllTooSmall() throws IOException { + createSegmentFile(1, 0); + createSegmentFile(2, 1); + createSegmentFile(3, 0); + Optional result = DeadLetterQueueUtils.oldestSegmentPath(dir, 1); + assertFalse(result.isPresent()); + } + + @Test + public void testOldestSegmentPathWithMinSizeEmptyDirectory() throws IOException { + Optional result = DeadLetterQueueUtils.oldestSegmentPath(dir, 1); + assertFalse(result.isPresent()); + } + + @Test + public void testOldestSegmentPathWithMinSizeZeroBehavesAsNoFilter() throws IOException { + createSegmentFile(5, 0); + createSegmentFile(2, 0); + Optional result = DeadLetterQueueUtils.oldestSegmentPath(dir, 0); + assertTrue(result.isPresent()); + assertEquals("2.log", result.get().getFileName().toString()); + } + +} From d858db6a61e6b9b932c84e72d0abe7fa60db6362 Mon Sep 17 00:00:00 2001 From: Mashhur <99575341+mashhurs@users.noreply.github.com> Date: Fri, 10 Apr 2026 14:03:20 -0700 Subject: [PATCH 4/7] Update logstash-core/src/main/java/org/logstash/common/io/DeadLetterQueueUtils.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../main/java/org/logstash/common/io/DeadLetterQueueUtils.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/logstash-core/src/main/java/org/logstash/common/io/DeadLetterQueueUtils.java b/logstash-core/src/main/java/org/logstash/common/io/DeadLetterQueueUtils.java index f2fa31ab423..eedefeb48f4 100644 --- a/logstash-core/src/main/java/org/logstash/common/io/DeadLetterQueueUtils.java +++ b/logstash-core/src/main/java/org/logstash/common/io/DeadLetterQueueUtils.java @@ -74,7 +74,8 @@ static int maxSegmentId(Path path) throws IOException { /** * Single-pass scan that finds the segment path with the smallest segment ID, - * optionally skipping entries that don't satisfy {@code minFileSize}. `minFileSize` is to take files that have content to process. + * optionally skipping segments with size less than or equal to {@code minFileSize} + * when {@code minFileSize} is greater than zero. * Returns empty when no matching segment exists. */ static Optional oldestSegmentPath(Path path, long minFileSize) throws IOException { From 0513bbe068196aa7a021ec6c17c592d6bc440667 Mon Sep 17 00:00:00 2001 From: Mashhur <99575341+mashhurs@users.noreply.github.com> Date: Mon, 13 Apr 2026 15:44:55 -0700 Subject: [PATCH 5/7] Apply suggestions from code review Refine the code comment. Co-authored-by: Mashhur <99575341+mashhurs@users.noreply.github.com> --- .../main/java/org/logstash/common/io/DeadLetterQueueUtils.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/logstash-core/src/main/java/org/logstash/common/io/DeadLetterQueueUtils.java b/logstash-core/src/main/java/org/logstash/common/io/DeadLetterQueueUtils.java index eedefeb48f4..3aa091a86b9 100644 --- a/logstash-core/src/main/java/org/logstash/common/io/DeadLetterQueueUtils.java +++ b/logstash-core/src/main/java/org/logstash/common/io/DeadLetterQueueUtils.java @@ -59,8 +59,7 @@ static Stream listSegmentPaths(Path path) throws IOException { } /** - * Single-pass scan using OS-level glob filtering; avoids materializing - * all paths into a collection when only the numeric maximum is needed. + * Finds the all `.log` files using OS-level glob filtering and returns the max segment ID. */ static int maxSegmentId(Path path) throws IOException { int max = 0; From 01997fdf3e40fd9a11bf1e889c723aa55107aba6 Mon Sep 17 00:00:00 2001 From: Mashhur Date: Mon, 13 Apr 2026 21:09:50 -0700 Subject: [PATCH 6/7] When removing the segment, track DLQ currentQueueSize incrementally instead of rescanning filesystem --- .../java/org/logstash/common/io/DeadLetterQueueWriter.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/logstash-core/src/main/java/org/logstash/common/io/DeadLetterQueueWriter.java b/logstash-core/src/main/java/org/logstash/common/io/DeadLetterQueueWriter.java index 19f3622b61d..23c4e7e8f29 100644 --- a/logstash-core/src/main/java/org/logstash/common/io/DeadLetterQueueWriter.java +++ b/logstash-core/src/main/java/org/logstash/common/io/DeadLetterQueueWriter.java @@ -541,8 +541,6 @@ private void deleteExpiredSegments() throws IOException { updateOldestSegmentReference(); cleanNextSegment = isOldestSegmentExpired(); } while (cleanNextSegment); - - this.currentQueueSize.set(computeQueueSize()); } /** @@ -557,8 +555,10 @@ private void deleteExpiredSegments() throws IOException { * */ private long deleteTailSegment(Path segment, String motivation) throws IOException { try { + long segmentSize = Files.size(segment); long eventsInSegment = DeadLetterQueueUtils.countEventsInSegment(segment); Files.delete(segment); + currentQueueSize.addAndGet(-segmentSize); logger.debug("Removed segment file {} due to {}", segment, motivation); return eventsInSegment; } catch (NoSuchFileException nsfex) { @@ -633,7 +633,6 @@ void dropTailSegment() throws IOException { } else { logger.info("Queue size {} exceeded, but no complete DLQ segments found", maxQueueSize); } - this.currentQueueSize.set(computeQueueSize()); } /** From f0e739fd53a1e91ce3c3116142e078868496cb2e Mon Sep 17 00:00:00 2001 From: Mashhur <99575341+mashhurs@users.noreply.github.com> Date: Tue, 14 Apr 2026 12:00:18 -0700 Subject: [PATCH 7/7] Update logstash-core/src/main/java/org/logstash/common/io/DeadLetterQueueUtils.java Apply Java doc suggestion, provides clearer signal. Co-authored-by: Andrea Selva --- .../main/java/org/logstash/common/io/DeadLetterQueueUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/logstash-core/src/main/java/org/logstash/common/io/DeadLetterQueueUtils.java b/logstash-core/src/main/java/org/logstash/common/io/DeadLetterQueueUtils.java index 3aa091a86b9..fbd1dc314bd 100644 --- a/logstash-core/src/main/java/org/logstash/common/io/DeadLetterQueueUtils.java +++ b/logstash-core/src/main/java/org/logstash/common/io/DeadLetterQueueUtils.java @@ -59,7 +59,7 @@ static Stream listSegmentPaths(Path path) throws IOException { } /** - * Finds the all `.log` files using OS-level glob filtering and returns the max segment ID. +Finds the max segment ID between the `.log` file segments using OS-level glob filtering. */ static int maxSegmentId(Path path) throws IOException { int max = 0;