-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Add support for multiple query event listeners #24456
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
Add support for multiple query event listeners #24456
Conversation
steveburnett
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the doc! Could an example be added?
676726f to
9e29e22
Compare
steveburnett
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the doc!
Pull updated branch, new doc build, looks good. Thanks!
|
Please attribute the author of the commit as mentioned in our contributing guide (see backport commits). Please write a test with dummy event listeners. You should be able to create internal dummy listeners by writing properties to temp files, invoke the |
|
Saved that user @evanvdia is from IBM |
|
Hi @jaystarshot , would it be possible for you to take a look at this? Thank you!! |
|
Sorry I missed Tim's previous comments, will ping the author to update |
9e29e22 to
928e6c5
Compare
|
@tdcmeehan Added the author of the commit and working on the test case for multiple event listeners. |
|
|
928e6c5 to
b2f27c4
Compare
|
@evanvdia I think the commit to mention in your cherry-pick message should be trinodb/trino@72a7511 Let's update the commit message to the following: |
b2f27c4 to
a07f2c3
Compare
|
@ethanyzhang update the commit message. |
|
|
||
| private void createEventListener(File configFile) | ||
| { | ||
| log.info("-- Loading event listener %s --", configFile); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private final AtomicBoolean loading = new AtomicBoolean(false);
Loading seems guaraded by an atomic boolean in the trino change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
a07f2c3 to
5b40300
Compare
presto-main/src/test/java/com/facebook/presto/eventlistener/TestEventListenerManager.java
Show resolved
Hide resolved
|
|
||
| private static class EventsCapture | ||
| { | ||
| private ImmutableList.Builder<QueryCreatedEvent> queryCreatedEvents; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make the fields final, and instantiate inline
| private ImmutableList.Builder<QueryCreatedEvent> queryCreatedEvents; | |
| private final ImmutableList.Builder<QueryCreatedEvent> queryCreatedEvents = ImmutableList.builder(); | |
| private final ImmutableList.Builder<QueryCompletedEvent> queryCompletedEvents = ImmutableList.builder(); | |
| private final ImmutableList.Builder<SplitCompletedEvent> splitCompletedEvents = ImmutableList.builder(); | |
| public EventsCapture() | |
| { | |
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
85bfad5 to
871ff5e
Compare
aaneja
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just some nits about whitespace
|
|
||
| @VisibleForTesting | ||
| protected void setConfiguredEventListener(String name, Map<String, String> properties) | ||
| private void setConfiguredEventListener(String name, Map<String, String> properties) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: This method can be moved up to L105 to keep all private methods together
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aaneja Done
871ff5e to
da6ee5c
Compare
|
@jaystarshot @pdabre12 Could you please approve the changes. |
da6ee5c to
d5a55f8
Compare
a1b87da to
30f6ae9
Compare
Cherry-pick of trinodb/trino@72a7511 Co-authored-by: Jack Dintruff <[email protected]>
30f6ae9 to
a4e9bc4
Compare
|
@aaneja @jaystarshot @pdabre12 Could you please approve the changes. |
aditi-pandit
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. This should help Manta integration.
A previous PR prestodb#24456 added the needed changes to support Multiple event listener in tests, query runners and across the codebase.
Description
Add support for multiple query event listeners to allow multiple plugins to handle events independently.
Cherry-pick of trinodb/trino#3128
Motivation and Context
Issue : #24454
Test Plan
Contributor checklist
Release Notes
Please follow release notes guidelines and fill in the release notes below.