balancer: provides resolver.State Attributes in PickerBuildInfo #8696
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.
In gRPC you can create manual Resolver for manual name resolution management. This resolver has an UpdateState method, which receives a State object. This object has an Attributes field, which is used to pass various parameters to load balancers.
The PickerBuilder interface contains a build method that receives a PickerBuildInfo object containing connection information, but lacking the Attributes that are passed when updating the resolver state.
PickerBuildInfo now contains a new Attributes field:
Now when implementing the PickerBuilder interface you can get these Attributes (and based on their values, configure the load balancer's operating logic):
This change does not change any external APIs and is fully backwards compatible.