Go to the documentation of this file.
27 #include "absl/memory/memory.h"
28 #include "absl/strings/str_cat.h"
29 #include "absl/types/optional.h"
37 #define MAX_MAX_RETRY_ATTEMPTS 5
49 builder->service_config_parser()->RegisterParser(
50 absl::make_unique<ClientChannelServiceConfigParser>());
60 "field:healthCheckConfig error:should be of type object");
63 std::vector<grpc_error_handle> error_list;
65 auto it =
field.object_value().find(
"serviceName");
66 if (
it !=
field.object_value().end()) {
69 "field:serviceName error:should be of type string"));
71 service_name =
it->second.string_value();
81 std::unique_ptr<ServiceConfigParser::ParsedConfig>
86 std::vector<grpc_error_handle> error_list;
95 std::vector<grpc_error_handle> lb_errors;
98 "field:loadBalancingConfig", &lb_errors));
107 "field:loadBalancingPolicy error:type should be string"));
109 lb_policy_name =
it->second.string_value();
110 for (
size_t i = 0;
i < lb_policy_name.size(); ++
i) {
111 lb_policy_name[
i] = tolower(lb_policy_name[
i]);
113 bool requires_config =
false;
115 lb_policy_name.c_str(), &requires_config)) {
117 "field:loadBalancingPolicy error:Unknown lb policy"));
118 }
else if (requires_config) {
120 absl::StrCat(
"field:loadBalancingPolicy error:", lb_policy_name,
121 " requires a config. Please use loadBalancingConfig "
131 health_check_service_name =
132 ParseHealthCheckConfig(
it->second, &parsing_error);
134 error_list.push_back(parsing_error);
140 return absl::make_unique<ClientChannelGlobalParsedConfig>(
147 std::unique_ptr<ServiceConfigParser::ParsedConfig>
152 std::vector<grpc_error_handle> error_list;
163 "field:waitForReady error:Type should be true/false"));
173 return absl::make_unique<ClientChannelMethodParsedConfig>(
timeout,
std::string StrCat(const AlphaNum &a, const AlphaNum &b)
#define GPR_DEBUG_ASSERT(x)
const ServiceConfigParser & service_config_parser() const
const Object & object_value() const
std::unique_ptr< ServiceConfigParser::ParsedConfig > ParsePerMethodParams(const grpc_channel_args *, const Json &json, grpc_error_handle *error) override
#define GRPC_ERROR_CREATE_FROM_VECTOR(desc, error_list)
constexpr absl::remove_reference_t< T > && move(T &&t) noexcept
static const CoreConfiguration & Get()
JSON (JavaScript Object Notation).
size_t GetParserIndex(absl::string_view name) const
static void Register(CoreConfiguration::Builder *builder)
#define GRPC_ERROR_CREATE_FROM_STATIC_STRING(desc)
static absl::string_view parser_name()
static RefCountedPtr< LoadBalancingPolicy::Config > ParseLoadBalancingConfig(const Json &json, grpc_error_handle *error)
const FieldDescriptor * field
std::unique_ptr< ServiceConfigParser::ParsedConfig > ParseGlobalParams(const grpc_channel_args *, const Json &json, grpc_error_handle *error) override
#define GRPC_ERROR_CREATE_FROM_CPP_STRING(desc)
static bool LoadBalancingPolicyExists(const char *name, bool *requires_config)
bool ParseJsonObjectFieldAsDuration(const Json::Object &object, absl::string_view field_name, Duration *output, std::vector< grpc_error_handle > *error_list, bool required)
static size_t ParserIndex()
#define GRPC_ERROR_IS_NONE(err)
grpc
Author(s):
autogenerated on Thu Mar 13 2025 03:01:11