Refactor FutureStateChange implementation#11436
Merged
martint merged 1 commit intotrinodb:masterfrom Apr 14, 2022
Merged
Conversation
39b9807 to
7e33375
Compare
abc97eb to
0a5c6f5
Compare
8f99ae7 to
547d088
Compare
Member
raunaqmorarka
left a comment
There was a problem hiding this comment.
Change looks ok to me.
Please add unit tests for this class
martint
reviewed
Apr 13, 2022
core/trino-main/src/main/java/io/trino/execution/FutureStateChange.java
Outdated
Show resolved
Hide resolved
547d088 to
15169e1
Compare
martint
approved these changes
Apr 14, 2022
Avoids unnecessary listener removal and the associated object monitor synchronization when listeners are completed as part of a normal FutureStateChange notification event. Only listeners that were canceled before being notified need to be removed from the current listener set. Also changes the logic for sending a change notification to copy the current listeners set into a List instead of a Set, which has more overhead and was not necessary.
15169e1 to
c3f580d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refactors
FutureStateChangeto reduce lock contention when notifications are triggered, by only attempting to remove listeners from the current set upon completion if they were cancelled.Description
Improvement to an abstraction used in a few places by the core engine
The core query engine
No explanation to a non-technical end user or system administration should be necessary
Documentation
(x) No documentation is needed.
( ) Sufficient documentation is included in this PR.
( ) Documentation PR is available with #prnumber.
( ) Documentation issue #issuenumber is filed, and can be handled later.
Release notes
(x) No release notes entries required.
( ) Release notes entries required with the following suggested text: