Remove unnecessary dependencies for xds_cluster_manager LB policy.

pull/24414/head
Mark D. Roth 4 years ago
parent e99d6008ac
commit 51997e36d0
  1. 26
      BUILD
  2. 25
      src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_manager.cc

26
BUILD

@ -1305,23 +1305,6 @@ grpc_cc_library(
],
)
grpc_cc_library(
name = "grpc_xds_api_header",
hdrs = [
"src/core/ext/xds/xds_api.h",
"src/core/ext/xds/xds_bootstrap.h",
"src/core/ext/xds/xds_client_stats.h",
],
external_deps = [
"upb_lib",
"re2",
],
language = "c++",
deps = [
"grpc_base",
],
)
grpc_cc_library(
name = "grpc_xds_client",
srcs = [
@ -1331,8 +1314,15 @@ grpc_cc_library(
"src/core/ext/xds/xds_client_stats.cc",
],
hdrs = [
"src/core/ext/xds/xds_api.h",
"src/core/ext/xds/xds_bootstrap.h",
"src/core/ext/xds/xds_channel_args.h",
"src/core/ext/xds/xds_client.h",
"src/core/ext/xds/xds_client_stats.h",
],
external_deps = [
"upb_lib",
"re2",
],
language = "c++",
deps = [
@ -1341,7 +1331,6 @@ grpc_cc_library(
"grpc_client_channel",
"grpc_google_mesh_ca_certificate_provider_factory",
"grpc_secure",
"grpc_xds_api_header",
],
)
@ -1422,7 +1411,6 @@ grpc_cc_library(
"grpc_base",
"grpc_client_channel",
"grpc_resolver_xds_header",
"grpc_xds_api_header",
],
)

@ -16,18 +16,13 @@
#include <grpc/support/port_platform.h>
#include <inttypes.h>
#include <limits.h>
#include <string.h>
#include <set>
#include <string>
#include <vector>
#include "absl/container/inlined_vector.h"
#include "absl/strings/match.h"
#include "absl/strings/numbers.h"
#include "absl/status/status.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/str_join.h"
#include "absl/strings/str_split.h"
#include "absl/strings/string_view.h"
#include "re2/re2.h"
#include <grpc/grpc.h>
@ -36,7 +31,6 @@
#include "src/core/ext/filters/client_channel/lb_policy_factory.h"
#include "src/core/ext/filters/client_channel/lb_policy_registry.h"
#include "src/core/ext/filters/client_channel/resolver/xds/xds_resolver.h"
#include "src/core/ext/xds/xds_api.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gprpp/orphanable.h"
@ -109,17 +103,13 @@ class XdsClusterManagerLb : public LoadBalancingPolicy {
// It is required that the keys of cluster_map have to live at least as long
// as the ClusterPicker instance.
ClusterPicker(ClusterMap cluster_map,
RefCountedPtr<XdsClusterManagerLbConfig> config)
: cluster_map_(std::move(cluster_map)), config_(std::move(config)) {}
explicit ClusterPicker(ClusterMap cluster_map)
: cluster_map_(std::move(cluster_map)) {}
PickResult Pick(PickArgs args) override;
private:
ClusterMap cluster_map_;
// Take a reference to config so that we can use
// XdsApi::RdsUpdate::RdsRoute::Matchers from it.
RefCountedPtr<XdsClusterManagerLbConfig> config_;
};
// Each ClusterChild holds a ref to its parent XdsClusterManagerLb.
@ -368,8 +358,7 @@ void XdsClusterManagerLb::UpdateStateLocked() {
Ref(DEBUG_LOCATION, "QueuePicker")));
}
}
picker =
absl::make_unique<ClusterPicker>(std::move(cluster_map), config_);
picker = absl::make_unique<ClusterPicker>(std::move(cluster_map));
break;
}
case GRPC_CHANNEL_CONNECTING:

Loading…
Cancel
Save