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

Change pendingDeletedLedgers as ConcurrentHashSet #3989

Merged
merged 1 commit into from
Jun 19, 2023

Conversation

AnonHxy
Copy link
Contributor

@AnonHxy AnonHxy commented Jun 15, 2023

Descriptions of the changes in this PR:

Motivation

Improve remove performance of LedgerMetadataIndex#pendingDeletedLedgers.

Currently the pendingDeletedLedgers is a ConcurrentLinkedQueue, and we just call remove and add and poll method of this queue. And it seems that we need not keep the order when poll items from it.

Removing items from ConcurrentLinkedQueue need traversal the queue. Changing the LedgerMetadataIndex#pendingDeletedLedgers as a ConcurrentHashSet will improve the remove performance.

Changes

Changing the LedgerMetadataIndex#pendingDeletedLedgers as a ConcurrentHashSet

Copy link
Contributor

@HQebupt HQebupt left a comment

Choose a reason for hiding this comment

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

LGTM

@hangc0276
Copy link
Contributor

Good job!

Copy link
Member

@StevenLuMT StevenLuMT left a comment

Choose a reason for hiding this comment

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

LGTM

@StevenLuMT StevenLuMT merged commit 2baee36 into apache:master Jun 19, 2023
16 checks passed
hangc0276 pushed a commit to hangc0276/bookkeeper that referenced this pull request Jun 26, 2023
zymap pushed a commit that referenced this pull request Aug 29, 2023
zymap pushed a commit that referenced this pull request Dec 7, 2023
Ghatage pushed a commit to sijie/bookkeeper that referenced this pull request Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants