api: move ATTR_ADDRESS_NAME to EquivalentAddressGroup - #13072
Conversation
| /** | ||
| * Name associated with individual address, if available (e.g., DNS name). | ||
| */ | ||
| public static final Attributes.Key<String> ATTR_ADDRESS_NAME = |
There was a problem hiding this comment.
Why does this exist? Can't all callers of this use EquivalentAddressGroup directly?
The point of this class is if there's something we don't want to make public API. So it would be useful if the attribute wasn't in EAG at all.
There was a problem hiding this comment.
Oh, nm. I failed to notice it wasn't public in EAG.
There was a problem hiding this comment.
But then you also said
So it would be useful if the attribute wasn't in EAG at all.
So we can keep it in internal only. What problem will it have?
There was a problem hiding this comment.
What purpose does it serve defining in EAG at all?
There was a problem hiding this comment.
When building with Bazel, we use a two-stage build and build Internal* files separately. So if this attribute was used in io.grpc itself, it can't use the Internal* copy. In this case it isn't used in io.grpc at all so it really doesn't matter, but the normal pattern is to just make Internal* accessors so it could be used in io.grpc.
Correction to the implementation of gRFC A81-xds-authority-rewriting. The proposal says:
The endpoint hostname attribute from gRFC A81 is currently defined in
XdsInternalAttributes, which makes it unreachable from other modules.Move the key to
EquivalentAddressGroupalongside the other endpoint attributes and re-export it viaInternalEquivalentAddressGroup.XdsInternalAttributesheld nothing else, so it is removed and its callers now reference the key directly.This is needed by the autosharding LB policy gRFC A119, which keys its endpoint map on the A81 hostname.
autoshardingcannot depend onxdsbecausexdswill depend on autosharding.CC: @sauravzg