-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Deterministic Subsetting Lb Policy #10470
Conversation
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.
(For the record, I had been trying to get to reviewing this the last two weeks.)
This isn't a detailed review, mostly looking at the shape of things. But it looks pretty good. There will obviously be changes to adjust to the final A68.
* https://github.com/grpc/proposal/blob/master/A68-deterministic-subsetting-lb-policy.md | ||
*/ | ||
@Internal | ||
public final class DeterministicSubsettingLoadBalancer extends LoadBalancer { |
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.
Remove the public
(and thus @Internal
). Only the Provider needs to be public.
(DeterministicSubsettingLoadBalancerConfig) | ||
resolvedAddresses.getLoadBalancingPolicyConfig(); | ||
|
||
switchLb.switchTo(config.childPolicy.getProvider()); |
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.
Since you made this change, I've cleaned this up and switchTo() is now deprecated. Instead of switchTo, you'll just use setLoadBalancingPolicyConfig()
and pass a GracefulSwitchLB configuration object. This should clean up the parsing in the logic in the provider, as now GracefulSwitchLB.parseLoadBalancingPolicyConfig()
does much of the work instead of random internal APIs.
2c49cc4 might be a reasonable example of the change.
|
||
@VisibleForTesting | ||
static class AddressComparator implements Comparator<SocketAddress> { | ||
// For consistency with the golang instrumentation, this assumes toString is overridden such |
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.
This isn't consistent with golang. I know this will change to hashing, but there will still be some similar issues. Maybe we'll be forced to use address.hashCode()
, or maybe it doesn't matter because we just have to be consistent within a single implementation. See f866c80 where I mention some issues with the string representation.
@joybestourous Are you still interested in getting this PR merged? |
Hey hey, thanks @ejona86 for taking a look! Based on the outcome of grpc/proposal#383 (comment), I'd guess not. I know we merged some Rendezvous Hashing implementation in golang, but we dont currently have any plans to implement that or PID in Java. We'll put up a new PR if we end up allocating time for that work! Thanks folks! |
A POC for grpc/proposal#383