retry_service_config.h
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 
17 #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RETRY_SERVICE_CONFIG_H
18 #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RETRY_SERVICE_CONFIG_H
19 
21 
22 #include <stddef.h>
23 #include <stdint.h>
24 
25 #include <memory>
26 
27 #include "absl/strings/string_view.h"
28 #include "absl/types/optional.h"
29 
31 
36 #include "src/core/lib/json/json.h"
38 
39 namespace grpc_core {
40 namespace internal {
41 
43  public:
47 
50 
51  private:
54 };
55 
57  public:
68 
69  int max_attempts() const { return max_attempts_; }
71  Duration max_backoff() const { return max_backoff_; }
72  float backoff_multiplier() const { return backoff_multiplier_; }
75  }
78  }
79 
80  private:
81  int max_attempts_ = 0;
87 };
88 
90  public:
91  absl::string_view name() const override { return parser_name(); }
92 
93  std::unique_ptr<ServiceConfigParser::ParsedConfig> ParseGlobalParams(
94  const grpc_channel_args* /*args*/, const Json& json,
95  grpc_error_handle* error) override;
96 
97  std::unique_ptr<ServiceConfigParser::ParsedConfig> ParsePerMethodParams(
98  const grpc_channel_args* args, const Json& json,
99  grpc_error_handle* error) override;
100 
101  static size_t ParserIndex();
103 
104  private:
105  static absl::string_view parser_name() { return "retry"; }
106 };
107 
108 } // namespace internal
109 } // namespace grpc_core
110 
111 #endif // GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RETRY_SERVICE_CONFIG_H
core_configuration.h
grpc_core::internal::RetryGlobalConfig::RetryGlobalConfig
RetryGlobalConfig(intptr_t max_milli_tokens, intptr_t milli_token_ratio)
Definition: retry_service_config.h:44
grpc_core::internal::RetryMethodConfig::retryable_status_codes_
StatusCodeSet retryable_status_codes_
Definition: retry_service_config.h:85
grpc_core::internal::RetryGlobalConfig::max_milli_tokens
intptr_t max_milli_tokens() const
Definition: retry_service_config.h:48
grpc_core::internal::RetryServiceConfigParser::ParsePerMethodParams
std::unique_ptr< ServiceConfigParser::ParsedConfig > ParsePerMethodParams(const grpc_channel_args *args, const Json &json, grpc_error_handle *error) override
Definition: retry_service_config.cc:290
grpc_core::internal::RetryGlobalConfig
Definition: retry_service_config.h:42
grpc_core::internal::RetryMethodConfig::backoff_multiplier_
float backoff_multiplier_
Definition: retry_service_config.h:84
grpc_core
Definition: call_metric_recorder.h:31
grpc_core::internal::RetryServiceConfigParser::parser_name
static absl::string_view parser_name()
Definition: retry_service_config.h:105
grpc_core::CoreConfiguration::Builder
Definition: core_configuration.h:41
status_util.h
grpc_core::ServiceConfigParser::Parser
This is the base class that all service config parsers should derive from.
Definition: lib/service_config/service_config_parser.h:51
grpc_core::internal::RetryServiceConfigParser::ParseGlobalParams
std::unique_ptr< ServiceConfigParser::ParsedConfig > ParseGlobalParams(const grpc_channel_args *, const Json &json, grpc_error_handle *error) override
Definition: retry_service_config.cc:141
absl::string_view
Definition: abseil-cpp/absl/strings/string_view.h:167
grpc_core::internal::RetryMethodConfig::max_attempts
int max_attempts() const
Definition: retry_service_config.h:69
error
grpc_error_handle error
Definition: retry_filter.cc:499
grpc_core::internal::RetryMethodConfig::max_backoff
Duration max_backoff() const
Definition: retry_service_config.h:71
grpc_core::internal::RetryMethodConfig
Definition: retry_service_config.h:56
grpc_channel_args
Definition: grpc_types.h:132
grpc_core::internal::RetryServiceConfigParser
Definition: retry_service_config.h:89
grpc_types.h
profile_analyzer.builder
builder
Definition: profile_analyzer.py:159
asyncio_get_stats.args
args
Definition: asyncio_get_stats.py:40
grpc_core::internal::RetryMethodConfig::backoff_multiplier
float backoff_multiplier() const
Definition: retry_service_config.h:72
Json
JSON (JavaScript Object Notation).
Definition: third_party/bloaty/third_party/protobuf/conformance/third_party/jsoncpp/json.h:227
grpc_core::internal::RetryServiceConfigParser::Register
static void Register(CoreConfiguration::Builder *builder)
Definition: retry_service_config.cc:53
grpc_core::internal::RetryMethodConfig::per_attempt_recv_timeout
absl::optional< Duration > per_attempt_recv_timeout() const
Definition: retry_service_config.h:76
absl::optional
Definition: abseil-cpp/absl/types/internal/optional.h:61
time.h
grpc_core::internal::RetryMethodConfig::retryable_status_codes
StatusCodeSet retryable_status_codes() const
Definition: retry_service_config.h:73
intptr_t
_W64 signed int intptr_t
Definition: stdint-msvc2008.h:118
error.h
json.h
grpc_core::internal::RetryMethodConfig::max_attempts_
int max_attempts_
Definition: retry_service_config.h:81
stdint.h
grpc_core::internal::RetryGlobalConfig::milli_token_ratio_
intptr_t milli_token_ratio_
Definition: retry_service_config.h:53
service_config_parser.h
grpc_core::internal::RetryGlobalConfig::milli_token_ratio
intptr_t milli_token_ratio() const
Definition: retry_service_config.h:49
grpc_core::internal::RetryMethodConfig::initial_backoff
Duration initial_backoff() const
Definition: retry_service_config.h:70
grpc_core::internal::StatusCodeSet
A set of grpc_status_code values.
Definition: status_util.h:43
grpc_core::internal::RetryMethodConfig::per_attempt_recv_timeout_
absl::optional< Duration > per_attempt_recv_timeout_
Definition: retry_service_config.h:86
grpc_core::internal::RetryMethodConfig::RetryMethodConfig
RetryMethodConfig(int max_attempts, Duration initial_backoff, Duration max_backoff, float backoff_multiplier, StatusCodeSet retryable_status_codes, absl::optional< Duration > per_attempt_recv_timeout)
Definition: retry_service_config.h:58
grpc_core::internal::RetryServiceConfigParser::name
absl::string_view name() const override
Definition: retry_service_config.h:91
grpc_core::internal::RetryMethodConfig::max_backoff_
Duration max_backoff_
Definition: retry_service_config.h:83
grpc_core::internal::RetryServiceConfigParser::ParserIndex
static size_t ParserIndex()
Definition: retry_service_config.cc:48
internal
Definition: benchmark/test/output_test_helper.cc:20
grpc_error
Definition: error_internal.h:42
grpc_core::Duration
Definition: src/core/lib/gprpp/time.h:122
grpc_core::ServiceConfigParser::ParsedConfig
Definition: lib/service_config/service_config_parser.h:45
grpc_core::internal::RetryMethodConfig::initial_backoff_
Duration initial_backoff_
Definition: retry_service_config.h:82
grpc_core::internal::RetryGlobalConfig::max_milli_tokens_
intptr_t max_milli_tokens_
Definition: retry_service_config.h:52
port_platform.h


grpc
Author(s):
autogenerated on Thu Mar 13 2025 03:01:11