Skip to content

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

Merged
AnonHxy merged 1 commit into
apache:masterfrom
HQebupt:cacheInfo
Sep 29, 2022
Merged

AnonHxy merged 1 commit into
apache:masterfrom
HQebupt:cacheInfo

Conversation

@HQebupt

@HQebupt HQebupt commented Sep 14, 2022 •

Copy link
Copy Markdown
Contributor

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

HQebupt commented Sep 15, 2022

Copy link
Copy Markdown
Contributor Author

/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