From 67166ee6a891264a7310c58d0d8cab1d70299ee4 Mon Sep 17 00:00:00 2001 From: pramithas Date: Mon, 20 Jan 2025 18:22:55 +0545 Subject: [PATCH 1/3] Make forceUnmap protected --- .../org/apache/kafka/storage/internals/log/AbstractIndex.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/src/main/java/org/apache/kafka/storage/internals/log/AbstractIndex.java b/storage/src/main/java/org/apache/kafka/storage/internals/log/AbstractIndex.java index 9c7c645c4a705..bfe6416774ce4 100644 --- a/storage/src/main/java/org/apache/kafka/storage/internals/log/AbstractIndex.java +++ b/storage/src/main/java/org/apache/kafka/storage/internals/log/AbstractIndex.java @@ -400,7 +400,7 @@ protected void safeForceUnmap() { * Forcefully free the buffer's mmap. */ // Visible for testing, we can make this protected once OffsetIndexTest is in the same package as this class - public void forceUnmap() throws IOException { + protected void forceUnmap() throws IOException { try { ByteBufferUnmapper.unmap(file.getAbsolutePath(), mmap); } finally { From 43fd04b68a19fea930f4e82be5b4a07b8efe9952 Mon Sep 17 00:00:00 2001 From: pramithas Date: Mon, 20 Jan 2025 18:29:18 +0545 Subject: [PATCH 2/3] Update commit message --- .../org/apache/kafka/storage/internals/log/AbstractIndex.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/src/main/java/org/apache/kafka/storage/internals/log/AbstractIndex.java b/storage/src/main/java/org/apache/kafka/storage/internals/log/AbstractIndex.java index bfe6416774ce4..b3d5ac7b88ebd 100644 --- a/storage/src/main/java/org/apache/kafka/storage/internals/log/AbstractIndex.java +++ b/storage/src/main/java/org/apache/kafka/storage/internals/log/AbstractIndex.java @@ -399,7 +399,7 @@ protected void safeForceUnmap() { /** * Forcefully free the buffer's mmap. */ - // Visible for testing, we can make this protected once OffsetIndexTest is in the same package as this class + // Made protected for the sake of visibility for testing. protected void forceUnmap() throws IOException { try { ByteBufferUnmapper.unmap(file.getAbsolutePath(), mmap); From 71361c165c34c883990f3b6da629ea51c9535f2e Mon Sep 17 00:00:00 2001 From: pramithas Date: Wed, 22 Jan 2025 11:28:42 +0545 Subject: [PATCH 3/3] Update comment as per convention --- .../org/apache/kafka/storage/internals/log/AbstractIndex.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/src/main/java/org/apache/kafka/storage/internals/log/AbstractIndex.java b/storage/src/main/java/org/apache/kafka/storage/internals/log/AbstractIndex.java index b3d5ac7b88ebd..bf1bd802f5e0c 100644 --- a/storage/src/main/java/org/apache/kafka/storage/internals/log/AbstractIndex.java +++ b/storage/src/main/java/org/apache/kafka/storage/internals/log/AbstractIndex.java @@ -399,7 +399,7 @@ protected void safeForceUnmap() { /** * Forcefully free the buffer's mmap. */ - // Made protected for the sake of visibility for testing. + // Visible for testing protected void forceUnmap() throws IOException { try { ByteBufferUnmapper.unmap(file.getAbsolutePath(), mmap);