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

[fix][doc]correct the explanation for invalidateEntries in the EntryCache #17650

Merged
merged 1 commit into from
Sep 29, 2022

Conversation

HQebupt
Copy link
Contributor

@HQebupt HQebupt commented Sep 14, 2022

Motivation

The method invalidateEntries aims to remove from cache all the entries related to a ledger up to lastPosition. And the lastPosition is non-inclusive as opposed to its explanation. See L173.

@Override
public void invalidateEntries(final PositionImpl lastPosition) {
final PositionImpl firstPosition = PositionImpl.get(-1, 0);
if (firstPosition.compareTo(lastPosition) > 0) {
if (log.isDebugEnabled()) {
log.debug("Attempted to invalidate entries in an invalid range : {} ~ {}",
firstPosition, lastPosition);
}
return;
}
Pair<Integer, Long> removed = entries.removeRange(firstPosition, lastPosition, false);

Modifications

correct the explanation for invalidateEntries

Verifying this change

  • Make sure that the change passes the CI checks.

This change is a trivial rework / code cleanup without any test coverage.

Does this pull request potentially affect one of the following parts:

If yes was chosen, please highlight the changes

  • Dependencies (does it add or upgrade a dependency): (no)
  • The public API: (no)
  • The schema: (no)
  • The default values of configurations: (no)
  • The wire protocol: (no)
  • The rest endpoints: (no)
  • The admin cli options: (no)
  • Anything that affects deployment: (no)

Documentation

Check the box below or label this PR directly.

Need to update docs?

  • doc-required

  • doc-not-needed

  • doc
    (Your PR contains doc changes)

  • doc-complete
    (Docs have been already added)

@github-actions github-actions bot added the doc Your PR contains doc changes, no matter whether the changes are in markdown or code files. label Sep 14, 2022
@HQebupt
Copy link
Contributor Author

HQebupt commented Sep 15, 2022

/pulsarbot rerun-failure-checks

@AnonHxy AnonHxy merged commit 73739e1 into apache:master Sep 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Your PR contains doc changes, no matter whether the changes are in markdown or code files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants