-
Notifications
You must be signed in to change notification settings - Fork 134
Make it possible to permit empty endpoints in CD endpoint groups #1319
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
Changes from 1 commit
2801a82
0fab123
2c0f916
7c5dd47
5100eda
9d2358b
493ba0d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -73,7 +73,7 @@ public final class CentralDogmaEndpointGroup<T> extends DynamicEndpointGroup { | |
| public static <T> CentralDogmaEndpointGroup<T> ofWatcher(Watcher<T> watcher, | ||
| EndpointListDecoder<T> endpointListDecoder) { | ||
| return new CentralDogmaEndpointGroup<>(EndpointSelectionStrategy.weightedRoundRobin(), | ||
| watcher, endpointListDecoder); | ||
| watcher, endpointListDecoder, false); | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -107,13 +107,30 @@ public static <T> CentralDogmaEndpointGroup<T> of(CentralDogma centralDogma, | |
| */ | ||
| public static <T> CentralDogmaEndpointGroupBuilder<T> builder(Watcher<T> watcher, | ||
| EndpointListDecoder<T> endpointListDecoder) { | ||
| return new CentralDogmaEndpointGroupBuilder<>(watcher, endpointListDecoder); | ||
| return new CentralDogmaEndpointGroupBuilder<>(watcher, endpointListDecoder, false); | ||
| } | ||
|
|
||
| /** | ||
| * Returns a new {@link CentralDogmaEndpointGroupBuilder} with the {@link Watcher} | ||
| * and {@link EndpointListDecoder}. You can create a {@link Watcher} using {@link CentralDogma}: | ||
| * | ||
| * <pre>{@code | ||
| * CentralDogma centralDogma = ... | ||
| * Query<T> query = ... // The query to the entry that contains the list of endpoints. | ||
| * Watcher watcher = centralDogma.fileWatcher(projectName, repositoryName, query); | ||
| * }</pre> | ||
| */ | ||
| public static <T> CentralDogmaEndpointGroupBuilder<T> builder(Watcher<T> watcher, | ||
| EndpointListDecoder<T> endpointListDecoder, | ||
| boolean allowEmptyEndpoints) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Optional) Given that we're already using a builder pattern and
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The use sites I've seen don't really use it as a builder, they all call the factory method and
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My line of thought is just from an API management point - each param could possibly add 2^n overload variants.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Makes sense. Doing it that way. |
||
| return new CentralDogmaEndpointGroupBuilder<>(watcher, endpointListDecoder, allowEmptyEndpoints); | ||
| } | ||
|
|
||
| CentralDogmaEndpointGroup(EndpointSelectionStrategy strategy, | ||
| Watcher<T> instanceListWatcher, | ||
| EndpointListDecoder<T> endpointListDecoder) { | ||
| super(strategy); | ||
| EndpointListDecoder<T> endpointListDecoder, | ||
| boolean allowEmptyEndpoints) { | ||
| super(strategy, allowEmptyEndpoints); | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| this.instanceListWatcher = requireNonNull(instanceListWatcher, "instanceListWatcher"); | ||
| this.endpointListDecoder = requireNonNull(endpointListDecoder, "endpointListDecoder"); | ||
| registerWatcher(); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.