xds_endpoint.cc
Go to the documentation of this file.
1 //
2 // Copyright 2018 gRPC authors.
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
18 
20 
21 #include <stdlib.h>
22 
23 #include <algorithm>
24 #include <type_traits>
25 #include <vector>
26 
27 #include "absl/memory/memory.h"
28 #include "absl/status/status.h"
29 #include "absl/strings/str_cat.h"
30 #include "absl/strings/str_join.h"
39 #include "upb/text_encode.h"
40 
41 #include <grpc/support/log.h>
42 
49 
50 namespace grpc_core {
51 
52 //
53 // XdsEndpointResource
54 //
55 
57  std::vector<std::string> endpoint_strings;
58  for (const ServerAddress& endpoint : endpoints) {
59  endpoint_strings.emplace_back(endpoint.ToString());
60  }
61  return absl::StrCat("{name=", name->AsHumanReadableString(),
62  ", lb_weight=", lb_weight, ", endpoints=[",
63  absl::StrJoin(endpoint_strings, ", "), "]}");
64 }
65 
67  if (localities.size() != other.localities.size()) return false;
68  auto it1 = localities.begin();
69  auto it2 = other.localities.begin();
70  while (it1 != localities.end()) {
71  if (*it1->first != *it2->first) return false;
72  if (it1->second != it2->second) return false;
73  ++it1;
74  ++it2;
75  }
76  return true;
77 }
78 
80  std::vector<std::string> locality_strings;
81  for (const auto& p : localities) {
82  locality_strings.emplace_back(p.second.ToString());
83  }
84  return absl::StrCat("[", absl::StrJoin(locality_strings, ", "), "]");
85 }
86 
88  const std::string** category_name) const {
89  for (size_t i = 0; i < drop_category_list_.size(); ++i) {
90  const auto& drop_category = drop_category_list_[i];
91  // Generate a random number in [0, 1000000).
92  const uint32_t random = static_cast<uint32_t>(rand()) % 1000000;
93  if (random < drop_category.parts_per_million) {
94  *category_name = &drop_category.name;
95  return true;
96  }
97  }
98  return false;
99 }
100 
102  std::vector<std::string> category_strings;
103  for (const DropCategory& category : drop_category_list_) {
104  category_strings.emplace_back(
105  absl::StrCat(category.name, "=", category.parts_per_million));
106  }
107  return absl::StrCat("{[", absl::StrJoin(category_strings, ", "),
108  "], drop_all=", drop_all_, "}");
109 }
110 
112  std::vector<std::string> priority_strings;
113  for (size_t i = 0; i < priorities.size(); ++i) {
114  const Priority& priority = priorities[i];
115  priority_strings.emplace_back(
116  absl::StrCat("priority ", i, ": ", priority.ToString()));
117  }
118  return absl::StrCat("priorities=[", absl::StrJoin(priority_strings, ", "),
119  "], drop_config=", drop_config->ToString());
120 }
121 
122 //
123 // XdsEndpointResourceType
124 //
125 
126 namespace {
127 
128 void MaybeLogClusterLoadAssignment(
131  if (GRPC_TRACE_FLAG_ENABLED(*context.tracer) &&
133  const upb_MessageDef* msg_type =
135  context.symtab);
136  char buf[10240];
137  upb_TextEncode(cla, msg_type, nullptr, 0, buf, sizeof(buf));
138  gpr_log(GPR_DEBUG, "[xds_client %p] ClusterLoadAssignment: %s",
139  context.client, buf);
140  }
141 }
142 
143 grpc_error_handle ServerAddressParseAndAppend(
144  const envoy_config_endpoint_v3_LbEndpoint* lb_endpoint,
145  ServerAddressList* list) {
146  // If health_status is not HEALTHY or UNKNOWN, skip this endpoint.
147  const int32_t health_status =
149  if (health_status != envoy_config_core_v3_UNKNOWN &&
150  health_status != envoy_config_core_v3_HEALTHY) {
151  return GRPC_ERROR_NONE;
152  }
153  // Find the ip:port.
154  const envoy_config_endpoint_v3_Endpoint* endpoint =
156  const envoy_config_core_v3_Address* address =
158  const envoy_config_core_v3_SocketAddress* socket_address =
160  std::string address_str = UpbStringToStdString(
163  if (GPR_UNLIKELY(port >> 16) != 0) {
164  return GRPC_ERROR_CREATE_FROM_STATIC_STRING("Invalid port.");
165  }
166  // Find load_balancing_weight for the endpoint.
167  uint32_t weight = 1;
168  const google_protobuf_UInt32Value* load_balancing_weight =
170  if (load_balancing_weight != nullptr) {
171  weight = google_protobuf_UInt32Value_value(load_balancing_weight);
172  if (weight == 0) {
174  "Invalid endpoint weight of 0.");
175  }
176  }
177  // Populate grpc_resolved_address.
180  grpc_string_to_sockaddr(&addr, address_str.c_str(), port);
181  if (!GRPC_ERROR_IS_NONE(error)) return error;
182  // Append the address to the list.
183  std::map<const char*, std::unique_ptr<ServerAddress::AttributeInterface>>
184  attributes;
186  absl::make_unique<ServerAddressWeightAttribute>(weight);
187  list->emplace_back(addr, nullptr, std::move(attributes));
188  return GRPC_ERROR_NONE;
189 }
190 
191 grpc_error_handle LocalityParse(
192  const envoy_config_endpoint_v3_LocalityLbEndpoints* locality_lb_endpoints,
193  XdsEndpointResource::Priority::Locality* output_locality,
194  size_t* priority) {
195  // Parse LB weight.
196  const google_protobuf_UInt32Value* lb_weight =
198  locality_lb_endpoints);
199  // If LB weight is not specified, it means this locality is assigned no load.
200  // TODO(juanlishen): When we support CDS to configure the inter-locality
201  // policy, we should change the LB weight handling.
202  output_locality->lb_weight =
203  lb_weight != nullptr ? google_protobuf_UInt32Value_value(lb_weight) : 0;
204  if (output_locality->lb_weight == 0) return GRPC_ERROR_NONE;
205  // Parse locality name.
206  const envoy_config_core_v3_Locality* locality =
208  locality_lb_endpoints);
209  if (locality == nullptr) {
210  return GRPC_ERROR_CREATE_FROM_STATIC_STRING("Empty locality.");
211  }
212  std::string region =
214  std::string zone =
216  std::string sub_zone =
218  output_locality->name = MakeRefCounted<XdsLocalityName>(
219  std::move(region), std::move(zone), std::move(sub_zone));
220  // Parse the addresses.
221  size_t size;
222  const envoy_config_endpoint_v3_LbEndpoint* const* lb_endpoints =
224  locality_lb_endpoints, &size);
225  for (size_t i = 0; i < size; ++i) {
226  grpc_error_handle error = ServerAddressParseAndAppend(
227  lb_endpoints[i], &output_locality->endpoints);
228  if (!GRPC_ERROR_IS_NONE(error)) return error;
229  }
230  // Parse the priority.
232  locality_lb_endpoints);
233  return GRPC_ERROR_NONE;
234 }
235 
236 grpc_error_handle DropParseAndAppend(
238  drop_overload,
239  XdsEndpointResource::DropConfig* drop_config) {
240  // Get the category.
243  drop_overload));
244  if (category.empty()) {
245  return GRPC_ERROR_CREATE_FROM_STATIC_STRING("Empty drop category name");
246  }
247  // Get the drop rate (per million).
248  const envoy_type_v3_FractionalPercent* drop_percentage =
250  drop_overload);
251  uint32_t numerator =
253  const auto denominator =
256  // Normalize to million.
257  switch (denominator) {
259  numerator *= 10000;
260  break;
262  numerator *= 100;
263  break;
265  break;
266  default:
267  return GRPC_ERROR_CREATE_FROM_STATIC_STRING("Unknown denominator type");
268  }
269  // Cap numerator to 1000000.
270  numerator = std::min(numerator, 1000000u);
271  drop_config->AddCategory(std::move(category), numerator);
272  return GRPC_ERROR_NONE;
273 }
274 
275 grpc_error_handle EdsResourceParse(
276  const XdsEncodingContext& /*context*/,
278  cluster_load_assignment,
279  bool /*is_v2*/, XdsEndpointResource* eds_update) {
280  std::vector<grpc_error_handle> errors;
281  // Get the endpoints.
282  size_t locality_size;
283  const envoy_config_endpoint_v3_LocalityLbEndpoints* const* endpoints =
285  cluster_load_assignment, &locality_size);
286  for (size_t j = 0; j < locality_size; ++j) {
287  size_t priority;
288  XdsEndpointResource::Priority::Locality locality;
289  grpc_error_handle error = LocalityParse(endpoints[j], &locality, &priority);
290  if (!GRPC_ERROR_IS_NONE(error)) {
291  errors.push_back(error);
292  continue;
293  }
294  // Filter out locality with weight 0.
295  if (locality.lb_weight == 0) continue;
296  // Make sure prorities is big enough. Note that they might not
297  // arrive in priority order.
298  if (eds_update->priorities.size() < priority + 1) {
299  eds_update->priorities.resize(priority + 1);
300  }
301  auto& locality_map = eds_update->priorities[priority].localities;
302  auto it = locality_map.find(locality.name.get());
303  if (it != locality_map.end()) {
305  "duplicate locality ", locality.name->AsHumanReadableString(),
306  " found in priority ", priority)));
307  } else {
308  locality_map.emplace(locality.name.get(), std::move(locality));
309  }
310  }
311  for (const auto& priority : eds_update->priorities) {
312  if (priority.localities.empty()) {
313  errors.push_back(
314  GRPC_ERROR_CREATE_FROM_STATIC_STRING("sparse priority list"));
315  }
316  }
317  // Get the drop config.
318  eds_update->drop_config = MakeRefCounted<XdsEndpointResource::DropConfig>();
321  cluster_load_assignment);
322  if (policy != nullptr) {
323  size_t drop_size;
325  drop_overload =
327  policy, &drop_size);
328  for (size_t j = 0; j < drop_size; ++j) {
330  DropParseAndAppend(drop_overload[j], eds_update->drop_config.get());
331  if (!GRPC_ERROR_IS_NONE(error)) {
332  errors.push_back(
334  "drop config validation error"),
335  error));
336  }
337  }
338  }
339  return GRPC_ERROR_CREATE_FROM_VECTOR("errors parsing EDS resource", &errors);
340 }
341 
342 } // namespace
343 
345  const XdsEncodingContext& context, absl::string_view serialized_resource,
346  bool is_v2) const {
347  // Parse serialized proto.
349  serialized_resource.data(), serialized_resource.size(), context.arena);
350  if (resource == nullptr) {
352  "Can't parse ClusterLoadAssignment resource.");
353  }
354  MaybeLogClusterLoadAssignment(context, resource);
355  // Validate resource.
359  auto endpoint_data = absl::make_unique<ResourceDataSubclass>();
361  EdsResourceParse(context, resource, is_v2, &endpoint_data->resource);
362  if (!GRPC_ERROR_IS_NONE(error)) {
365  if (GRPC_TRACE_FLAG_ENABLED(*context.tracer)) {
366  gpr_log(GPR_ERROR, "[xds_client %p] invalid ClusterLoadAssignment %s: %s",
367  context.client, result.name.c_str(), error_str.c_str());
368  }
369  result.resource = absl::InvalidArgumentError(error_str);
370  } else {
371  if (GRPC_TRACE_FLAG_ENABLED(*context.tracer)) {
372  gpr_log(GPR_INFO, "[xds_client %p] parsed ClusterLoadAssignment %s: %s",
373  context.client, result.name.c_str(),
374  endpoint_data->resource.ToString().c_str());
375  }
376  result.resource = std::move(endpoint_data);
377  }
378  return std::move(result);
379 }
380 
381 } // namespace grpc_core
trace.h
absl::InvalidArgumentError
Status InvalidArgumentError(absl::string_view message)
Definition: third_party/abseil-cpp/absl/status/status.cc:351
_gevent_test_main.result
result
Definition: _gevent_test_main.py:96
GPR_INFO
#define GPR_INFO
Definition: include/grpc/impl/codegen/log.h:56
envoy_config_endpoint_v3_LbEndpoint_health_status
UPB_INLINE int32_t envoy_config_endpoint_v3_LbEndpoint_health_status(const envoy_config_endpoint_v3_LbEndpoint *msg)
Definition: endpoint_components.upb.h:242
regen-readme.it
it
Definition: regen-readme.py:15
GRPC_ERROR_NONE
#define GRPC_ERROR_NONE
Definition: error.h:234
log.h
absl::str_format_internal::LengthMod::j
@ j
priority
int priority
Definition: abseil-cpp/absl/synchronization/internal/graphcycles.cc:286
absl::StrCat
std::string StrCat(const AlphaNum &a, const AlphaNum &b)
Definition: abseil-cpp/absl/strings/str_cat.cc:98
endpoint.upbdefs.h
gpr_should_log
GPRAPI void GPRAPI int gpr_should_log(gpr_log_severity severity)
Definition: log.cc:67
envoy_config_endpoint_v3_LocalityLbEndpoints_locality
UPB_INLINE const struct envoy_config_core_v3_Locality * envoy_config_endpoint_v3_LocalityLbEndpoints_locality(const envoy_config_endpoint_v3_LocalityLbEndpoints *msg)
Definition: endpoint_components.upb.h:427
envoy_type_v3_FractionalPercent_HUNDRED
@ envoy_type_v3_FractionalPercent_HUNDRED
Definition: percent.upb.h:31
envoy_config_endpoint_v3_ClusterLoadAssignment_endpoints
UPB_INLINE const struct envoy_config_endpoint_v3_LocalityLbEndpoints *const * envoy_config_endpoint_v3_ClusterLoadAssignment_endpoints(const envoy_config_endpoint_v3_ClusterLoadAssignment *msg, size_t *len)
Definition: endpoint.upb.h:91
grpc_core::XdsEncodingContext
Definition: upb_utils.h:39
grpc_core
Definition: call_metric_recorder.h:31
xds_resource_type.h
envoy_config_endpoint_v3_ClusterLoadAssignment_Policy
struct envoy_config_endpoint_v3_ClusterLoadAssignment_Policy envoy_config_endpoint_v3_ClusterLoadAssignment_Policy
Definition: endpoint.upb.h:28
upb_MessageDef
Definition: upb/upb/def.c:100
grpc_core::XdsEndpointResource::Priority::localities
std::map< XdsLocalityName *, Locality, XdsLocalityName::Less > localities
Definition: xds_endpoint.h:60
xds_endpoint.h
buf
voidpf void * buf
Definition: bloaty/third_party/zlib/contrib/minizip/ioapi.h:136
grpc_core::XdsEndpointResource::ToString
std::string ToString() const
Definition: xds_endpoint.cc:111
absl::string_view
Definition: abseil-cpp/absl/strings/string_view.h:167
testing::internal::string
::std::string string
Definition: bloaty/third_party/protobuf/third_party/googletest/googletest/include/gtest/internal/gtest-port.h:881
error
grpc_error_handle error
Definition: retry_filter.cc:499
grpc_core::ServerAddress
Definition: server_address.h:49
envoy_config_core_v3_Locality_zone
UPB_INLINE upb_StringView envoy_config_core_v3_Locality_zone(const envoy_config_core_v3_Locality *msg)
Definition: base.upb.h:190
grpc_resolved_address
Definition: resolved_address.h:34
envoy_config_endpoint_v3_ClusterLoadAssignment
struct envoy_config_endpoint_v3_ClusterLoadAssignment envoy_config_endpoint_v3_ClusterLoadAssignment
Definition: endpoint.upb.h:27
endpoint.upb.h
grpc_core::XdsEndpointResource::DropConfig::DropCategory
Definition: xds_endpoint.h:73
envoy_config_core_v3_SocketAddress_port_value
UPB_INLINE uint32_t envoy_config_core_v3_SocketAddress_port_value(const envoy_config_core_v3_SocketAddress *msg)
Definition: address.upb.h:218
envoy_config_endpoint_v3_LocalityLbEndpoints_lb_endpoints
const UPB_INLINE envoy_config_endpoint_v3_LbEndpoint *const * envoy_config_endpoint_v3_LocalityLbEndpoints_lb_endpoints(const envoy_config_endpoint_v3_LocalityLbEndpoints *msg, size_t *len)
Definition: endpoint_components.upb.h:436
resolved_address.h
GPR_LOG_SEVERITY_DEBUG
@ GPR_LOG_SEVERITY_DEBUG
Definition: include/grpc/impl/codegen/log.h:46
envoy_config_core_v3_UNKNOWN
@ envoy_config_core_v3_UNKNOWN
Definition: health_check.upb.h:70
grpc_core::XdsEndpointResource::Priority::ToString
std::string ToString() const
Definition: xds_endpoint.cc:79
envoy_config_endpoint_v3_LocalityLbEndpoints
struct envoy_config_endpoint_v3_LocalityLbEndpoints envoy_config_endpoint_v3_LocalityLbEndpoints
Definition: endpoint_components.upb.h:33
grpc_core::XdsEndpointResource::priorities
PriorityList priorities
Definition: xds_endpoint.h:113
GRPC_TRACE_FLAG_ENABLED
#define GRPC_TRACE_FLAG_ENABLED(f)
Definition: debug/trace.h:114
GRPC_ERROR_CREATE_FROM_VECTOR
#define GRPC_ERROR_CREATE_FROM_VECTOR(desc, error_list)
Definition: error.h:314
base.upb.h
grpc_core::UpbStringToStdString
std::string UpbStringToStdString(const upb_StringView &str)
Definition: upb_utils.h:60
uint32_t
unsigned int uint32_t
Definition: stdint-msvc2008.h:80
grpc_core::XdsEndpointResource::DropConfig::ShouldDrop
bool ShouldDrop(const std::string **category_name) const
Definition: xds_endpoint.cc:87
envoy_config_endpoint_v3_LocalityLbEndpoints_priority
UPB_INLINE uint32_t envoy_config_endpoint_v3_LocalityLbEndpoints_priority(const envoy_config_endpoint_v3_LocalityLbEndpoints *msg)
Definition: endpoint_components.upb.h:451
grpc_error_add_child
grpc_error_handle grpc_error_add_child(grpc_error_handle src, grpc_error_handle child)
Definition: error.cc:678
grpc_core::XdsEndpointResource::Priority
Definition: xds_endpoint.h:46
envoy_config_endpoint_v3_Endpoint
struct envoy_config_endpoint_v3_Endpoint envoy_config_endpoint_v3_Endpoint
Definition: endpoint_components.upb.h:29
parse_address.h
grpc_core::XdsEndpointResource::drop_config
RefCountedPtr< DropConfig > drop_config
Definition: xds_endpoint.h:114
envoy_type_v3_FractionalPercent_denominator
UPB_INLINE int32_t envoy_type_v3_FractionalPercent_denominator(const envoy_type_v3_FractionalPercent *msg)
Definition: percent.upb.h:120
errors
const char * errors
Definition: bloaty/third_party/protobuf/src/google/protobuf/io/tokenizer_unittest.cc:841
absl::move
constexpr absl::remove_reference_t< T > && move(T &&t) noexcept
Definition: abseil-cpp/absl/utility/utility.h:221
envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload
struct envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload
Definition: endpoint.upb.h:29
grpc_core::XdsEndpointResource::Priority::Locality::name
RefCountedPtr< XdsLocalityName > name
Definition: xds_endpoint.h:48
absl::StrJoin
std::string StrJoin(Iterator start, Iterator end, absl::string_view sep, Formatter &&fmt)
Definition: abseil-cpp/absl/strings/str_join.h:239
absl::string_view::size
constexpr size_type size() const noexcept
Definition: abseil-cpp/absl/strings/string_view.h:277
envoy_type_v3_FractionalPercent_MILLION
@ envoy_type_v3_FractionalPercent_MILLION
Definition: percent.upb.h:33
envoy_config_endpoint_v3_Endpoint_address
UPB_INLINE const struct envoy_config_core_v3_Address * envoy_config_endpoint_v3_Endpoint_address(const envoy_config_endpoint_v3_Endpoint *msg)
Definition: endpoint_components.upb.h:91
envoy_config_endpoint_v3_LbEndpoint_endpoint
const UPB_INLINE envoy_config_endpoint_v3_Endpoint * envoy_config_endpoint_v3_LbEndpoint_endpoint(const envoy_config_endpoint_v3_LbEndpoint *msg)
Definition: endpoint_components.upb.h:236
grpc_string_to_sockaddr
grpc_error_handle grpc_string_to_sockaddr(grpc_resolved_address *out, const char *addr, int port)
Definition: parse_address.cc:320
gpr_log
GPRAPI void gpr_log(const char *file, int line, gpr_log_severity severity, const char *format,...) GPR_PRINT_FORMAT_CHECK(4
endpoint_components.upb.h
GPR_UNLIKELY
#define GPR_UNLIKELY(x)
Definition: impl/codegen/port_platform.h:770
envoy_config_endpoint_v3_ClusterLoadAssignment_parse
UPB_INLINE envoy_config_endpoint_v3_ClusterLoadAssignment * envoy_config_endpoint_v3_ClusterLoadAssignment_parse(const char *buf, size_t size, upb_Arena *arena)
Definition: endpoint.upb.h:53
wrappers.upb.h
envoy_config_core_v3_Address_socket_address
const UPB_INLINE envoy_config_core_v3_SocketAddress * envoy_config_core_v3_Address_socket_address(const envoy_config_core_v3_Address *msg)
Definition: address.upb.h:505
envoy_config_core_v3_SocketAddress_address
UPB_INLINE upb_StringView envoy_config_core_v3_SocketAddress_address(const envoy_config_core_v3_SocketAddress *msg)
Definition: address.upb.h:209
envoy_config_endpoint_v3_ClusterLoadAssignment_cluster_name
UPB_INLINE upb_StringView envoy_config_endpoint_v3_ClusterLoadAssignment_cluster_name(const envoy_config_endpoint_v3_ClusterLoadAssignment *msg)
Definition: endpoint.upb.h:82
percent.upb.h
envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_drop_overloads
const UPB_INLINE envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload *const * envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_drop_overloads(const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy *msg, size_t *len)
Definition: endpoint.upb.h:195
error.h
grpc_core::XdsEndpointResource::Priority::Locality::ToString
std::string ToString() const
Definition: xds_endpoint.cc:56
GPR_ERROR
#define GPR_ERROR
Definition: include/grpc/impl/codegen/log.h:57
grpc_core::XdsEndpointResourceType::Decode
absl::StatusOr< DecodeResult > Decode(const XdsEncodingContext &context, absl::string_view serialized_resource, bool is_v2) const override
Definition: xds_endpoint.cc:344
min
#define min(a, b)
Definition: qsort.h:83
weight
uint32_t weight
Definition: weighted_target.cc:84
grpc_core::ServerAddressList
std::vector< ServerAddress > ServerAddressList
Definition: server_address.h:120
grpc_core::ServerAddressWeightAttribute::kServerAddressWeightAttributeKey
static const char * kServerAddressWeightAttributeKey
Definition: server_address.h:127
health_check.upb.h
envoy_type_v3_FractionalPercent_TEN_THOUSAND
@ envoy_type_v3_FractionalPercent_TEN_THOUSAND
Definition: percent.upb.h:32
grpc_core::XdsEndpointResource::DropConfig::ToString
std::string ToString() const
Definition: xds_endpoint.cc:101
GRPC_ERROR_CREATE_FROM_STATIC_STRING
#define GRPC_ERROR_CREATE_FROM_STATIC_STRING(desc)
Definition: error.h:291
envoy_type_v3_FractionalPercent
struct envoy_type_v3_FractionalPercent envoy_type_v3_FractionalPercent
Definition: percent.upb.h:26
envoy_config_endpoint_v3_LbEndpoint_load_balancing_weight
UPB_INLINE const struct google_protobuf_UInt32Value * envoy_config_endpoint_v3_LbEndpoint_load_balancing_weight(const envoy_config_endpoint_v3_LbEndpoint *msg)
Definition: endpoint_components.upb.h:260
envoy_type_v3_FractionalPercent_DenominatorType
envoy_type_v3_FractionalPercent_DenominatorType
Definition: percent.upb.h:30
google_protobuf_UInt32Value_value
UPB_INLINE uint32_t google_protobuf_UInt32Value_value(const google_protobuf_UInt32Value *msg)
Definition: wrappers.upb.h:297
tests.unit._exit_scenarios.port
port
Definition: _exit_scenarios.py:179
envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_drop_percentage
UPB_INLINE const struct envoy_type_v3_FractionalPercent * envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_drop_percentage(const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload *msg)
Definition: endpoint.upb.h:299
envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_category
UPB_INLINE upb_StringView envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_category(const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload *msg)
Definition: endpoint.upb.h:290
upb_TextEncode
size_t upb_TextEncode(const upb_Message *msg, const upb_MessageDef *m, const upb_DefPool *ext_pool, int options, char *buf, size_t size)
Definition: text_encode.c:455
envoy_config_core_v3_Locality
struct envoy_config_core_v3_Locality envoy_config_core_v3_Locality
Definition: base.upb.h:47
envoy_config_endpoint_v3_ClusterLoadAssignment_getmsgdef
const UPB_INLINE upb_MessageDef * envoy_config_endpoint_v3_ClusterLoadAssignment_getmsgdef(upb_DefPool *s)
Definition: endpoint.upbdefs.h:24
envoy_config_core_v3_Locality_sub_zone
UPB_INLINE upb_StringView envoy_config_core_v3_Locality_sub_zone(const envoy_config_core_v3_Locality *msg)
Definition: base.upb.h:196
envoy_config_core_v3_HEALTHY
@ envoy_config_core_v3_HEALTHY
Definition: health_check.upb.h:71
envoy_config_endpoint_v3_ClusterLoadAssignment_policy
const UPB_INLINE envoy_config_endpoint_v3_ClusterLoadAssignment_Policy * envoy_config_endpoint_v3_ClusterLoadAssignment_policy(const envoy_config_endpoint_v3_ClusterLoadAssignment *msg)
Definition: endpoint.upb.h:100
grpc_error_std_string
std::string grpc_error_std_string(grpc_error_handle error)
Definition: error.cc:944
grpc_core::XdsEndpointResource::Priority::Locality::lb_weight
uint32_t lb_weight
Definition: xds_endpoint.h:49
GRPC_ERROR_CREATE_FROM_CPP_STRING
#define GRPC_ERROR_CREATE_FROM_CPP_STRING(desc)
Definition: error.h:297
grpc_core::XdsResourceType::DecodeResult
Definition: xds_resource_type.h:44
envoy_config_core_v3_Locality_region
UPB_INLINE upb_StringView envoy_config_core_v3_Locality_region(const envoy_config_core_v3_Locality *msg)
Definition: base.upb.h:184
GRPC_ERROR_UNREF
#define GRPC_ERROR_UNREF(err)
Definition: error.h:262
envoy_config_core_v3_SocketAddress
struct envoy_config_core_v3_SocketAddress envoy_config_core_v3_SocketAddress
Definition: address.upb.h:32
envoy_config_endpoint_v3_LbEndpoint
struct envoy_config_endpoint_v3_LbEndpoint envoy_config_endpoint_v3_LbEndpoint
Definition: endpoint_components.upb.h:31
grpc_core::XdsEndpointResource::Priority::operator==
bool operator==(const Priority &other) const
Definition: xds_endpoint.cc:66
GPR_DEBUG
#define GPR_DEBUG
Definition: include/grpc/impl/codegen/log.h:55
context
grpc::ClientContext context
Definition: istio_echo_server_lib.cc:61
google_protobuf_UInt32Value
struct google_protobuf_UInt32Value google_protobuf_UInt32Value
Definition: wrappers.upb.h:37
absl::StatusOr
Definition: abseil-cpp/absl/status/statusor.h:187
grpc_error
Definition: error_internal.h:42
upb_utils.h
size
voidpf void uLong size
Definition: bloaty/third_party/zlib/contrib/minizip/ioapi.h:136
envoy_type_v3_FractionalPercent_numerator
UPB_INLINE uint32_t envoy_type_v3_FractionalPercent_numerator(const envoy_type_v3_FractionalPercent *msg)
Definition: percent.upb.h:114
envoy_config_core_v3_Address
struct envoy_config_core_v3_Address envoy_config_core_v3_Address
Definition: address.upb.h:35
int32_t
signed int int32_t
Definition: stdint-msvc2008.h:77
absl::string_view::data
constexpr const_pointer data() const noexcept
Definition: abseil-cpp/absl/strings/string_view.h:336
address.upb.h
text_encode.h
addr
struct sockaddr_in addr
Definition: libuv/docs/code/tcp-echo-server/main.c:10
envoy_config_endpoint_v3_LocalityLbEndpoints_load_balancing_weight
UPB_INLINE const struct google_protobuf_UInt32Value * envoy_config_endpoint_v3_LocalityLbEndpoints_load_balancing_weight(const envoy_config_endpoint_v3_LocalityLbEndpoints *msg)
Definition: endpoint_components.upb.h:445
i
uint64_t i
Definition: abseil-cpp/absl/container/btree_benchmark.cc:230
GRPC_ERROR_IS_NONE
#define GRPC_ERROR_IS_NONE(err)
Definition: error.h:241
port_platform.h
grpc_core::XdsEndpointResource::Priority::Locality::endpoints
ServerAddressList endpoints
Definition: xds_endpoint.h:50


grpc
Author(s):
autogenerated on Fri May 16 2025 03:00:58