[call-v3] Move `XdsResolver::ClusterSelectionFilter` to v3 api (#35419)

Omit experiments due to trivial refactor

Closes #35419

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/35419 from ctiller:xds1 4c639752a0
PiperOrigin-RevId: 595144625
pull/35415/head
Craig Tiller 1 year ago committed by Copybara-Service
parent 75e5ebcb14
commit ecc2bbac3b
  1. 30
      src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc

@ -312,7 +312,8 @@ class XdsResolver : public Resolver {
RouteConfigData::RouteEntry* route_;
};
class ClusterSelectionFilter : public ChannelFilter {
class ClusterSelectionFilter
: public ImplementChannelFilter<ClusterSelectionFilter> {
public:
const static grpc_channel_filter kFilter;
@ -322,8 +323,15 @@ class XdsResolver : public Resolver {
}
// Construct a promise for one call.
ArenaPromise<ServerMetadataHandle> MakeCallPromise(
CallArgs call_args, NextPromiseFactory next_promise_factory) override;
class Call {
public:
void OnClientInitialMetadata(ClientMetadata& md);
static const NoInterceptor OnServerInitialMetadata;
static const NoInterceptor OnServerTrailingMetadata;
static const NoInterceptor OnClientToServerMessage;
static const NoInterceptor OnServerToClientMessage;
static const NoInterceptor OnFinalize;
};
private:
explicit ClusterSelectionFilter(ChannelFilter::Args filter_args)
@ -374,6 +382,16 @@ class XdsResolver : public Resolver {
std::map<absl::string_view, WeakRefCountedPtr<ClusterRef>> cluster_ref_map_;
};
const NoInterceptor
XdsResolver::ClusterSelectionFilter::Call::OnServerInitialMetadata;
const NoInterceptor
XdsResolver::ClusterSelectionFilter::Call::OnServerTrailingMetadata;
const NoInterceptor
XdsResolver::ClusterSelectionFilter::Call::OnClientToServerMessage;
const NoInterceptor
XdsResolver::ClusterSelectionFilter::Call::OnServerToClientMessage;
const NoInterceptor XdsResolver::ClusterSelectionFilter::Call::OnFinalize;
//
// XdsResolver::RouteConfigData::RouteListIterator
//
@ -835,9 +853,8 @@ const grpc_channel_filter XdsResolver::ClusterSelectionFilter::kFilter =
kFilterExaminesServerInitialMetadata>(
"cluster_selection_filter");
ArenaPromise<ServerMetadataHandle>
XdsResolver::ClusterSelectionFilter::MakeCallPromise(
CallArgs call_args, NextPromiseFactory next_promise_factory) {
void XdsResolver::ClusterSelectionFilter::Call::OnClientInitialMetadata(
ClientMetadata&) {
auto* service_config_call_data =
static_cast<ClientChannelServiceConfigCallData*>(
GetContext<grpc_call_context_element>()
@ -856,7 +873,6 @@ XdsResolver::ClusterSelectionFilter::MakeCallPromise(
[cluster = std::move(cluster)]() mutable { cluster.reset(); });
}
}
return next_promise_factory(std::move(call_args));
}
//

Loading…
Cancel
Save