test_lb_policies.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 
19 #include <string>
20 
21 #include <grpc/support/log.h>
22 
37 #include "src/core/lib/json/json.h"
40 
41 namespace grpc_core {
42 
43 namespace {
44 
45 //
46 // ForwardingLoadBalancingPolicy
47 //
48 
49 // A minimal forwarding class to avoid implementing a standalone test LB.
50 class ForwardingLoadBalancingPolicy : public LoadBalancingPolicy {
51  public:
52  ForwardingLoadBalancingPolicy(
53  std::unique_ptr<ChannelControlHelper> delegating_helper, Args args,
54  const char* delegate_policy_name, intptr_t initial_refcount = 1)
55  : LoadBalancingPolicy(std::move(args), initial_refcount) {
56  Args delegate_args;
57  delegate_args.work_serializer = work_serializer();
58  delegate_args.channel_control_helper = std::move(delegating_helper);
59  delegate_args.args = args.args;
61  delegate_policy_name, std::move(delegate_args));
62  grpc_pollset_set_add_pollset_set(delegate_->interested_parties(),
63  interested_parties());
64  }
65 
66  ~ForwardingLoadBalancingPolicy() override = default;
67 
68  void UpdateLocked(UpdateArgs args) override {
69  delegate_->UpdateLocked(std::move(args));
70  }
71 
72  void ExitIdleLocked() override { delegate_->ExitIdleLocked(); }
73 
74  void ResetBackoffLocked() override { delegate_->ResetBackoffLocked(); }
75 
76  private:
77  void ShutdownLocked() override { delegate_.reset(); }
78 
79  OrphanablePtr<LoadBalancingPolicy> delegate_;
80 };
81 
82 //
83 // TestPickArgsLb
84 //
85 
86 constexpr char kTestPickArgsLbPolicyName[] = "test_pick_args_lb";
87 
88 class TestPickArgsLb : public ForwardingLoadBalancingPolicy {
89  public:
90  TestPickArgsLb(Args args, TestPickArgsCallback cb,
91  const char* delegate_policy_name)
92  : ForwardingLoadBalancingPolicy(
93  absl::make_unique<Helper>(RefCountedPtr<TestPickArgsLb>(this), cb),
94  std::move(args), delegate_policy_name,
95  /*initial_refcount=*/2) {}
96 
97  ~TestPickArgsLb() override = default;
98 
99  const char* name() const override { return kTestPickArgsLbPolicyName; }
100 
101  private:
102  class Picker : public SubchannelPicker {
103  public:
104  Picker(std::unique_ptr<SubchannelPicker> delegate_picker,
106  : delegate_picker_(std::move(delegate_picker)), cb_(std::move(cb)) {}
107 
108  PickResult Pick(PickArgs args) override {
109  // Report args seen.
110  PickArgsSeen args_seen;
111  args_seen.path = std::string(args.path);
112  args_seen.metadata = args.initial_metadata->TestOnlyCopyToVector();
113  cb_(args_seen);
114  // Do pick.
115  return delegate_picker_->Pick(args);
116  }
117 
118  private:
119  std::unique_ptr<SubchannelPicker> delegate_picker_;
121  };
122 
123  class Helper : public ChannelControlHelper {
124  public:
125  Helper(RefCountedPtr<TestPickArgsLb> parent, TestPickArgsCallback cb)
126  : parent_(std::move(parent)), cb_(std::move(cb)) {}
127 
128  RefCountedPtr<SubchannelInterface> CreateSubchannel(
129  ServerAddress address, const grpc_channel_args& args) override {
130  return parent_->channel_control_helper()->CreateSubchannel(
131  std::move(address), args);
132  }
133 
134  void UpdateState(grpc_connectivity_state state, const absl::Status& status,
135  std::unique_ptr<SubchannelPicker> picker) override {
136  parent_->channel_control_helper()->UpdateState(
137  state, status, absl::make_unique<Picker>(std::move(picker), cb_));
138  }
139 
140  void RequestReresolution() override {
141  parent_->channel_control_helper()->RequestReresolution();
142  }
143 
144  absl::string_view GetAuthority() override {
145  return parent_->channel_control_helper()->GetAuthority();
146  }
147 
148  void AddTraceEvent(TraceSeverity severity,
149  absl::string_view message) override {
150  parent_->channel_control_helper()->AddTraceEvent(severity, message);
151  }
152 
153  private:
154  RefCountedPtr<TestPickArgsLb> parent_;
156  };
157 };
158 
159 class TestPickArgsLbConfig : public LoadBalancingPolicy::Config {
160  public:
161  const char* name() const override { return kTestPickArgsLbPolicyName; }
162 };
163 
164 class TestPickArgsLbFactory : public LoadBalancingPolicyFactory {
165  public:
166  explicit TestPickArgsLbFactory(TestPickArgsCallback cb,
167  const char* delegate_policy_name)
168  : cb_(std::move(cb)), delegate_policy_name_(delegate_policy_name) {}
169 
170  OrphanablePtr<LoadBalancingPolicy> CreateLoadBalancingPolicy(
171  LoadBalancingPolicy::Args args) const override {
172  return MakeOrphanable<TestPickArgsLb>(std::move(args), cb_,
174  }
175 
176  const char* name() const override { return kTestPickArgsLbPolicyName; }
177 
178  RefCountedPtr<LoadBalancingPolicy::Config> ParseLoadBalancingConfig(
179  const Json& /*json*/, grpc_error_handle* /*error*/) const override {
180  return MakeRefCounted<TestPickArgsLbConfig>();
181  }
182 
183  private:
186 };
187 
188 //
189 // InterceptRecvTrailingMetadataLoadBalancingPolicy
190 //
191 
192 constexpr char kInterceptRecvTrailingMetadataLbPolicyName[] =
193  "intercept_trailing_metadata_lb";
194 
195 class InterceptRecvTrailingMetadataLoadBalancingPolicy
196  : public ForwardingLoadBalancingPolicy {
197  public:
198  InterceptRecvTrailingMetadataLoadBalancingPolicy(
200  : ForwardingLoadBalancingPolicy(
201  absl::make_unique<Helper>(
202  RefCountedPtr<InterceptRecvTrailingMetadataLoadBalancingPolicy>(
203  this),
204  std::move(cb)),
205  std::move(args),
206  /*delegate_policy_name=*/"pick_first",
207  /*initial_refcount=*/2) {}
208 
209  ~InterceptRecvTrailingMetadataLoadBalancingPolicy() override = default;
210 
211  const char* name() const override {
212  return kInterceptRecvTrailingMetadataLbPolicyName;
213  }
214 
215  private:
216  class Picker : public SubchannelPicker {
217  public:
218  Picker(std::unique_ptr<SubchannelPicker> delegate_picker,
220  : delegate_picker_(std::move(delegate_picker)), cb_(std::move(cb)) {}
221 
222  PickResult Pick(PickArgs args) override {
223  // Do pick.
224  PickResult result = delegate_picker_->Pick(args);
225  // Intercept trailing metadata.
226  auto* complete_pick = absl::get_if<PickResult::Complete>(&result.result);
227  if (complete_pick != nullptr) {
228  complete_pick->subchannel_call_tracker =
229  absl::make_unique<SubchannelCallTracker>(cb_);
230  }
231  return result;
232  }
233 
234  private:
235  std::unique_ptr<SubchannelPicker> delegate_picker_;
237  };
238 
239  class Helper : public ChannelControlHelper {
240  public:
241  Helper(
242  RefCountedPtr<InterceptRecvTrailingMetadataLoadBalancingPolicy> parent,
244  : parent_(std::move(parent)), cb_(std::move(cb)) {}
245 
246  RefCountedPtr<SubchannelInterface> CreateSubchannel(
247  ServerAddress address, const grpc_channel_args& args) override {
248  return parent_->channel_control_helper()->CreateSubchannel(
249  std::move(address), args);
250  }
251 
252  void UpdateState(grpc_connectivity_state state, const absl::Status& status,
253  std::unique_ptr<SubchannelPicker> picker) override {
254  parent_->channel_control_helper()->UpdateState(
255  state, status, absl::make_unique<Picker>(std::move(picker), cb_));
256  }
257 
258  void RequestReresolution() override {
259  parent_->channel_control_helper()->RequestReresolution();
260  }
261 
262  absl::string_view GetAuthority() override {
263  return parent_->channel_control_helper()->GetAuthority();
264  }
265 
266  void AddTraceEvent(TraceSeverity severity,
267  absl::string_view message) override {
268  parent_->channel_control_helper()->AddTraceEvent(severity, message);
269  }
270 
271  private:
272  RefCountedPtr<InterceptRecvTrailingMetadataLoadBalancingPolicy> parent_;
274  };
275 
276  class SubchannelCallTracker : public SubchannelCallTrackerInterface {
277  public:
278  explicit SubchannelCallTracker(InterceptRecvTrailingMetadataCallback cb)
279  : cb_(std::move(cb)) {}
280 
281  void Start() override {}
282 
283  void Finish(FinishArgs args) override {
284  TrailingMetadataArgsSeen args_seen;
285  args_seen.status = args.status;
286  args_seen.backend_metric_data =
287  args.backend_metric_accessor->GetBackendMetricData();
288  args_seen.metadata = args.trailing_metadata->TestOnlyCopyToVector();
289  cb_(args_seen);
290  }
291 
292  private:
294  };
295 };
296 
297 class InterceptTrailingConfig : public LoadBalancingPolicy::Config {
298  public:
299  const char* name() const override {
300  return kInterceptRecvTrailingMetadataLbPolicyName;
301  }
302 };
303 
304 class InterceptTrailingFactory : public LoadBalancingPolicyFactory {
305  public:
306  explicit InterceptTrailingFactory(InterceptRecvTrailingMetadataCallback cb)
307  : cb_(std::move(cb)) {}
308 
309  OrphanablePtr<LoadBalancingPolicy> CreateLoadBalancingPolicy(
310  LoadBalancingPolicy::Args args) const override {
311  return MakeOrphanable<InterceptRecvTrailingMetadataLoadBalancingPolicy>(
312  std::move(args), cb_);
313  }
314 
315  const char* name() const override {
316  return kInterceptRecvTrailingMetadataLbPolicyName;
317  }
318 
319  RefCountedPtr<LoadBalancingPolicy::Config> ParseLoadBalancingConfig(
320  const Json& /*json*/, grpc_error_handle* /*error*/) const override {
321  return MakeRefCounted<InterceptTrailingConfig>();
322  }
323 
324  private:
326 };
327 
328 //
329 // AddressTestLoadBalancingPolicy
330 //
331 
332 constexpr char kAddressTestLbPolicyName[] = "address_test_lb";
333 
334 class AddressTestLoadBalancingPolicy : public ForwardingLoadBalancingPolicy {
335  public:
336  AddressTestLoadBalancingPolicy(Args args, AddressTestCallback cb)
337  : ForwardingLoadBalancingPolicy(
338  absl::make_unique<Helper>(
339  RefCountedPtr<AddressTestLoadBalancingPolicy>(this),
340  std::move(cb)),
341  std::move(args),
342  /*delegate_policy_name=*/"pick_first",
343  /*initial_refcount=*/2) {}
344 
345  ~AddressTestLoadBalancingPolicy() override = default;
346 
347  const char* name() const override { return kAddressTestLbPolicyName; }
348 
349  private:
350  class Helper : public ChannelControlHelper {
351  public:
352  Helper(RefCountedPtr<AddressTestLoadBalancingPolicy> parent,
354  : parent_(std::move(parent)), cb_(std::move(cb)) {}
355 
356  RefCountedPtr<SubchannelInterface> CreateSubchannel(
357  ServerAddress address, const grpc_channel_args& args) override {
358  cb_(address);
359  return parent_->channel_control_helper()->CreateSubchannel(
360  std::move(address), args);
361  }
362 
363  void UpdateState(grpc_connectivity_state state, const absl::Status& status,
364  std::unique_ptr<SubchannelPicker> picker) override {
365  parent_->channel_control_helper()->UpdateState(state, status,
366  std::move(picker));
367  }
368 
369  void RequestReresolution() override {
370  parent_->channel_control_helper()->RequestReresolution();
371  }
372 
373  absl::string_view GetAuthority() override {
374  return parent_->channel_control_helper()->GetAuthority();
375  }
376 
377  void AddTraceEvent(TraceSeverity severity,
378  absl::string_view message) override {
379  parent_->channel_control_helper()->AddTraceEvent(severity, message);
380  }
381 
382  private:
383  RefCountedPtr<AddressTestLoadBalancingPolicy> parent_;
385  };
386 };
387 
388 class AddressTestConfig : public LoadBalancingPolicy::Config {
389  public:
390  const char* name() const override { return kAddressTestLbPolicyName; }
391 };
392 
393 class AddressTestFactory : public LoadBalancingPolicyFactory {
394  public:
395  explicit AddressTestFactory(AddressTestCallback cb) : cb_(std::move(cb)) {}
396 
397  OrphanablePtr<LoadBalancingPolicy> CreateLoadBalancingPolicy(
398  LoadBalancingPolicy::Args args) const override {
399  return MakeOrphanable<AddressTestLoadBalancingPolicy>(std::move(args), cb_);
400  }
401 
402  const char* name() const override { return kAddressTestLbPolicyName; }
403 
404  RefCountedPtr<LoadBalancingPolicy::Config> ParseLoadBalancingConfig(
405  const Json& /*json*/, grpc_error_handle* /*error*/) const override {
406  return MakeRefCounted<AddressTestConfig>();
407  }
408 
409  private:
411 };
412 
413 //
414 // FixedAddressLoadBalancingPolicy
415 //
416 
417 constexpr char kFixedAddressLbPolicyName[] = "fixed_address_lb";
418 
419 class FixedAddressConfig : public LoadBalancingPolicy::Config {
420  public:
421  explicit FixedAddressConfig(std::string address)
422  : address_(std::move(address)) {}
423 
424  const char* name() const override { return kFixedAddressLbPolicyName; }
425 
426  const std::string& address() const { return address_; }
427 
428  private:
430 };
431 
432 class FixedAddressLoadBalancingPolicy : public ForwardingLoadBalancingPolicy {
433  public:
434  explicit FixedAddressLoadBalancingPolicy(Args args)
435  : ForwardingLoadBalancingPolicy(
436  absl::make_unique<Helper>(
437  RefCountedPtr<FixedAddressLoadBalancingPolicy>(this)),
438  std::move(args),
439  /*delegate_policy_name=*/"pick_first",
440  /*initial_refcount=*/2) {}
441 
442  ~FixedAddressLoadBalancingPolicy() override = default;
443 
444  const char* name() const override { return kFixedAddressLbPolicyName; }
445 
446  void UpdateLocked(UpdateArgs args) override {
447  auto* config = static_cast<FixedAddressConfig*>(args.config.get());
448  gpr_log(GPR_INFO, "%s: update URI: %s", kFixedAddressLbPolicyName,
449  config->address().c_str());
450  auto uri = URI::Parse(config->address());
451  args.config.reset();
452  args.addresses = ServerAddressList();
453  if (uri.ok()) {
454  grpc_resolved_address address;
455  GPR_ASSERT(grpc_parse_uri(*uri, &address));
456  args.addresses->emplace_back(address, /*args=*/nullptr);
457  } else {
459  "%s: could not parse URI (%s), using empty address list",
460  kFixedAddressLbPolicyName, uri.status().ToString().c_str());
461  args.resolution_note = "no address in fixed_address_lb policy";
462  }
463  ForwardingLoadBalancingPolicy::UpdateLocked(std::move(args));
464  }
465 
466  private:
467  class Helper : public ChannelControlHelper {
468  public:
469  explicit Helper(RefCountedPtr<FixedAddressLoadBalancingPolicy> parent)
470  : parent_(std::move(parent)) {}
471 
472  RefCountedPtr<SubchannelInterface> CreateSubchannel(
473  ServerAddress address, const grpc_channel_args& args) override {
474  return parent_->channel_control_helper()->CreateSubchannel(
475  std::move(address), args);
476  }
477 
478  void UpdateState(grpc_connectivity_state state, const absl::Status& status,
479  std::unique_ptr<SubchannelPicker> picker) override {
480  parent_->channel_control_helper()->UpdateState(state, status,
481  std::move(picker));
482  }
483 
484  void RequestReresolution() override {
485  parent_->channel_control_helper()->RequestReresolution();
486  }
487 
488  absl::string_view GetAuthority() override {
489  return parent_->channel_control_helper()->GetAuthority();
490  }
491 
492  void AddTraceEvent(TraceSeverity severity,
493  absl::string_view message) override {
494  parent_->channel_control_helper()->AddTraceEvent(severity, message);
495  }
496 
497  private:
498  RefCountedPtr<FixedAddressLoadBalancingPolicy> parent_;
499  };
500 };
501 
502 class FixedAddressFactory : public LoadBalancingPolicyFactory {
503  public:
504  FixedAddressFactory() = default;
505 
506  OrphanablePtr<LoadBalancingPolicy> CreateLoadBalancingPolicy(
507  LoadBalancingPolicy::Args args) const override {
508  return MakeOrphanable<FixedAddressLoadBalancingPolicy>(std::move(args));
509  }
510 
511  const char* name() const override { return kFixedAddressLbPolicyName; }
512 
513  RefCountedPtr<LoadBalancingPolicy::Config> ParseLoadBalancingConfig(
514  const Json& json, grpc_error_handle* error) const override {
515  std::vector<grpc_error_handle> error_list;
516  std::string address;
517  ParseJsonObjectField(json.object_value(), "address", &address, &error_list);
518  if (!error_list.empty()) {
520  "errors parsing fixed_address_lb config", &error_list);
521  return nullptr;
522  }
523  return MakeRefCounted<FixedAddressConfig>(std::move(address));
524  }
525 };
526 
527 //
528 // OobBackendMetricTestLoadBalancingPolicy
529 //
530 
531 constexpr char kOobBackendMetricTestLbPolicyName[] =
532  "oob_backend_metric_test_lb";
533 
534 class OobBackendMetricTestConfig : public LoadBalancingPolicy::Config {
535  public:
536  const char* name() const override {
537  return kOobBackendMetricTestLbPolicyName;
538  }
539 };
540 
541 class OobBackendMetricTestLoadBalancingPolicy
542  : public ForwardingLoadBalancingPolicy {
543  public:
544  OobBackendMetricTestLoadBalancingPolicy(Args args,
546  : ForwardingLoadBalancingPolicy(
547  absl::make_unique<Helper>(
548  RefCountedPtr<OobBackendMetricTestLoadBalancingPolicy>(this)),
549  std::move(args),
550  /*delegate_policy_name=*/"pick_first",
551  /*initial_refcount=*/2),
552  cb_(std::move(cb)) {}
553 
554  ~OobBackendMetricTestLoadBalancingPolicy() override = default;
555 
556  const char* name() const override {
557  return kOobBackendMetricTestLbPolicyName;
558  }
559 
560  private:
561  class BackendMetricWatcher : public OobBackendMetricWatcher {
562  public:
563  BackendMetricWatcher(
564  ServerAddress address,
565  RefCountedPtr<OobBackendMetricTestLoadBalancingPolicy> parent)
566  : address_(std::move(address)), parent_(std::move(parent)) {}
567 
568  void OnBackendMetricReport(
569  const BackendMetricData& backend_metric_data) override {
570  parent_->cb_(address_, backend_metric_data);
571  }
572 
573  private:
574  ServerAddress address_;
575  RefCountedPtr<OobBackendMetricTestLoadBalancingPolicy> parent_;
576  };
577 
578  class Helper : public ChannelControlHelper {
579  public:
580  explicit Helper(
581  RefCountedPtr<OobBackendMetricTestLoadBalancingPolicy> parent)
582  : parent_(std::move(parent)) {}
583 
584  RefCountedPtr<SubchannelInterface> CreateSubchannel(
585  ServerAddress address, const grpc_channel_args& args) override {
586  auto subchannel =
587  parent_->channel_control_helper()->CreateSubchannel(address, args);
588  subchannel->AddDataWatcher(MakeOobBackendMetricWatcher(
589  Duration::Seconds(1), absl::make_unique<BackendMetricWatcher>(
590  std::move(address), parent_)));
591  return subchannel;
592  }
593 
594  void UpdateState(grpc_connectivity_state state, const absl::Status& status,
595  std::unique_ptr<SubchannelPicker> picker) override {
596  parent_->channel_control_helper()->UpdateState(state, status,
597  std::move(picker));
598  }
599 
600  void RequestReresolution() override {
601  parent_->channel_control_helper()->RequestReresolution();
602  }
603 
604  absl::string_view GetAuthority() override {
605  return parent_->channel_control_helper()->GetAuthority();
606  }
607 
608  void AddTraceEvent(TraceSeverity severity,
609  absl::string_view message) override {
610  parent_->channel_control_helper()->AddTraceEvent(severity, message);
611  }
612 
613  private:
614  RefCountedPtr<OobBackendMetricTestLoadBalancingPolicy> parent_;
615  };
616 
617  private:
619 };
620 
621 class OobBackendMetricTestFactory : public LoadBalancingPolicyFactory {
622  public:
623  explicit OobBackendMetricTestFactory(OobBackendMetricCallback cb)
624  : cb_(std::move(cb)) {}
625 
626  OrphanablePtr<LoadBalancingPolicy> CreateLoadBalancingPolicy(
627  LoadBalancingPolicy::Args args) const override {
628  return MakeOrphanable<OobBackendMetricTestLoadBalancingPolicy>(
629  std::move(args), cb_);
630  }
631 
632  const char* name() const override {
633  return kOobBackendMetricTestLbPolicyName;
634  }
635 
636  RefCountedPtr<LoadBalancingPolicy::Config> ParseLoadBalancingConfig(
637  const Json& /*json*/, grpc_error_handle* /*error*/) const override {
638  return MakeRefCounted<OobBackendMetricTestConfig>();
639  }
640 
641  private:
643 };
644 
645 } // namespace
646 
648  const char* delegate_policy_name) {
650  absl::make_unique<TestPickArgsLbFactory>(std::move(cb),
651  delegate_policy_name));
652 }
653 
657  absl::make_unique<InterceptTrailingFactory>(std::move(cb)));
658 }
659 
662  absl::make_unique<AddressTestFactory>(std::move(cb)));
663 }
664 
667  absl::make_unique<FixedAddressFactory>());
668 }
669 
673  absl::make_unique<OobBackendMetricTestFactory>(std::move(cb)));
674 }
675 
676 } // namespace grpc_core
trace.h
_gevent_test_main.result
result
Definition: _gevent_test_main.py:96
GPR_INFO
#define GPR_INFO
Definition: include/grpc/impl/codegen/log.h:56
grpc_core::LoadBalancingPolicyRegistry::Builder::RegisterLoadBalancingPolicyFactory
static void RegisterLoadBalancingPolicyFactory(std::unique_ptr< LoadBalancingPolicyFactory > factory)
Definition: lb_policy_registry.cc:87
orphanable.h
log.h
bloat_diff.severity
def severity
Definition: bloat_diff.py:143
grpc_core::TestPickArgsCallback
std::function< void(const PickArgsSeen &)> TestPickArgsCallback
Definition: test_lb_policies.h:31
connectivity_state.h
grpc_core
Definition: call_metric_recorder.h:31
ExitIdleLocked
void StartUpdate() ABSL_EXCLUSIVE_LOCKS_REQUIRED(&RlsLb void MaybeFinishUpdate() ABSL_LOCKS_EXCLUDED(&RlsLb void ExitIdleLocked()
Definition: rls.cc:299
absl::string_view
Definition: abseil-cpp/absl/strings/string_view.h:167
subchannel
RingHashSubchannelData * subchannel
Definition: ring_hash.cc:285
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
lb_policy.h
grpc_resolved_address
Definition: resolved_address.h:34
closure.h
grpc_core::RegisterOobBackendMetricTestLoadBalancingPolicy
void RegisterOobBackendMetricTestLoadBalancingPolicy(OobBackendMetricCallback cb)
Definition: test_lb_policies.cc:670
status
absl::Status status
Definition: rls.cc:251
grpc_core::RegisterAddressTestLoadBalancingPolicy
void RegisterAddressTestLoadBalancingPolicy(AddressTestCallback cb)
Definition: test_lb_policies.cc:660
setup.name
name
Definition: setup.py:542
absl::make_unique
memory_internal::MakeUniqueResult< T >::scalar make_unique(Args &&... args)
Definition: third_party/abseil-cpp/absl/memory/memory.h:168
oob_backend_metric.h
grpc_core::URI::Parse
static absl::StatusOr< URI > Parse(absl::string_view uri_text)
Definition: uri_parser.cc:209
channelz.h
grpc_channel_args
Definition: grpc_types.h:132
message
char * message
Definition: libuv/docs/code/tty-gravity/main.c:12
grpc_connectivity_state
grpc_connectivity_state
Definition: include/grpc/impl/codegen/connectivity_state.h:30
test_lb_policies.h
GRPC_ERROR_CREATE_FROM_VECTOR
#define GRPC_ERROR_CREATE_FROM_VECTOR(desc, error_list)
Definition: error.h:314
memory.h
grpc_parse_uri
bool grpc_parse_uri(const grpc_core::URI &uri, grpc_resolved_address *resolved_addr)
Definition: parse_address.cc:293
parent_
RefCountedPtr< TestPickArgsLb > parent_
Definition: test_lb_policies.cc:154
parse_address.h
asyncio_get_stats.args
args
Definition: asyncio_get_stats.py:40
absl::move
constexpr absl::remove_reference_t< T > && move(T &&t) noexcept
Definition: abseil-cpp/absl/utility/utility.h:221
GPR_ASSERT
#define GPR_ASSERT(x)
Definition: include/grpc/impl/codegen/log.h:94
hpack_encoder_fixtures::Args
Args({0, 16384})
cb_
TestPickArgsCallback cb_
Definition: test_lb_policies.cc:120
Json
JSON (JavaScript Object Notation).
Definition: third_party/bloaty/third_party/protobuf/conformance/third_party/jsoncpp/json.h:227
grpc_core::MakeOobBackendMetricWatcher
std::unique_ptr< SubchannelInterface::DataWatcherInterface > MakeOobBackendMetricWatcher(Duration report_interval, std::unique_ptr< OobBackendMetricWatcher > watcher)
Definition: oob_backend_metric.cc:402
gpr_log
GPRAPI void gpr_log(const char *file, int line, gpr_log_severity severity, const char *format,...) GPR_PRINT_FORMAT_CHECK(4
delegate_policy_name_
const char * delegate_policy_name_
Definition: test_lb_policies.cc:185
json_util.h
pollset_set.h
grpc_core::RegisterInterceptRecvTrailingMetadataLoadBalancingPolicy
void RegisterInterceptRecvTrailingMetadataLoadBalancingPolicy(InterceptRecvTrailingMetadataCallback cb)
Definition: test_lb_policies.cc:654
intptr_t
_W64 signed int intptr_t
Definition: stdint-msvc2008.h:118
grpc_core::RegisterTestPickArgsLoadBalancingPolicy
void RegisterTestPickArgsLoadBalancingPolicy(TestPickArgsCallback cb, const char *delegate_policy_name)
Definition: test_lb_policies.cc:647
error.h
json.h
GPR_ERROR
#define GPR_ERROR
Definition: include/grpc/impl/codegen/log.h:57
grpc_core::ServerAddressList
std::vector< ServerAddress > ServerAddressList
Definition: server_address.h:120
grpc_core::LoadBalancingPolicyRegistry::CreateLoadBalancingPolicy
static OrphanablePtr< LoadBalancingPolicy > CreateLoadBalancingPolicy(const char *name, LoadBalancingPolicy::Args args)
Creates an LB policy of the type specified by name.
Definition: lb_policy_registry.cc:98
delegate_picker_
std::unique_ptr< SubchannelPicker > delegate_picker_
Definition: test_lb_policies.cc:119
grpc_core::OobBackendMetricCallback
std::function< void(ServerAddress, const BackendMetricData &)> OobBackendMetricCallback
Definition: test_lb_policies.h:63
delegate_
OrphanablePtr< LoadBalancingPolicy > delegate_
Definition: test_lb_policies.cc:79
lb_policy_registry.h
benchmark::internal::Finish
double Finish(Counter const &c, IterationCount iterations, double cpu_time, double num_threads)
Definition: benchmark/src/counter.cc:20
absl::Status
Definition: third_party/abseil-cpp/absl/status/status.h:424
std
Definition: grpcpp/impl/codegen/async_unary_call.h:407
grpc_pollset_set_add_pollset_set
void grpc_pollset_set_add_pollset_set(grpc_pollset_set *bag, grpc_pollset_set *item)
Definition: pollset_set.cc:47
grpc_core::AddressTestCallback
std::function< void(const ServerAddress &)> AddressTestCallback
Definition: test_lb_policies.h:52
grpc_core::Duration::Seconds
static constexpr Duration Seconds(int64_t seconds)
Definition: src/core/lib/gprpp/time.h:151
combiner.h
state
Definition: bloaty/third_party/zlib/contrib/blast/blast.c:41
grpc_core::RegisterFixedAddressLoadBalancingPolicy
void RegisterFixedAddressLoadBalancingPolicy()
Definition: test_lb_policies.cc:665
ref_counted_ptr.h
config_s
Definition: bloaty/third_party/zlib/deflate.c:120
channel_args.h
check_redundant_namespace_qualifiers.Config
Config
Definition: check_redundant_namespace_qualifiers.py:142
absl
Definition: abseil-cpp/absl/algorithm/algorithm.h:31
grpc_error
Definition: error_internal.h:42
grpc_core::InterceptRecvTrailingMetadataCallback
std::function< void(const TrailingMetadataArgsSeen &)> InterceptRecvTrailingMetadataCallback
Definition: test_lb_policies.h:45
cb
OPENSSL_EXPORT pem_password_cb * cb
Definition: pem.h:351
grpc_core::ParseJsonObjectField
bool ParseJsonObjectField(const Json::Object &object, absl::string_view field_name, T *output, std::vector< grpc_error_handle > *error_list, bool required=true)
Definition: src/core/lib/json/json_util.h:136
address_
std::string address_
Definition: test_lb_policies.cc:429


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