You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "pramithas (via GitHub)" <gi...@apache.org> on 2025/01/20 12:41:52 UTC
[PR] Make forceUnmap protected since the only test class that references it is in the same package now. [kafka]
pramithas opened a new pull request, #18638:
URL: https://github.com/apache/kafka/pull/18638
The `forceUnmap` method was made public for the sake of visibility for testing since the test class `OffsetIndexTest` was in a different package before. Now, the test class is in the same class, so that method can been made `protected`.
The sole usage of this method is inside the class that it is defined and the test class: `OffsetIndexTest`
### Committer Checklist (excluded from commit message)
- [ ] Verify design and implementation
- [ ] Verify test coverage and CI build status
- [ ] Verify documentation (including upgrade notes)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] MINOR: Make `forceUnmap` protected since the only test class that references it is in the same package now. [kafka]
Posted by "pramithas (via GitHub)" <gi...@apache.org>.
pramithas commented on PR #18638:
URL: https://github.com/apache/kafka/pull/18638#issuecomment-2605316556
@divijvaidya Can you please review this?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] MINOR: Make `forceUnmap` protected since the only test class that references it is in the same package now. [kafka]
Posted by "pramithas (via GitHub)" <gi...@apache.org>.
pramithas commented on code in PR #18638:
URL: https://github.com/apache/kafka/pull/18638#discussion_r1924726432
##########
storage/src/main/java/org/apache/kafka/storage/internals/log/AbstractIndex.java:
##########
@@ -399,8 +399,8 @@ 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 {
+ // Made protected for the sake of visibility for testing.
Review Comment:
Thank you for the feedback. I have updated the comment since I needed to re-trigger the build as well.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] MINOR: Make `forceUnmap` protected since the only test class that references it is in the same package now. [kafka]
Posted by "divijvaidya (via GitHub)" <gi...@apache.org>.
divijvaidya merged PR #18638:
URL: https://github.com/apache/kafka/pull/18638
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] MINOR: Make `forceUnmap` protected since the only test class that references it is in the same package now. [kafka]
Posted by "pramithas (via GitHub)" <gi...@apache.org>.
pramithas commented on code in PR #18638:
URL: https://github.com/apache/kafka/pull/18638#discussion_r1924726432
##########
storage/src/main/java/org/apache/kafka/storage/internals/log/AbstractIndex.java:
##########
@@ -399,8 +399,8 @@ 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 {
+ // Made protected for the sake of visibility for testing.
Review Comment:
Thank you for the feedback. I have updated the comment. Could you please re-trigger the build?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] MINOR: Make `forceUnmap` protected since the only test class that references it is in the same package now. [kafka]
Posted by "divijvaidya (via GitHub)" <gi...@apache.org>.
divijvaidya commented on code in PR #18638:
URL: https://github.com/apache/kafka/pull/18638#discussion_r1924246526
##########
storage/src/main/java/org/apache/kafka/storage/internals/log/AbstractIndex.java:
##########
@@ -399,8 +399,8 @@ 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 {
+ // Made protected for the sake of visibility for testing.
Review Comment:
nit
we usually use `//visible for testing` comment for this in the code base. But it's ok to do it this way as well in this PR. Doesn't matter as long as the intent is conveyed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org