Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MINOR: Make forceUnmap protected since the only test class that references it is in the same package now. #18638

Merged
merged 3 commits into from
Jan 23, 2025

Conversation

pramithas
Copy link
Contributor

@pramithas pramithas commented Jan 20, 2025

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 package, so that method can been made protected.

The sole usage of this method is inside the class that it is defined in: AbstractIndex 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)

@pramithas pramithas changed the title Make forceUnmap protected since the only test class that references it is in the same package now. Make forceUnmap protected since the only test class that references it is in the same package now. Jan 20, 2025
@github-actions github-actions bot added triage PRs from the community storage Pull requests that target the storage module small Small PRs labels Jan 20, 2025
@pramithas pramithas changed the title Make forceUnmap protected since the only test class that references it is in the same package now. MINOR: Make forceUnmap protected since the only test class that references it is in the same package now. Jan 20, 2025
@pramithas
Copy link
Contributor Author

@divijvaidya Can you please review this?

@@ -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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

@pramithas pramithas Jan 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the feedback. I have updated the comment. Could you please re-trigger the build?

@divijvaidya divijvaidya removed the triage PRs from the community label Jan 21, 2025
@divijvaidya divijvaidya merged commit 27552e7 into apache:trunk Jan 23, 2025
9 checks passed
pranavt84 pushed a commit to pranavt84/kafka that referenced this pull request Jan 27, 2025
airlock-confluentinc bot pushed a commit to confluentinc/kafka that referenced this pull request Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
small Small PRs storage Pull requests that target the storage module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants