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

Support dynamic properties in HTTP announcement #1157

Merged
merged 4 commits into from May 7, 2024

Conversation

findepi
Copy link
Contributor

@findepi findepi commented May 6, 2024

Extend discovery binder's bindHttpAnnouncement's capabilities by
allowing bindings of non-constant properties that require Guice
injection to be calculated.

For trinodb/trino#21744

@findepi
Copy link
Contributor Author

findepi commented May 6, 2024

cc @losipiuk @electrum

@findepi
Copy link
Contributor Author

findepi commented May 6, 2024

AC, PTAL

Copy link
Member

@electrum electrum left a comment

Choose a reason for hiding this comment

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

The API looks good, but we should still create custom annotation class rather than using Named. We avoid using Named as it's single shared namespace. While this usage of using it with UUIDs is unlikely to actually be a problem, using a custom annotation is best practice (and keeps the simple rule of "don't use Named").

@findepi
Copy link
Contributor Author

findepi commented May 7, 2024

Custom annotation is less encapsulated, as someone could instantiate it outside of the dedicated builder, so i think this usage of Named is actually better. We will need a custom annotation if we want idempotence (#1157 (comment)). Although I don't agree, I will still switch to custom annotation.

Fix the test to test the class it is supposed to test.
Extend discovery binder's bindHttpAnnouncement's capabilities by
allowing bindings of non-constant properties that require Guice
injection to be calculated.
@findepi findepi merged commit 08b27eb into airlift:master May 7, 2024
3 checks passed
@findepi findepi deleted the findepi/discovery-dyn branch May 7, 2024 07:09
@@ -0,0 +1,65 @@
/*
Copy link
Collaborator

Choose a reason for hiding this comment

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

Drop this header - not required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants