17 #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SERVICE_CONFIG_H
18 #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SERVICE_CONFIG_H
102 : service_config_(std::move(svc_cfg)) {
103 if (service_config_ !=
nullptr) {
104 method_params_vector_ =
105 service_config_->GetMethodParsedConfigVector(path);
112 return method_params_vector_ !=
nullptr
113 ? (*method_params_vector_)[index].get()
118 return service_config_->GetGlobalParsedConfig(index);
144 return parsed_global_configs_[index].get();
170 static int CountNamesInMethodConfig(
grpc_json* json);
177 grpc_error* ParseJsonMethodConfigToServiceConfigVectorTable(
186 parsed_global_configs_;
191 parsed_method_configs_table_;
195 parsed_method_config_vectors_storage_;
Definition: inlined_vector.h:60
Definition: ref_counted.h:248
Definition: ref_counted_ptr.h:35
When a service config is applied to a call in the client_channel_filter, we create an instance of thi...
Definition: service_config.h:98
ServiceConfig * service_config()
Definition: service_config.h:109
ParsedConfig * GetMethodParsedConfig(size_t index) const
Definition: service_config.h:111
CallData(RefCountedPtr< ServiceConfig > svc_cfg, const grpc_slice &path)
Definition: service_config.h:101
ParsedConfig * GetGlobalParsedConfig(size_t index) const
Definition: service_config.h:117
This is the base class that all service config parsers MUST use to store parsed service config data.
Definition: service_config.h:62
virtual ~ParsedConfig()=default
This is the base class that all service config parsers should derive from.
Definition: service_config.h:68
virtual ~Parser()=default
virtual std::unique_ptr< ParsedConfig > ParseGlobalParams(const grpc_json *, grpc_error **error)
Definition: service_config.h:72
virtual std::unique_ptr< ParsedConfig > ParsePerMethodParams(const grpc_json *, grpc_error **error)
Definition: service_config.h:80
Definition: service_config.h:58
static constexpr int kNumPreallocatedParsers
Definition: service_config.h:89
InlinedVector< std::unique_ptr< ParsedConfig >, kNumPreallocatedParsers > ParsedConfigVector
Definition: service_config.h:91
ServiceConfig(grpc_core::UniquePtr< char > service_config_json, grpc_core::UniquePtr< char > json_string, grpc_json *json_tree, grpc_error **error)
Definition: service_config.cc:58
static void Init()
Definition: service_config.cc:320
static size_t RegisterParser(std::unique_ptr< Parser > parser)
Globally register a service config parser.
Definition: service_config.cc:315
~ServiceConfig()
Definition: service_config.cc:216
static void Shutdown()
Definition: service_config.cc:325
const char * service_config_json() const
Definition: service_config.h:137
static RefCountedPtr< ServiceConfig > Create(const char *json, grpc_error **error)
Creates a new service config from parsing json_string.
Definition: service_config.cc:43
const ParsedConfigVector * GetMethodParsedConfigVector(const grpc_slice &path)
Retrieves the vector of parsed configs for the method identified by path.
Definition: service_config.cc:290
ParsedConfig * GetGlobalParsedConfig(size_t index)
Retrieves the global parsed config at index index.
Definition: service_config.h:142
#define GPR_DEBUG_ASSERT(x)
Definition: log.h:103
Round Robin Policy.
Definition: backend_metric.cc:24
std::unique_ptr< T, DefaultDeleteChar > UniquePtr
Definition: memory.h:45
Definition: slice_hash_table.h:48
Definition: error_internal.h:39
A grpc_slice s, if initialized, represents the byte range s.bytes[0..s.length-1].
Definition: slice.h:60