Merge remote-tracking branch 'upstream/master' into spiffe1

pull/19778/head
Matthew Stevenson 6 years ago
commit 65bf49abba
  1. 3
      .gitmodules
  2. 30
      BUILD
  3. 8
      BUILD.gn
  4. 105
      CMakeLists.txt
  5. 118
      Makefile
  6. 11
      bazel/grpc_build_system.bzl
  7. 8
      bazel/python_rules.bzl
  8. 6
      bazel/test/python_test_repo/BUILD
  9. 15
      build.yaml
  10. 29
      config.m4
  11. 32
      config.w32
  12. 2
      examples/BUILD
  13. 2
      examples/python/cancellation/BUILD.bazel
  14. 2
      examples/python/multiprocessing/BUILD
  15. 84
      gRPC-Core.podspec
  16. 30
      gRPC-ProtoRPC.podspec
  17. 17
      gRPC-RxLibrary.podspec
  18. 116
      gRPC.podspec
  19. 56
      grpc.gemspec
  20. 84
      grpc.gyp
  21. 56
      package.xml
  22. 97
      src/compiler/objective_c_generator.cc
  23. 14
      src/compiler/objective_c_generator.h
  24. 60
      src/compiler/objective_c_plugin.cc
  25. 78
      src/core/ext/filters/client_channel/backend_metric.cc
  26. 36
      src/core/ext/filters/client_channel/backend_metric.h
  27. 123
      src/core/ext/filters/client_channel/client_channel.cc
  28. 10
      src/core/ext/filters/client_channel/http_proxy.cc
  29. 2
      src/core/ext/filters/client_channel/lb_policy.cc
  30. 81
      src/core/ext/filters/client_channel/lb_policy.h
  31. 5
      src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc
  32. 9
      src/core/ext/filters/client_channel/lb_policy/xds/xds.cc
  33. 4
      src/core/ext/filters/client_channel/resolving_lb_policy.cc
  34. 31
      src/core/ext/filters/load_reporting/registered_opencensus_objects.h
  35. 2
      src/core/ext/transport/chttp2/transport/hpack_table.cc
  36. 4
      src/core/ext/transport/chttp2/transport/hpack_table.h
  37. 37
      src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c
  38. 83
      src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.h
  39. 67
      src/core/ext/upb-generated/envoy/api/v2/cds.upb.c
  40. 81
      src/core/ext/upb-generated/envoy/api/v2/cds.upb.h
  41. 34
      src/core/ext/upb-generated/envoy/api/v2/cluster/filter.upb.c
  42. 69
      src/core/ext/upb-generated/envoy/api/v2/cluster/filter.upb.h
  43. 32
      src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c
  44. 87
      src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.h
  45. 32
      src/core/ext/upb-generated/envoy/api/v2/core/base.upb.c
  46. 98
      src/core/ext/upb-generated/envoy/api/v2/core/base.upb.h
  47. 15
      src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c
  48. 32
      src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.h
  49. 35
      src/core/ext/upb-generated/envoy/api/v2/core/http_uri.upb.c
  50. 80
      src/core/ext/upb-generated/envoy/api/v2/core/http_uri.upb.h
  51. 12
      src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c
  52. 69
      src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.h
  53. 58
      src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c
  54. 144
      src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.h
  55. 11
      src/core/lib/gprpp/map.h
  56. 20
      src/core/lib/slice/slice_intern.cc
  57. 2
      src/core/lib/slice/slice_internal.h
  58. 8
      src/core/lib/slice/slice_utils.h
  59. 3
      src/core/lib/surface/init.cc
  60. 8
      src/core/lib/transport/metadata.cc
  61. 1856
      src/core/lib/transport/static_metadata.cc
  62. 460
      src/core/lib/transport/static_metadata.h
  63. 4
      src/cpp/client/create_channel.cc
  64. 17
      src/cpp/ext/filters/census/grpc_plugin.cc
  65. 9
      src/cpp/ext/filters/census/grpc_plugin.h
  66. 11
      src/cpp/server/load_reporter/load_reporter.cc
  67. 11
      src/cpp/server/load_reporter/load_reporter.h
  68. 244
      src/objective-c/BUILD
  69. 2
      src/objective-c/GRPCClient/GRPCCall+ChannelArg.h
  70. 4
      src/objective-c/GRPCClient/GRPCCall+ChannelArg.m
  71. 2
      src/objective-c/GRPCClient/GRPCCall+ChannelCredentials.h
  72. 2
      src/objective-c/GRPCClient/GRPCCall+ChannelCredentials.m
  73. 13
      src/objective-c/GRPCClient/GRPCCall+Cronet.h
  74. 4
      src/objective-c/GRPCClient/GRPCCall+Cronet.m
  75. 2
      src/objective-c/GRPCClient/GRPCCall+GID.h
  76. 4
      src/objective-c/GRPCClient/GRPCCall+OAuth2.h
  77. 2
      src/objective-c/GRPCClient/GRPCCall+Tests.h
  78. 2
      src/objective-c/GRPCClient/GRPCCall+Tests.m
  79. 240
      src/objective-c/GRPCClient/GRPCCall.h
  80. 867
      src/objective-c/GRPCClient/GRPCCall.m
  81. 136
      src/objective-c/GRPCClient/GRPCCallLegacy.h
  82. 677
      src/objective-c/GRPCClient/GRPCCallLegacy.m
  83. 82
      src/objective-c/GRPCClient/GRPCCallOptions.h
  84. 27
      src/objective-c/GRPCClient/GRPCCallOptions.m
  85. 30
      src/objective-c/GRPCClient/GRPCDispatchable.h
  86. 32
      src/objective-c/GRPCClient/GRPCInterceptor.h
  87. 265
      src/objective-c/GRPCClient/GRPCInterceptor.m
  88. 82
      src/objective-c/GRPCClient/GRPCTransport.h
  89. 142
      src/objective-c/GRPCClient/GRPCTransport.m
  90. 187
      src/objective-c/GRPCClient/GRPCTypes.h
  91. 2
      src/objective-c/GRPCClient/internal_testing/GRPCCall+InternalTests.m
  92. 0
      src/objective-c/GRPCClient/private/ChannelArgsUtil.h
  93. 0
      src/objective-c/GRPCClient/private/ChannelArgsUtil.m
  94. 6
      src/objective-c/GRPCClient/private/GRPCCall+V2API.h
  95. 14
      src/objective-c/GRPCClient/private/GRPCCallInternal.h
  96. 140
      src/objective-c/GRPCClient/private/GRPCCallInternal.m
  97. 0
      src/objective-c/GRPCClient/private/GRPCChannel.h
  98. 72
      src/objective-c/GRPCClient/private/GRPCChannel.m
  99. 0
      src/objective-c/GRPCClient/private/GRPCChannelFactory.h
  100. 0
      src/objective-c/GRPCClient/private/GRPCChannelPool+Test.h
  101. Some files were not shown because too many files have changed in this diff Show More

3
.gitmodules vendored

@ -54,3 +54,6 @@
[submodule "third_party/upb"]
path = third_party/upb
url = https://github.com/protocolbuffers/upb.git
[submodule "third_party/udpa"]
path = third_party/udpa
url = https://github.com/cncf/udpa.git

30
BUILD

@ -1013,6 +1013,7 @@ grpc_cc_library(
name = "grpc_client_channel",
srcs = [
"src/core/ext/filters/client_channel/backup_poller.cc",
"src/core/ext/filters/client_channel/backend_metric.cc",
"src/core/ext/filters/client_channel/channel_connectivity.cc",
"src/core/ext/filters/client_channel/client_channel.cc",
"src/core/ext/filters/client_channel/client_channel_channelz.cc",
@ -1041,6 +1042,7 @@ grpc_cc_library(
],
hdrs = [
"src/core/ext/filters/client_channel/backup_poller.h",
"src/core/ext/filters/client_channel/backend_metric.h",
"src/core/ext/filters/client_channel/client_channel.h",
"src/core/ext/filters/client_channel/client_channel_channelz.h",
"src/core/ext/filters/client_channel/client_channel_factory.h",
@ -1070,6 +1072,7 @@ grpc_cc_library(
],
language = "c++",
deps = [
"envoy_orca_upb",
"gpr_base",
"grpc_base",
"grpc_client_authority_filter",
@ -2282,6 +2285,7 @@ grpc_cc_library(
"src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c",
"src/core/ext/upb-generated/envoy/api/v2/cds.upb.c",
"src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c",
"src/core/ext/upb-generated/envoy/api/v2/cluster/filter.upb.c",
"src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c",
"src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c",
"src/core/ext/upb-generated/envoy/api/v2/eds.upb.c",
@ -2294,6 +2298,7 @@ grpc_cc_library(
"src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.h",
"src/core/ext/upb-generated/envoy/api/v2/cds.upb.h",
"src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.h",
"src/core/ext/upb-generated/envoy/api/v2/cluster/filter.upb.h",
"src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.h",
"src/core/ext/upb-generated/envoy/api/v2/discovery.upb.h",
"src/core/ext/upb-generated/envoy/api/v2/eds.upb.h",
@ -2322,6 +2327,7 @@ grpc_cc_library(
"src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c",
"src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c",
"src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c",
"src/core/ext/upb-generated/envoy/api/v2/core/http_uri.upb.c",
"src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c",
],
hdrs = [
@ -2330,6 +2336,7 @@ grpc_cc_library(
"src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.h",
"src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.h",
"src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.h",
"src/core/ext/upb-generated/envoy/api/v2/core/http_uri.upb.h",
"src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.h",
],
external_deps = [
@ -2382,6 +2389,29 @@ grpc_cc_library(
],
)
# Once upb code-gen issue is resolved, replace envoy_orca_upb with this.
# grpc_upb_proto_library(
# name = "envoy_orca_upb",
# deps = ["@envoy_api//udpa/data/orca/v1:orca_load_report"]
# )
grpc_cc_library(
name = "envoy_orca_upb",
srcs = [
"src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c",
],
hdrs = [
"src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.h",
],
external_deps = [
"upb_lib",
],
language = "c++",
deps = [
":proto_gen_validate_upb",
],
)
# Once upb code-gen issue is resolved, replace grpc_health_upb with this.
# grpc_upb_proto_library(
# name = "grpc_health_upb",

@ -208,6 +208,8 @@ config("grpc_config") {
"include/grpc/status.h",
"include/grpc/support/workaround_list.h",
"src/core/ext/filters/census/grpc_context.cc",
"src/core/ext/filters/client_channel/backend_metric.cc",
"src/core/ext/filters/client_channel/backend_metric.h",
"src/core/ext/filters/client_channel/backup_poller.cc",
"src/core/ext/filters/client_channel/backup_poller.h",
"src/core/ext/filters/client_channel/channel_connectivity.cc",
@ -388,6 +390,8 @@ config("grpc_config") {
"src/core/ext/upb-generated/envoy/api/v2/cds.upb.h",
"src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c",
"src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.h",
"src/core/ext/upb-generated/envoy/api/v2/cluster/filter.upb.c",
"src/core/ext/upb-generated/envoy/api/v2/cluster/filter.upb.h",
"src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c",
"src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.h",
"src/core/ext/upb-generated/envoy/api/v2/core/address.upb.c",
@ -400,6 +404,8 @@ config("grpc_config") {
"src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.h",
"src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c",
"src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.h",
"src/core/ext/upb-generated/envoy/api/v2/core/http_uri.upb.c",
"src/core/ext/upb-generated/envoy/api/v2/core/http_uri.upb.h",
"src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c",
"src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.h",
"src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c",
@ -450,6 +456,8 @@ config("grpc_config") {
"src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h",
"src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c",
"src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h",
"src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c",
"src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.h",
"src/core/ext/upb-generated/validate/validate.upb.c",
"src/core/ext/upb-generated/validate/validate.upb.h",
"src/core/lib/avl/avl.cc",

@ -1266,6 +1266,7 @@ add_library(grpc
src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc
src/core/ext/transport/chttp2/client/authority.cc
src/core/ext/transport/chttp2/client/chttp2_connector.cc
src/core/ext/filters/client_channel/backend_metric.cc
src/core/ext/filters/client_channel/backup_poller.cc
src/core/ext/filters/client_channel/channel_connectivity.cc
src/core/ext/filters/client_channel/client_channel.cc
@ -1294,6 +1295,19 @@ add_library(grpc
src/core/ext/filters/client_channel/subchannel_pool_interface.cc
src/core/ext/filters/deadline/deadline_filter.cc
src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c
src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c
src/core/ext/upb-generated/gogoproto/gogo.upb.c
src/core/ext/upb-generated/validate/validate.upb.c
src/core/ext/upb-generated/google/api/annotations.upb.c
src/core/ext/upb-generated/google/api/http.upb.c
src/core/ext/upb-generated/google/protobuf/any.upb.c
src/core/ext/upb-generated/google/protobuf/descriptor.upb.c
src/core/ext/upb-generated/google/protobuf/duration.upb.c
src/core/ext/upb-generated/google/protobuf/empty.upb.c
src/core/ext/upb-generated/google/protobuf/struct.upb.c
src/core/ext/upb-generated/google/protobuf/timestamp.upb.c
src/core/ext/upb-generated/google/protobuf/wrappers.upb.c
src/core/ext/upb-generated/google/rpc/status.upb.c
src/core/tsi/fake_transport_security.cc
src/core/tsi/local_transport_security.cc
src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc
@ -1313,16 +1327,6 @@ add_library(grpc
src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc
src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc
src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c
src/core/ext/upb-generated/google/api/annotations.upb.c
src/core/ext/upb-generated/google/api/http.upb.c
src/core/ext/upb-generated/google/protobuf/any.upb.c
src/core/ext/upb-generated/google/protobuf/descriptor.upb.c
src/core/ext/upb-generated/google/protobuf/duration.upb.c
src/core/ext/upb-generated/google/protobuf/empty.upb.c
src/core/ext/upb-generated/google/protobuf/struct.upb.c
src/core/ext/upb-generated/google/protobuf/timestamp.upb.c
src/core/ext/upb-generated/google/protobuf/wrappers.upb.c
src/core/ext/upb-generated/google/rpc/status.upb.c
src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc
src/core/ext/filters/client_channel/lb_policy/xds/xds.cc
src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_secure.cc
@ -1331,6 +1335,7 @@ add_library(grpc
src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c
src/core/ext/upb-generated/envoy/api/v2/cds.upb.c
src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c
src/core/ext/upb-generated/envoy/api/v2/cluster/filter.upb.c
src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c
src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c
src/core/ext/upb-generated/envoy/api/v2/eds.upb.c
@ -1343,11 +1348,10 @@ add_library(grpc
src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c
src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c
src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c
src/core/ext/upb-generated/envoy/api/v2/core/http_uri.upb.c
src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c
src/core/ext/upb-generated/envoy/type/percent.upb.c
src/core/ext/upb-generated/envoy/type/range.upb.c
src/core/ext/upb-generated/gogoproto/gogo.upb.c
src/core/ext/upb-generated/validate/validate.upb.c
src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc
src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc
src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc
@ -1667,6 +1671,7 @@ add_library(grpc_cronet
src/core/ext/filters/http/http_filters_plugin.cc
src/core/ext/filters/http/message_compress/message_compress_filter.cc
src/core/ext/filters/http/server/http_server_filter.cc
src/core/ext/filters/client_channel/backend_metric.cc
src/core/ext/filters/client_channel/backup_poller.cc
src/core/ext/filters/client_channel/channel_connectivity.cc
src/core/ext/filters/client_channel/client_channel.cc
@ -1701,6 +1706,19 @@ add_library(grpc_cronet
third_party/upb/upb/port.c
third_party/upb/upb/table.c
third_party/upb/upb/upb.c
src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c
src/core/ext/upb-generated/gogoproto/gogo.upb.c
src/core/ext/upb-generated/validate/validate.upb.c
src/core/ext/upb-generated/google/api/annotations.upb.c
src/core/ext/upb-generated/google/api/http.upb.c
src/core/ext/upb-generated/google/protobuf/any.upb.c
src/core/ext/upb-generated/google/protobuf/descriptor.upb.c
src/core/ext/upb-generated/google/protobuf/duration.upb.c
src/core/ext/upb-generated/google/protobuf/empty.upb.c
src/core/ext/upb-generated/google/protobuf/struct.upb.c
src/core/ext/upb-generated/google/protobuf/timestamp.upb.c
src/core/ext/upb-generated/google/protobuf/wrappers.upb.c
src/core/ext/upb-generated/google/rpc/status.upb.c
src/core/lib/http/httpcli_security_connector.cc
src/core/lib/security/context/security_context.cc
src/core/lib/security/credentials/alts/alts_credentials.cc
@ -2059,6 +2077,7 @@ add_library(grpc_test_util
src/core/lib/transport/transport_op_string.cc
src/core/lib/uri/uri_parser.cc
src/core/lib/debug/trace.cc
src/core/ext/filters/client_channel/backend_metric.cc
src/core/ext/filters/client_channel/backup_poller.cc
src/core/ext/filters/client_channel/channel_connectivity.cc
src/core/ext/filters/client_channel/client_channel.cc
@ -2093,6 +2112,19 @@ add_library(grpc_test_util
third_party/upb/upb/port.c
third_party/upb/upb/table.c
third_party/upb/upb/upb.c
src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c
src/core/ext/upb-generated/gogoproto/gogo.upb.c
src/core/ext/upb-generated/validate/validate.upb.c
src/core/ext/upb-generated/google/api/annotations.upb.c
src/core/ext/upb-generated/google/api/http.upb.c
src/core/ext/upb-generated/google/protobuf/any.upb.c
src/core/ext/upb-generated/google/protobuf/descriptor.upb.c
src/core/ext/upb-generated/google/protobuf/duration.upb.c
src/core/ext/upb-generated/google/protobuf/empty.upb.c
src/core/ext/upb-generated/google/protobuf/struct.upb.c
src/core/ext/upb-generated/google/protobuf/timestamp.upb.c
src/core/ext/upb-generated/google/protobuf/wrappers.upb.c
src/core/ext/upb-generated/google/rpc/status.upb.c
src/core/ext/transport/chttp2/transport/bin_decoder.cc
src/core/ext/transport/chttp2/transport/bin_encoder.cc
src/core/ext/transport/chttp2/transport/chttp2_plugin.cc
@ -2399,6 +2431,7 @@ add_library(grpc_test_util_unsecure
src/core/lib/transport/transport_op_string.cc
src/core/lib/uri/uri_parser.cc
src/core/lib/debug/trace.cc
src/core/ext/filters/client_channel/backend_metric.cc
src/core/ext/filters/client_channel/backup_poller.cc
src/core/ext/filters/client_channel/channel_connectivity.cc
src/core/ext/filters/client_channel/client_channel.cc
@ -2433,6 +2466,19 @@ add_library(grpc_test_util_unsecure
third_party/upb/upb/port.c
third_party/upb/upb/table.c
third_party/upb/upb/upb.c
src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c
src/core/ext/upb-generated/gogoproto/gogo.upb.c
src/core/ext/upb-generated/validate/validate.upb.c
src/core/ext/upb-generated/google/api/annotations.upb.c
src/core/ext/upb-generated/google/api/http.upb.c
src/core/ext/upb-generated/google/protobuf/any.upb.c
src/core/ext/upb-generated/google/protobuf/descriptor.upb.c
src/core/ext/upb-generated/google/protobuf/duration.upb.c
src/core/ext/upb-generated/google/protobuf/empty.upb.c
src/core/ext/upb-generated/google/protobuf/struct.upb.c
src/core/ext/upb-generated/google/protobuf/timestamp.upb.c
src/core/ext/upb-generated/google/protobuf/wrappers.upb.c
src/core/ext/upb-generated/google/rpc/status.upb.c
src/core/ext/transport/chttp2/transport/bin_decoder.cc
src/core/ext/transport/chttp2/transport/bin_encoder.cc
src/core/ext/transport/chttp2/transport/chttp2_plugin.cc
@ -2750,6 +2796,7 @@ add_library(grpc_unsecure
src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc
src/core/ext/transport/chttp2/client/authority.cc
src/core/ext/transport/chttp2/client/chttp2_connector.cc
src/core/ext/filters/client_channel/backend_metric.cc
src/core/ext/filters/client_channel/backup_poller.cc
src/core/ext/filters/client_channel/channel_connectivity.cc
src/core/ext/filters/client_channel/client_channel.cc
@ -2784,6 +2831,19 @@ add_library(grpc_unsecure
third_party/upb/upb/port.c
third_party/upb/upb/table.c
third_party/upb/upb/upb.c
src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c
src/core/ext/upb-generated/gogoproto/gogo.upb.c
src/core/ext/upb-generated/validate/validate.upb.c
src/core/ext/upb-generated/google/api/annotations.upb.c
src/core/ext/upb-generated/google/api/http.upb.c
src/core/ext/upb-generated/google/protobuf/any.upb.c
src/core/ext/upb-generated/google/protobuf/descriptor.upb.c
src/core/ext/upb-generated/google/protobuf/duration.upb.c
src/core/ext/upb-generated/google/protobuf/empty.upb.c
src/core/ext/upb-generated/google/protobuf/struct.upb.c
src/core/ext/upb-generated/google/protobuf/timestamp.upb.c
src/core/ext/upb-generated/google/protobuf/wrappers.upb.c
src/core/ext/upb-generated/google/rpc/status.upb.c
src/core/ext/transport/inproc/inproc_plugin.cc
src/core/ext/transport/inproc/inproc_transport.cc
src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc
@ -2807,16 +2867,6 @@ add_library(grpc_unsecure
src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc
src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc
src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c
src/core/ext/upb-generated/google/api/annotations.upb.c
src/core/ext/upb-generated/google/api/http.upb.c
src/core/ext/upb-generated/google/protobuf/any.upb.c
src/core/ext/upb-generated/google/protobuf/descriptor.upb.c
src/core/ext/upb-generated/google/protobuf/duration.upb.c
src/core/ext/upb-generated/google/protobuf/empty.upb.c
src/core/ext/upb-generated/google/protobuf/struct.upb.c
src/core/ext/upb-generated/google/protobuf/timestamp.upb.c
src/core/ext/upb-generated/google/protobuf/wrappers.upb.c
src/core/ext/upb-generated/google/rpc/status.upb.c
src/core/ext/filters/client_channel/lb_policy/xds/xds.cc
src/core/ext/filters/client_channel/lb_policy/xds/xds_channel.cc
src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.cc
@ -2824,6 +2874,7 @@ add_library(grpc_unsecure
src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c
src/core/ext/upb-generated/envoy/api/v2/cds.upb.c
src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c
src/core/ext/upb-generated/envoy/api/v2/cluster/filter.upb.c
src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c
src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c
src/core/ext/upb-generated/envoy/api/v2/eds.upb.c
@ -2836,11 +2887,10 @@ add_library(grpc_unsecure
src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c
src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c
src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c
src/core/ext/upb-generated/envoy/api/v2/core/http_uri.upb.c
src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c
src/core/ext/upb-generated/envoy/type/percent.upb.c
src/core/ext/upb-generated/envoy/type/range.upb.c
src/core/ext/upb-generated/gogoproto/gogo.upb.c
src/core/ext/upb-generated/validate/validate.upb.c
src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc
src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc
src/core/ext/filters/census/grpc_context.cc
@ -13133,11 +13183,18 @@ endif (gRPC_BUILD_TESTS)
if (gRPC_BUILD_TESTS)
add_executable(client_lb_end2end_test
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/lb/v2/orca_load_report_for_test.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/lb/v2/orca_load_report_for_test.grpc.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/lb/v2/orca_load_report_for_test.pb.h
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/lb/v2/orca_load_report_for_test.grpc.pb.h
test/cpp/end2end/client_lb_end2end_test.cc
third_party/googletest/googletest/src/gtest-all.cc
third_party/googletest/googlemock/src/gmock-all.cc
)
protobuf_generate_grpc_cpp(
src/proto/grpc/lb/v2/orca_load_report_for_test.proto
)
target_include_directories(client_lb_end2end_test
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}

@ -2745,6 +2745,22 @@ $(GENDIR)/src/proto/grpc/lb/v2/lrs_for_test.grpc.pb.cc: src/proto/grpc/lb/v2/lrs
$(Q) $(PROTOC) -Ithird_party/protobuf/src -I. --grpc_out=$(GENDIR) --plugin=protoc-gen-grpc=$(PROTOC_PLUGINS_DIR)/grpc_cpp_plugin$(EXECUTABLE_SUFFIX) $<
endif
ifeq ($(NO_PROTOC),true)
$(GENDIR)/src/proto/grpc/lb/v2/orca_load_report_for_test.pb.cc: protoc_dep_error
$(GENDIR)/src/proto/grpc/lb/v2/orca_load_report_for_test.grpc.pb.cc: protoc_dep_error
else
$(GENDIR)/src/proto/grpc/lb/v2/orca_load_report_for_test.pb.cc: src/proto/grpc/lb/v2/orca_load_report_for_test.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS)
$(E) "[PROTOC] Generating protobuf CC file from $<"
$(Q) mkdir -p `dirname $@`
$(Q) $(PROTOC) -Ithird_party/protobuf/src -I. --cpp_out=$(GENDIR) $<
$(GENDIR)/src/proto/grpc/lb/v2/orca_load_report_for_test.grpc.pb.cc: src/proto/grpc/lb/v2/orca_load_report_for_test.proto $(GENDIR)/src/proto/grpc/lb/v2/orca_load_report_for_test.pb.cc $(PROTOBUF_DEP) $(PROTOC_PLUGINS)
$(E) "[GRPC] Generating gRPC's protobuf service CC file from $<"
$(Q) mkdir -p `dirname $@`
$(Q) $(PROTOC) -Ithird_party/protobuf/src -I. --grpc_out=$(GENDIR) --plugin=protoc-gen-grpc=$(PROTOC_PLUGINS_DIR)/grpc_cpp_plugin$(EXECUTABLE_SUFFIX) $<
endif
ifeq ($(NO_PROTOC),true)
$(GENDIR)/src/proto/grpc/reflection/v1alpha/reflection.pb.cc: protoc_dep_error
$(GENDIR)/src/proto/grpc/reflection/v1alpha/reflection.grpc.pb.cc: protoc_dep_error
@ -3803,6 +3819,7 @@ LIBGRPC_SRC = \
src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc \
src/core/ext/transport/chttp2/client/authority.cc \
src/core/ext/transport/chttp2/client/chttp2_connector.cc \
src/core/ext/filters/client_channel/backend_metric.cc \
src/core/ext/filters/client_channel/backup_poller.cc \
src/core/ext/filters/client_channel/channel_connectivity.cc \
src/core/ext/filters/client_channel/client_channel.cc \
@ -3831,6 +3848,19 @@ LIBGRPC_SRC = \
src/core/ext/filters/client_channel/subchannel_pool_interface.cc \
src/core/ext/filters/deadline/deadline_filter.cc \
src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c \
src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c \
src/core/ext/upb-generated/gogoproto/gogo.upb.c \
src/core/ext/upb-generated/validate/validate.upb.c \
src/core/ext/upb-generated/google/api/annotations.upb.c \
src/core/ext/upb-generated/google/api/http.upb.c \
src/core/ext/upb-generated/google/protobuf/any.upb.c \
src/core/ext/upb-generated/google/protobuf/descriptor.upb.c \
src/core/ext/upb-generated/google/protobuf/duration.upb.c \
src/core/ext/upb-generated/google/protobuf/empty.upb.c \
src/core/ext/upb-generated/google/protobuf/struct.upb.c \
src/core/ext/upb-generated/google/protobuf/timestamp.upb.c \
src/core/ext/upb-generated/google/protobuf/wrappers.upb.c \
src/core/ext/upb-generated/google/rpc/status.upb.c \
src/core/tsi/fake_transport_security.cc \
src/core/tsi/local_transport_security.cc \
src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc \
@ -3850,16 +3880,6 @@ LIBGRPC_SRC = \
src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc \
src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc \
src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c \
src/core/ext/upb-generated/google/api/annotations.upb.c \
src/core/ext/upb-generated/google/api/http.upb.c \
src/core/ext/upb-generated/google/protobuf/any.upb.c \
src/core/ext/upb-generated/google/protobuf/descriptor.upb.c \
src/core/ext/upb-generated/google/protobuf/duration.upb.c \
src/core/ext/upb-generated/google/protobuf/empty.upb.c \
src/core/ext/upb-generated/google/protobuf/struct.upb.c \
src/core/ext/upb-generated/google/protobuf/timestamp.upb.c \
src/core/ext/upb-generated/google/protobuf/wrappers.upb.c \
src/core/ext/upb-generated/google/rpc/status.upb.c \
src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc \
src/core/ext/filters/client_channel/lb_policy/xds/xds.cc \
src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_secure.cc \
@ -3868,6 +3888,7 @@ LIBGRPC_SRC = \
src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c \
src/core/ext/upb-generated/envoy/api/v2/cds.upb.c \
src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c \
src/core/ext/upb-generated/envoy/api/v2/cluster/filter.upb.c \
src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c \
src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c \
src/core/ext/upb-generated/envoy/api/v2/eds.upb.c \
@ -3880,11 +3901,10 @@ LIBGRPC_SRC = \
src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c \
src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c \
src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c \
src/core/ext/upb-generated/envoy/api/v2/core/http_uri.upb.c \
src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c \
src/core/ext/upb-generated/envoy/type/percent.upb.c \
src/core/ext/upb-generated/envoy/type/range.upb.c \
src/core/ext/upb-generated/gogoproto/gogo.upb.c \
src/core/ext/upb-generated/validate/validate.upb.c \
src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc \
src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc \
src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc \
@ -4193,6 +4213,7 @@ LIBGRPC_CRONET_SRC = \
src/core/ext/filters/http/http_filters_plugin.cc \
src/core/ext/filters/http/message_compress/message_compress_filter.cc \
src/core/ext/filters/http/server/http_server_filter.cc \
src/core/ext/filters/client_channel/backend_metric.cc \
src/core/ext/filters/client_channel/backup_poller.cc \
src/core/ext/filters/client_channel/channel_connectivity.cc \
src/core/ext/filters/client_channel/client_channel.cc \
@ -4227,6 +4248,19 @@ LIBGRPC_CRONET_SRC = \
third_party/upb/upb/port.c \
third_party/upb/upb/table.c \
third_party/upb/upb/upb.c \
src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c \
src/core/ext/upb-generated/gogoproto/gogo.upb.c \
src/core/ext/upb-generated/validate/validate.upb.c \
src/core/ext/upb-generated/google/api/annotations.upb.c \
src/core/ext/upb-generated/google/api/http.upb.c \
src/core/ext/upb-generated/google/protobuf/any.upb.c \
src/core/ext/upb-generated/google/protobuf/descriptor.upb.c \
src/core/ext/upb-generated/google/protobuf/duration.upb.c \
src/core/ext/upb-generated/google/protobuf/empty.upb.c \
src/core/ext/upb-generated/google/protobuf/struct.upb.c \
src/core/ext/upb-generated/google/protobuf/timestamp.upb.c \
src/core/ext/upb-generated/google/protobuf/wrappers.upb.c \
src/core/ext/upb-generated/google/rpc/status.upb.c \
src/core/lib/http/httpcli_security_connector.cc \
src/core/lib/security/context/security_context.cc \
src/core/lib/security/credentials/alts/alts_credentials.cc \
@ -4573,6 +4607,7 @@ LIBGRPC_TEST_UTIL_SRC = \
src/core/lib/transport/transport_op_string.cc \
src/core/lib/uri/uri_parser.cc \
src/core/lib/debug/trace.cc \
src/core/ext/filters/client_channel/backend_metric.cc \
src/core/ext/filters/client_channel/backup_poller.cc \
src/core/ext/filters/client_channel/channel_connectivity.cc \
src/core/ext/filters/client_channel/client_channel.cc \
@ -4607,6 +4642,19 @@ LIBGRPC_TEST_UTIL_SRC = \
third_party/upb/upb/port.c \
third_party/upb/upb/table.c \
third_party/upb/upb/upb.c \
src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c \
src/core/ext/upb-generated/gogoproto/gogo.upb.c \
src/core/ext/upb-generated/validate/validate.upb.c \
src/core/ext/upb-generated/google/api/annotations.upb.c \
src/core/ext/upb-generated/google/api/http.upb.c \
src/core/ext/upb-generated/google/protobuf/any.upb.c \
src/core/ext/upb-generated/google/protobuf/descriptor.upb.c \
src/core/ext/upb-generated/google/protobuf/duration.upb.c \
src/core/ext/upb-generated/google/protobuf/empty.upb.c \
src/core/ext/upb-generated/google/protobuf/struct.upb.c \
src/core/ext/upb-generated/google/protobuf/timestamp.upb.c \
src/core/ext/upb-generated/google/protobuf/wrappers.upb.c \
src/core/ext/upb-generated/google/rpc/status.upb.c \
src/core/ext/transport/chttp2/transport/bin_decoder.cc \
src/core/ext/transport/chttp2/transport/bin_encoder.cc \
src/core/ext/transport/chttp2/transport/chttp2_plugin.cc \
@ -4895,6 +4943,7 @@ LIBGRPC_TEST_UTIL_UNSECURE_SRC = \
src/core/lib/transport/transport_op_string.cc \
src/core/lib/uri/uri_parser.cc \
src/core/lib/debug/trace.cc \
src/core/ext/filters/client_channel/backend_metric.cc \
src/core/ext/filters/client_channel/backup_poller.cc \
src/core/ext/filters/client_channel/channel_connectivity.cc \
src/core/ext/filters/client_channel/client_channel.cc \
@ -4929,6 +4978,19 @@ LIBGRPC_TEST_UTIL_UNSECURE_SRC = \
third_party/upb/upb/port.c \
third_party/upb/upb/table.c \
third_party/upb/upb/upb.c \
src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c \
src/core/ext/upb-generated/gogoproto/gogo.upb.c \
src/core/ext/upb-generated/validate/validate.upb.c \
src/core/ext/upb-generated/google/api/annotations.upb.c \
src/core/ext/upb-generated/google/api/http.upb.c \
src/core/ext/upb-generated/google/protobuf/any.upb.c \
src/core/ext/upb-generated/google/protobuf/descriptor.upb.c \
src/core/ext/upb-generated/google/protobuf/duration.upb.c \
src/core/ext/upb-generated/google/protobuf/empty.upb.c \
src/core/ext/upb-generated/google/protobuf/struct.upb.c \
src/core/ext/upb-generated/google/protobuf/timestamp.upb.c \
src/core/ext/upb-generated/google/protobuf/wrappers.upb.c \
src/core/ext/upb-generated/google/rpc/status.upb.c \
src/core/ext/transport/chttp2/transport/bin_decoder.cc \
src/core/ext/transport/chttp2/transport/bin_encoder.cc \
src/core/ext/transport/chttp2/transport/chttp2_plugin.cc \
@ -5215,6 +5277,7 @@ LIBGRPC_UNSECURE_SRC = \
src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc \
src/core/ext/transport/chttp2/client/authority.cc \
src/core/ext/transport/chttp2/client/chttp2_connector.cc \
src/core/ext/filters/client_channel/backend_metric.cc \
src/core/ext/filters/client_channel/backup_poller.cc \
src/core/ext/filters/client_channel/channel_connectivity.cc \
src/core/ext/filters/client_channel/client_channel.cc \
@ -5249,6 +5312,19 @@ LIBGRPC_UNSECURE_SRC = \
third_party/upb/upb/port.c \
third_party/upb/upb/table.c \
third_party/upb/upb/upb.c \
src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c \
src/core/ext/upb-generated/gogoproto/gogo.upb.c \
src/core/ext/upb-generated/validate/validate.upb.c \
src/core/ext/upb-generated/google/api/annotations.upb.c \
src/core/ext/upb-generated/google/api/http.upb.c \
src/core/ext/upb-generated/google/protobuf/any.upb.c \
src/core/ext/upb-generated/google/protobuf/descriptor.upb.c \
src/core/ext/upb-generated/google/protobuf/duration.upb.c \
src/core/ext/upb-generated/google/protobuf/empty.upb.c \
src/core/ext/upb-generated/google/protobuf/struct.upb.c \
src/core/ext/upb-generated/google/protobuf/timestamp.upb.c \
src/core/ext/upb-generated/google/protobuf/wrappers.upb.c \
src/core/ext/upb-generated/google/rpc/status.upb.c \
src/core/ext/transport/inproc/inproc_plugin.cc \
src/core/ext/transport/inproc/inproc_transport.cc \
src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc \
@ -5272,16 +5348,6 @@ LIBGRPC_UNSECURE_SRC = \
src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc \
src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc \
src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c \
src/core/ext/upb-generated/google/api/annotations.upb.c \
src/core/ext/upb-generated/google/api/http.upb.c \
src/core/ext/upb-generated/google/protobuf/any.upb.c \
src/core/ext/upb-generated/google/protobuf/descriptor.upb.c \
src/core/ext/upb-generated/google/protobuf/duration.upb.c \
src/core/ext/upb-generated/google/protobuf/empty.upb.c \
src/core/ext/upb-generated/google/protobuf/struct.upb.c \
src/core/ext/upb-generated/google/protobuf/timestamp.upb.c \
src/core/ext/upb-generated/google/protobuf/wrappers.upb.c \
src/core/ext/upb-generated/google/rpc/status.upb.c \
src/core/ext/filters/client_channel/lb_policy/xds/xds.cc \
src/core/ext/filters/client_channel/lb_policy/xds/xds_channel.cc \
src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.cc \
@ -5289,6 +5355,7 @@ LIBGRPC_UNSECURE_SRC = \
src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c \
src/core/ext/upb-generated/envoy/api/v2/cds.upb.c \
src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c \
src/core/ext/upb-generated/envoy/api/v2/cluster/filter.upb.c \
src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c \
src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c \
src/core/ext/upb-generated/envoy/api/v2/eds.upb.c \
@ -5301,11 +5368,10 @@ LIBGRPC_UNSECURE_SRC = \
src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c \
src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c \
src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c \
src/core/ext/upb-generated/envoy/api/v2/core/http_uri.upb.c \
src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c \
src/core/ext/upb-generated/envoy/type/percent.upb.c \
src/core/ext/upb-generated/envoy/type/range.upb.c \
src/core/ext/upb-generated/gogoproto/gogo.upb.c \
src/core/ext/upb-generated/validate/validate.upb.c \
src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc \
src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc \
src/core/ext/filters/census/grpc_context.cc \
@ -15701,6 +15767,7 @@ endif
CLIENT_LB_END2END_TEST_SRC = \
$(GENDIR)/src/proto/grpc/lb/v2/orca_load_report_for_test.pb.cc $(GENDIR)/src/proto/grpc/lb/v2/orca_load_report_for_test.grpc.pb.cc \
test/cpp/end2end/client_lb_end2end_test.cc \
CLIENT_LB_END2END_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(CLIENT_LB_END2END_TEST_SRC))))
@ -15732,6 +15799,8 @@ endif
endif
$(OBJDIR)/$(CONFIG)/src/proto/grpc/lb/v2/orca_load_report_for_test.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(OBJDIR)/$(CONFIG)/test/cpp/end2end/client_lb_end2end_test.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a
deps_client_lb_end2end_test: $(CLIENT_LB_END2END_TEST_OBJS:.o=.dep)
@ -15741,6 +15810,7 @@ ifneq ($(NO_DEPS),true)
-include $(CLIENT_LB_END2END_TEST_OBJS:.o=.dep)
endif
endif
$(OBJDIR)/$(CONFIG)/test/cpp/end2end/client_lb_end2end_test.o: $(GENDIR)/src/proto/grpc/lb/v2/orca_load_report_for_test.pb.cc $(GENDIR)/src/proto/grpc/lb/v2/orca_load_report_for_test.grpc.pb.cc
CODEGEN_TEST_FULL_SRC = \

@ -24,6 +24,7 @@
#
load("//bazel:cc_grpc_library.bzl", "cc_grpc_library")
load("@build_bazel_rules_apple//apple:resources.bzl", "apple_resource_bundle")
load("@upb//bazel:upb_proto_library.bzl", "upb_proto_library")
load("@build_bazel_rules_apple//apple:ios.bzl", "ios_unit_test")
@ -238,13 +239,19 @@ def grpc_cc_binary(name, srcs = [], deps = [], external_deps = [], args = [], da
)
def grpc_generate_one_off_targets():
apple_resource_bundle(
# The choice of name is signicant here, since it determines the bundle name.
name = "gRPCCertificates",
resources = ["etc/roots.pem"],
)
# In open-source, grpc_objc* libraries depend directly on //:grpc
native.alias(
name = "grpc_objc",
actual = "//:grpc",
)
def grpc_generate_objc_one_off_targets():
def grpc_objc_use_cronet_config():
pass
def grpc_sh_test(name, srcs, args = [], data = []):
@ -289,7 +296,7 @@ def grpc_package(name, visibility = "private", features = []):
def grpc_objc_library(
name,
srcs = [],
srcs,
hdrs = [],
textual_hdrs = [],
data = [],

@ -61,22 +61,22 @@ _generate_pb2_src = rule(
def py_proto_library(
name,
srcs,
deps,
**kwargs):
"""Generate python code for a protobuf.
Args:
name: The name of the target.
srcs: A list of proto_library dependencies. Must contain a single element.
deps: A list of proto_library dependencies. Must contain a single element.
"""
codegen_target = "_{}_codegen".format(name)
if len(srcs) != 1:
if len(deps) != 1:
fail("Can only compile a single proto at a time.")
_generate_pb2_src(
name = codegen_target,
deps = srcs,
deps = deps,
**kwargs
)

@ -29,7 +29,7 @@ proto_library(
py_proto_library(
name = "helloworld_py_pb2",
srcs = [":helloworld_proto"],
deps = [":helloworld_proto"],
)
py_grpc_library(
@ -40,12 +40,12 @@ py_grpc_library(
py_proto_library(
name = "duration_py_pb2",
srcs = ["@com_google_protobuf//:duration_proto"],
deps = ["@com_google_protobuf//:duration_proto"],
)
py_proto_library(
name = "timestamp_py_pb2",
srcs = ["@com_google_protobuf//:timestamp_proto"],
deps = ["@com_google_protobuf//:timestamp_proto"],
)
py_test(

@ -113,6 +113,7 @@ filegroups:
- src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.h
- src/core/ext/upb-generated/envoy/api/v2/cds.upb.h
- src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.h
- src/core/ext/upb-generated/envoy/api/v2/cluster/filter.upb.h
- src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.h
- src/core/ext/upb-generated/envoy/api/v2/discovery.upb.h
- src/core/ext/upb-generated/envoy/api/v2/eds.upb.h
@ -124,6 +125,7 @@ filegroups:
- src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c
- src/core/ext/upb-generated/envoy/api/v2/cds.upb.c
- src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c
- src/core/ext/upb-generated/envoy/api/v2/cluster/filter.upb.c
- src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c
- src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c
- src/core/ext/upb-generated/envoy/api/v2/eds.upb.c
@ -143,6 +145,7 @@ filegroups:
- src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.h
- src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.h
- src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.h
- src/core/ext/upb-generated/envoy/api/v2/core/http_uri.upb.h
- src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.h
src:
- src/core/ext/upb-generated/envoy/api/v2/core/address.upb.c
@ -150,11 +153,19 @@ filegroups:
- src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c
- src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c
- src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c
- src/core/ext/upb-generated/envoy/api/v2/core/http_uri.upb.c
- src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c
uses:
- envoy_type_upb
- google_api_upb
- proto_gen_validate_upb
- name: envoy_orca_upb
headers:
- src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.h
src:
- src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c
uses:
- proto_gen_validate_upb
- name: envoy_type_upb
headers:
- src/core/ext/upb-generated/envoy/type/percent.upb.h
@ -948,6 +959,7 @@ filegroups:
- grpc_base
- name: grpc_client_channel
headers:
- src/core/ext/filters/client_channel/backend_metric.h
- src/core/ext/filters/client_channel/backup_poller.h
- src/core/ext/filters/client_channel/client_channel.h
- src/core/ext/filters/client_channel/client_channel_channelz.h
@ -976,6 +988,7 @@ filegroups:
- src/core/ext/filters/client_channel/subchannel_interface.h
- src/core/ext/filters/client_channel/subchannel_pool_interface.h
src:
- src/core/ext/filters/client_channel/backend_metric.cc
- src/core/ext/filters/client_channel/backup_poller.cc
- src/core/ext/filters/client_channel/channel_connectivity.cc
- src/core/ext/filters/client_channel/client_channel.cc
@ -1007,6 +1020,7 @@ filegroups:
- grpc_base
- grpc_deadline_filter
- grpc_health_upb
- envoy_orca_upb
- name: grpc_client_idle_filter
src:
- src/core/ext/filters/client_idle/client_idle_filter.cc
@ -4747,6 +4761,7 @@ targets:
build: test
language: c++
src:
- src/proto/grpc/lb/v2/orca_load_report_for_test.proto
- test/cpp/end2end/client_lb_end2end_test.cc
deps:
- grpc++_test_util

@ -349,6 +349,7 @@ if test "$PHP_GRPC" != "no"; then
src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc \
src/core/ext/transport/chttp2/client/authority.cc \
src/core/ext/transport/chttp2/client/chttp2_connector.cc \
src/core/ext/filters/client_channel/backend_metric.cc \
src/core/ext/filters/client_channel/backup_poller.cc \
src/core/ext/filters/client_channel/channel_connectivity.cc \
src/core/ext/filters/client_channel/client_channel.cc \
@ -377,6 +378,19 @@ if test "$PHP_GRPC" != "no"; then
src/core/ext/filters/client_channel/subchannel_pool_interface.cc \
src/core/ext/filters/deadline/deadline_filter.cc \
src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c \
src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c \
src/core/ext/upb-generated/gogoproto/gogo.upb.c \
src/core/ext/upb-generated/validate/validate.upb.c \
src/core/ext/upb-generated/google/api/annotations.upb.c \
src/core/ext/upb-generated/google/api/http.upb.c \
src/core/ext/upb-generated/google/protobuf/any.upb.c \
src/core/ext/upb-generated/google/protobuf/descriptor.upb.c \
src/core/ext/upb-generated/google/protobuf/duration.upb.c \
src/core/ext/upb-generated/google/protobuf/empty.upb.c \
src/core/ext/upb-generated/google/protobuf/struct.upb.c \
src/core/ext/upb-generated/google/protobuf/timestamp.upb.c \
src/core/ext/upb-generated/google/protobuf/wrappers.upb.c \
src/core/ext/upb-generated/google/rpc/status.upb.c \
src/core/tsi/fake_transport_security.cc \
src/core/tsi/local_transport_security.cc \
src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc \
@ -396,16 +410,6 @@ if test "$PHP_GRPC" != "no"; then
src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc \
src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc \
src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c \
src/core/ext/upb-generated/google/api/annotations.upb.c \
src/core/ext/upb-generated/google/api/http.upb.c \
src/core/ext/upb-generated/google/protobuf/any.upb.c \
src/core/ext/upb-generated/google/protobuf/descriptor.upb.c \
src/core/ext/upb-generated/google/protobuf/duration.upb.c \
src/core/ext/upb-generated/google/protobuf/empty.upb.c \
src/core/ext/upb-generated/google/protobuf/struct.upb.c \
src/core/ext/upb-generated/google/protobuf/timestamp.upb.c \
src/core/ext/upb-generated/google/protobuf/wrappers.upb.c \
src/core/ext/upb-generated/google/rpc/status.upb.c \
src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc \
src/core/ext/filters/client_channel/lb_policy/xds/xds.cc \
src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_secure.cc \
@ -414,6 +418,7 @@ if test "$PHP_GRPC" != "no"; then
src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c \
src/core/ext/upb-generated/envoy/api/v2/cds.upb.c \
src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c \
src/core/ext/upb-generated/envoy/api/v2/cluster/filter.upb.c \
src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c \
src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c \
src/core/ext/upb-generated/envoy/api/v2/eds.upb.c \
@ -426,11 +431,10 @@ if test "$PHP_GRPC" != "no"; then
src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c \
src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c \
src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c \
src/core/ext/upb-generated/envoy/api/v2/core/http_uri.upb.c \
src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c \
src/core/ext/upb-generated/envoy/type/percent.upb.c \
src/core/ext/upb-generated/envoy/type/range.upb.c \
src/core/ext/upb-generated/gogoproto/gogo.upb.c \
src/core/ext/upb-generated/validate/validate.upb.c \
src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc \
src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc \
src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc \
@ -766,6 +770,7 @@ if test "$PHP_GRPC" != "no"; then
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/src/proto/grpc/gcp)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/src/proto/grpc/health/v1)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/src/proto/grpc/lb/v1)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/udpa/data/orca/v1)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/validate)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/avl)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/backoff)

@ -323,6 +323,7 @@ if (PHP_GRPC != "no") {
"src\\core\\ext\\transport\\chttp2\\client\\insecure\\channel_create_posix.cc " +
"src\\core\\ext\\transport\\chttp2\\client\\authority.cc " +
"src\\core\\ext\\transport\\chttp2\\client\\chttp2_connector.cc " +
"src\\core\\ext\\filters\\client_channel\\backend_metric.cc " +
"src\\core\\ext\\filters\\client_channel\\backup_poller.cc " +
"src\\core\\ext\\filters\\client_channel\\channel_connectivity.cc " +
"src\\core\\ext\\filters\\client_channel\\client_channel.cc " +
@ -351,6 +352,19 @@ if (PHP_GRPC != "no") {
"src\\core\\ext\\filters\\client_channel\\subchannel_pool_interface.cc " +
"src\\core\\ext\\filters\\deadline\\deadline_filter.cc " +
"src\\core\\ext\\upb-generated\\src\\proto\\grpc\\health\\v1\\health.upb.c " +
"src\\core\\ext\\upb-generated\\udpa\\data\\orca\\v1\\orca_load_report.upb.c " +
"src\\core\\ext\\upb-generated\\gogoproto\\gogo.upb.c " +
"src\\core\\ext\\upb-generated\\validate\\validate.upb.c " +
"src\\core\\ext\\upb-generated\\google\\api\\annotations.upb.c " +
"src\\core\\ext\\upb-generated\\google\\api\\http.upb.c " +
"src\\core\\ext\\upb-generated\\google\\protobuf\\any.upb.c " +
"src\\core\\ext\\upb-generated\\google\\protobuf\\descriptor.upb.c " +
"src\\core\\ext\\upb-generated\\google\\protobuf\\duration.upb.c " +
"src\\core\\ext\\upb-generated\\google\\protobuf\\empty.upb.c " +
"src\\core\\ext\\upb-generated\\google\\protobuf\\struct.upb.c " +
"src\\core\\ext\\upb-generated\\google\\protobuf\\timestamp.upb.c " +
"src\\core\\ext\\upb-generated\\google\\protobuf\\wrappers.upb.c " +
"src\\core\\ext\\upb-generated\\google\\rpc\\status.upb.c " +
"src\\core\\tsi\\fake_transport_security.cc " +
"src\\core\\tsi\\local_transport_security.cc " +
"src\\core\\tsi\\ssl\\session_cache\\ssl_session_boringssl.cc " +
@ -370,16 +384,6 @@ if (PHP_GRPC != "no") {
"src\\core\\ext\\filters\\client_channel\\lb_policy\\grpclb\\grpclb_client_stats.cc " +
"src\\core\\ext\\filters\\client_channel\\lb_policy\\grpclb\\load_balancer_api.cc " +
"src\\core\\ext\\upb-generated\\src\\proto\\grpc\\lb\\v1\\load_balancer.upb.c " +
"src\\core\\ext\\upb-generated\\google\\api\\annotations.upb.c " +
"src\\core\\ext\\upb-generated\\google\\api\\http.upb.c " +
"src\\core\\ext\\upb-generated\\google\\protobuf\\any.upb.c " +
"src\\core\\ext\\upb-generated\\google\\protobuf\\descriptor.upb.c " +
"src\\core\\ext\\upb-generated\\google\\protobuf\\duration.upb.c " +
"src\\core\\ext\\upb-generated\\google\\protobuf\\empty.upb.c " +
"src\\core\\ext\\upb-generated\\google\\protobuf\\struct.upb.c " +
"src\\core\\ext\\upb-generated\\google\\protobuf\\timestamp.upb.c " +
"src\\core\\ext\\upb-generated\\google\\protobuf\\wrappers.upb.c " +
"src\\core\\ext\\upb-generated\\google\\rpc\\status.upb.c " +
"src\\core\\ext\\filters\\client_channel\\resolver\\fake\\fake_resolver.cc " +
"src\\core\\ext\\filters\\client_channel\\lb_policy\\xds\\xds.cc " +
"src\\core\\ext\\filters\\client_channel\\lb_policy\\xds\\xds_channel_secure.cc " +
@ -388,6 +392,7 @@ if (PHP_GRPC != "no") {
"src\\core\\ext\\upb-generated\\envoy\\api\\v2\\auth\\cert.upb.c " +
"src\\core\\ext\\upb-generated\\envoy\\api\\v2\\cds.upb.c " +
"src\\core\\ext\\upb-generated\\envoy\\api\\v2\\cluster\\circuit_breaker.upb.c " +
"src\\core\\ext\\upb-generated\\envoy\\api\\v2\\cluster\\filter.upb.c " +
"src\\core\\ext\\upb-generated\\envoy\\api\\v2\\cluster\\outlier_detection.upb.c " +
"src\\core\\ext\\upb-generated\\envoy\\api\\v2\\discovery.upb.c " +
"src\\core\\ext\\upb-generated\\envoy\\api\\v2\\eds.upb.c " +
@ -400,11 +405,10 @@ if (PHP_GRPC != "no") {
"src\\core\\ext\\upb-generated\\envoy\\api\\v2\\core\\config_source.upb.c " +
"src\\core\\ext\\upb-generated\\envoy\\api\\v2\\core\\grpc_service.upb.c " +
"src\\core\\ext\\upb-generated\\envoy\\api\\v2\\core\\health_check.upb.c " +
"src\\core\\ext\\upb-generated\\envoy\\api\\v2\\core\\http_uri.upb.c " +
"src\\core\\ext\\upb-generated\\envoy\\api\\v2\\core\\protocol.upb.c " +
"src\\core\\ext\\upb-generated\\envoy\\type\\percent.upb.c " +
"src\\core\\ext\\upb-generated\\envoy\\type\\range.upb.c " +
"src\\core\\ext\\upb-generated\\gogoproto\\gogo.upb.c " +
"src\\core\\ext\\upb-generated\\validate\\validate.upb.c " +
"src\\core\\ext\\filters\\client_channel\\lb_policy\\pick_first\\pick_first.cc " +
"src\\core\\ext\\filters\\client_channel\\lb_policy\\round_robin\\round_robin.cc " +
"src\\core\\ext\\filters\\client_channel\\resolver\\dns\\c_ares\\dns_resolver_ares.cc " +
@ -785,6 +789,10 @@ if (PHP_GRPC != "no") {
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\src\\proto\\grpc\\health\\v1");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\src\\proto\\grpc\\lb");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\src\\proto\\grpc\\lb\\v1");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\udpa");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\udpa\\data");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\udpa\\data\\orca");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\udpa\\data\\orca\\v1");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\validate");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\avl");

@ -67,7 +67,7 @@ proto_library(
py_proto_library(
name = "helloworld_py_pb2",
srcs = [":protos/helloworld_proto"],
deps = [":protos/helloworld_proto"],
)
py_grpc_library(

@ -26,7 +26,7 @@ proto_library(
py_proto_library(
name = "hash_name_py_pb2",
srcs = [":hash_name_proto"],
deps = [":hash_name_proto"],
)
py_grpc_library(

@ -23,7 +23,7 @@ proto_library(
py_proto_library(
name = "prime_proto_pb2",
srcs = [":prime_proto"],
deps = [":prime_proto"],
)
py_grpc_library(

@ -352,6 +352,7 @@ Pod::Spec.new do |s|
'src/core/tsi/transport_security_interface.h',
'src/core/ext/transport/chttp2/client/authority.h',
'src/core/ext/transport/chttp2/client/chttp2_connector.h',
'src/core/ext/filters/client_channel/backend_metric.h',
'src/core/ext/filters/client_channel/backup_poller.h',
'src/core/ext/filters/client_channel/client_channel.h',
'src/core/ext/filters/client_channel/client_channel_channelz.h',
@ -381,6 +382,19 @@ Pod::Spec.new do |s|
'src/core/ext/filters/client_channel/subchannel_pool_interface.h',
'src/core/ext/filters/deadline/deadline_filter.h',
'src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h',
'src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.h',
'src/core/ext/upb-generated/gogoproto/gogo.upb.h',
'src/core/ext/upb-generated/validate/validate.upb.h',
'src/core/ext/upb-generated/google/api/annotations.upb.h',
'src/core/ext/upb-generated/google/api/http.upb.h',
'src/core/ext/upb-generated/google/protobuf/any.upb.h',
'src/core/ext/upb-generated/google/protobuf/descriptor.upb.h',
'src/core/ext/upb-generated/google/protobuf/duration.upb.h',
'src/core/ext/upb-generated/google/protobuf/empty.upb.h',
'src/core/ext/upb-generated/google/protobuf/struct.upb.h',
'src/core/ext/upb-generated/google/protobuf/timestamp.upb.h',
'src/core/ext/upb-generated/google/protobuf/wrappers.upb.h',
'src/core/ext/upb-generated/google/rpc/status.upb.h',
'src/core/tsi/fake_transport_security.h',
'src/core/tsi/local_transport_security.h',
'src/core/tsi/ssl/session_cache/ssl_session.h',
@ -540,16 +554,6 @@ Pod::Spec.new do |s|
'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h',
'src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h',
'src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h',
'src/core/ext/upb-generated/google/api/annotations.upb.h',
'src/core/ext/upb-generated/google/api/http.upb.h',
'src/core/ext/upb-generated/google/protobuf/any.upb.h',
'src/core/ext/upb-generated/google/protobuf/descriptor.upb.h',
'src/core/ext/upb-generated/google/protobuf/duration.upb.h',
'src/core/ext/upb-generated/google/protobuf/empty.upb.h',
'src/core/ext/upb-generated/google/protobuf/struct.upb.h',
'src/core/ext/upb-generated/google/protobuf/timestamp.upb.h',
'src/core/ext/upb-generated/google/protobuf/wrappers.upb.h',
'src/core/ext/upb-generated/google/rpc/status.upb.h',
'src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h',
'src/core/ext/filters/client_channel/lb_policy/xds/xds_channel.h',
'src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.h',
@ -557,6 +561,7 @@ Pod::Spec.new do |s|
'src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.h',
'src/core/ext/upb-generated/envoy/api/v2/cds.upb.h',
'src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.h',
'src/core/ext/upb-generated/envoy/api/v2/cluster/filter.upb.h',
'src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.h',
'src/core/ext/upb-generated/envoy/api/v2/discovery.upb.h',
'src/core/ext/upb-generated/envoy/api/v2/eds.upb.h',
@ -569,11 +574,10 @@ Pod::Spec.new do |s|
'src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.h',
'src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.h',
'src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.h',
'src/core/ext/upb-generated/envoy/api/v2/core/http_uri.upb.h',
'src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.h',
'src/core/ext/upb-generated/envoy/type/percent.upb.h',
'src/core/ext/upb-generated/envoy/type/range.upb.h',
'src/core/ext/upb-generated/gogoproto/gogo.upb.h',
'src/core/ext/upb-generated/validate/validate.upb.h',
'src/core/ext/filters/client_channel/lb_policy/subchannel_list.h',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h',
@ -847,6 +851,7 @@ Pod::Spec.new do |s|
'src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc',
'src/core/ext/transport/chttp2/client/authority.cc',
'src/core/ext/transport/chttp2/client/chttp2_connector.cc',
'src/core/ext/filters/client_channel/backend_metric.cc',
'src/core/ext/filters/client_channel/backup_poller.cc',
'src/core/ext/filters/client_channel/channel_connectivity.cc',
'src/core/ext/filters/client_channel/client_channel.cc',
@ -875,6 +880,19 @@ Pod::Spec.new do |s|
'src/core/ext/filters/client_channel/subchannel_pool_interface.cc',
'src/core/ext/filters/deadline/deadline_filter.cc',
'src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c',
'src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c',
'src/core/ext/upb-generated/gogoproto/gogo.upb.c',
'src/core/ext/upb-generated/validate/validate.upb.c',
'src/core/ext/upb-generated/google/api/annotations.upb.c',
'src/core/ext/upb-generated/google/api/http.upb.c',
'src/core/ext/upb-generated/google/protobuf/any.upb.c',
'src/core/ext/upb-generated/google/protobuf/descriptor.upb.c',
'src/core/ext/upb-generated/google/protobuf/duration.upb.c',
'src/core/ext/upb-generated/google/protobuf/empty.upb.c',
'src/core/ext/upb-generated/google/protobuf/struct.upb.c',
'src/core/ext/upb-generated/google/protobuf/timestamp.upb.c',
'src/core/ext/upb-generated/google/protobuf/wrappers.upb.c',
'src/core/ext/upb-generated/google/rpc/status.upb.c',
'src/core/tsi/fake_transport_security.cc',
'src/core/tsi/local_transport_security.cc',
'src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc',
@ -894,16 +912,6 @@ Pod::Spec.new do |s|
'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc',
'src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc',
'src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c',
'src/core/ext/upb-generated/google/api/annotations.upb.c',
'src/core/ext/upb-generated/google/api/http.upb.c',
'src/core/ext/upb-generated/google/protobuf/any.upb.c',
'src/core/ext/upb-generated/google/protobuf/descriptor.upb.c',
'src/core/ext/upb-generated/google/protobuf/duration.upb.c',
'src/core/ext/upb-generated/google/protobuf/empty.upb.c',
'src/core/ext/upb-generated/google/protobuf/struct.upb.c',
'src/core/ext/upb-generated/google/protobuf/timestamp.upb.c',
'src/core/ext/upb-generated/google/protobuf/wrappers.upb.c',
'src/core/ext/upb-generated/google/rpc/status.upb.c',
'src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc',
'src/core/ext/filters/client_channel/lb_policy/xds/xds.cc',
'src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_secure.cc',
@ -912,6 +920,7 @@ Pod::Spec.new do |s|
'src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c',
'src/core/ext/upb-generated/envoy/api/v2/cds.upb.c',
'src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c',
'src/core/ext/upb-generated/envoy/api/v2/cluster/filter.upb.c',
'src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c',
'src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c',
'src/core/ext/upb-generated/envoy/api/v2/eds.upb.c',
@ -924,11 +933,10 @@ Pod::Spec.new do |s|
'src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c',
'src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c',
'src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c',
'src/core/ext/upb-generated/envoy/api/v2/core/http_uri.upb.c',
'src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c',
'src/core/ext/upb-generated/envoy/type/percent.upb.c',
'src/core/ext/upb-generated/envoy/type/range.upb.c',
'src/core/ext/upb-generated/gogoproto/gogo.upb.c',
'src/core/ext/upb-generated/validate/validate.upb.c',
'src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc',
'src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc',
@ -1078,6 +1086,7 @@ Pod::Spec.new do |s|
'src/core/tsi/transport_security_interface.h',
'src/core/ext/transport/chttp2/client/authority.h',
'src/core/ext/transport/chttp2/client/chttp2_connector.h',
'src/core/ext/filters/client_channel/backend_metric.h',
'src/core/ext/filters/client_channel/backup_poller.h',
'src/core/ext/filters/client_channel/client_channel.h',
'src/core/ext/filters/client_channel/client_channel_channelz.h',
@ -1107,6 +1116,19 @@ Pod::Spec.new do |s|
'src/core/ext/filters/client_channel/subchannel_pool_interface.h',
'src/core/ext/filters/deadline/deadline_filter.h',
'src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h',
'src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.h',
'src/core/ext/upb-generated/gogoproto/gogo.upb.h',
'src/core/ext/upb-generated/validate/validate.upb.h',
'src/core/ext/upb-generated/google/api/annotations.upb.h',
'src/core/ext/upb-generated/google/api/http.upb.h',
'src/core/ext/upb-generated/google/protobuf/any.upb.h',
'src/core/ext/upb-generated/google/protobuf/descriptor.upb.h',
'src/core/ext/upb-generated/google/protobuf/duration.upb.h',
'src/core/ext/upb-generated/google/protobuf/empty.upb.h',
'src/core/ext/upb-generated/google/protobuf/struct.upb.h',
'src/core/ext/upb-generated/google/protobuf/timestamp.upb.h',
'src/core/ext/upb-generated/google/protobuf/wrappers.upb.h',
'src/core/ext/upb-generated/google/rpc/status.upb.h',
'src/core/tsi/fake_transport_security.h',
'src/core/tsi/local_transport_security.h',
'src/core/tsi/ssl/session_cache/ssl_session.h',
@ -1266,16 +1288,6 @@ Pod::Spec.new do |s|
'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h',
'src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h',
'src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h',
'src/core/ext/upb-generated/google/api/annotations.upb.h',
'src/core/ext/upb-generated/google/api/http.upb.h',
'src/core/ext/upb-generated/google/protobuf/any.upb.h',
'src/core/ext/upb-generated/google/protobuf/descriptor.upb.h',
'src/core/ext/upb-generated/google/protobuf/duration.upb.h',
'src/core/ext/upb-generated/google/protobuf/empty.upb.h',
'src/core/ext/upb-generated/google/protobuf/struct.upb.h',
'src/core/ext/upb-generated/google/protobuf/timestamp.upb.h',
'src/core/ext/upb-generated/google/protobuf/wrappers.upb.h',
'src/core/ext/upb-generated/google/rpc/status.upb.h',
'src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h',
'src/core/ext/filters/client_channel/lb_policy/xds/xds_channel.h',
'src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.h',
@ -1283,6 +1295,7 @@ Pod::Spec.new do |s|
'src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.h',
'src/core/ext/upb-generated/envoy/api/v2/cds.upb.h',
'src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.h',
'src/core/ext/upb-generated/envoy/api/v2/cluster/filter.upb.h',
'src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.h',
'src/core/ext/upb-generated/envoy/api/v2/discovery.upb.h',
'src/core/ext/upb-generated/envoy/api/v2/eds.upb.h',
@ -1295,11 +1308,10 @@ Pod::Spec.new do |s|
'src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.h',
'src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.h',
'src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.h',
'src/core/ext/upb-generated/envoy/api/v2/core/http_uri.upb.h',
'src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.h',
'src/core/ext/upb-generated/envoy/type/percent.upb.h',
'src/core/ext/upb-generated/envoy/type/range.upb.h',
'src/core/ext/upb-generated/gogoproto/gogo.upb.h',
'src/core/ext/upb-generated/validate/validate.upb.h',
'src/core/ext/filters/client_channel/lb_policy/subchannel_list.h',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h',

@ -42,40 +42,22 @@ Pod::Spec.new do |s|
s.module_name = name
s.header_dir = name
s.default_subspec = 'Main', 'Legacy', 'Legacy-Header'
src_dir = 'src/objective-c/ProtoRPC'
s.subspec 'Legacy-Header' do |ss|
ss.header_mappings_dir = "src/objective-c/ProtoRPC"
ss.public_header_files = "src/objective-c/ProtoRPC/ProtoRPCLegacy.h"
ss.source_files = "src/objective-c/ProtoRPC/ProtoRPCLegacy.h"
end
s.default_subspec = 'Main'
s.subspec 'Main' do |ss|
ss.header_mappings_dir = "src/objective-c/ProtoRPC"
ss.dependency "#{s.name}/Legacy-Header", version
ss.dependency 'gRPC/Interface', version
ss.dependency 'Protobuf', '~> 3.0'
ss.source_files = "src/objective-c/ProtoRPC/ProtoMethod.{h,m}",
"src/objective-c/ProtoRPC/ProtoRPC.{h,m}",
"src/objective-c/ProtoRPC/ProtoService.{h,m}"
end
s.subspec 'Legacy' do |ss|
ss.header_mappings_dir = "src/objective-c/ProtoRPC"
ss.dependency "#{s.name}/Main", version
ss.dependency "#{s.name}/Legacy-Header", version
ss.dependency 'gRPC/GRPCCore', version
ss.header_mappings_dir = "#{src_dir}"
ss.dependency 'gRPC', version
ss.dependency 'gRPC-RxLibrary', version
ss.dependency 'Protobuf', '~> 3.0'
ss.source_files = "src/objective-c/ProtoRPC/ProtoRPCLegacy.m",
"src/objective-c/ProtoRPC/ProtoServiceLegacy.m"
ss.source_files = "#{src_dir}/*.{h,m}"
end
# CFStream is now default. Leaving this subspec only for compatibility purpose.
s.subspec 'CFStream' do |ss|
ss.dependency "#{s.name}/Legacy", version
ss.dependency "#{s.name}/Main", version
end
s.pod_target_xcconfig = {

@ -42,23 +42,6 @@ Pod::Spec.new do |s|
s.module_name = name
s.header_dir = name
s.default_subspec = 'Interface', 'Implementation'
src_dir = 'src/objective-c/RxLibrary'
s.subspec 'Interface' do |ss|
ss.header_mappings_dir = "#{src_dir}"
ss.source_files = "#{src_dir}/*.h"
ss.public_header_files = "#{src_dir}/*.h"
end
s.subspec 'Implementation' do |ss|
ss.header_mappings_dir = "#{src_dir}"
ss.source_files = "#{src_dir}/*.m", "#{src_dir}/**/*.{h,m}"
ss.private_header_files = "#{src_dir}/**/*.h"
ss.dependency "#{s.name}/Interface"
end
src_dir = 'src/objective-c/RxLibrary'
s.source_files = "#{src_dir}/*.{h,m}", "#{src_dir}/**/*.{h,m}"
s.private_header_files = "#{src_dir}/private/*.h"

@ -41,7 +41,13 @@ Pod::Spec.new do |s|
s.module_name = name
s.header_dir = name
s.default_subspec = 'Interface', 'GRPCCore', 'Interface-Legacy'
src_dir = 'src/objective-c/GRPCClient'
s.dependency 'gRPC-RxLibrary', version
s.default_subspec = 'Main'
# Certificates, to be able to establish TLS connections:
s.resource_bundles = { 'gRPCCertificates' => ['etc/roots.pem'] }
s.pod_target_xcconfig = {
# This is needed by all pods that depend on gRPC-RxLibrary:
@ -49,103 +55,29 @@ Pod::Spec.new do |s|
'CLANG_WARN_STRICT_PROTOTYPES' => 'NO',
}
s.subspec 'Interface-Legacy' do |ss|
ss.header_mappings_dir = 'src/objective-c/GRPCClient'
ss.public_header_files = "GRPCClient/GRPCCall+ChannelArg.h",
"GRPCClient/GRPCCall+ChannelCredentials.h",
"GRPCClient/GRPCCall+Cronet.h",
"GRPCClient/GRPCCall+OAuth2.h",
"GRPCClient/GRPCCall+Tests.h",
"src/objective-c/GRPCClient/GRPCCallLegacy.h",
"src/objective-c/GRPCClient/GRPCTypes.h"
ss.source_files = "GRPCClient/GRPCCall+ChannelArg.h",
"GRPCClient/GRPCCall+ChannelCredentials.h",
"GRPCClient/GRPCCall+Cronet.h",
"GRPCClient/GRPCCall+OAuth2.h",
"GRPCClient/GRPCCall+Tests.h",
"src/objective-c/GRPCClient/GRPCCallLegacy.h",
"src/objective-c/GRPCClient/GRPCTypes.h"
ss.dependency "gRPC-RxLibrary/Interface", version
end
s.subspec 'Main' do |ss|
ss.header_mappings_dir = "#{src_dir}"
s.subspec 'Interface' do |ss|
ss.header_mappings_dir = 'src/objective-c/GRPCClient'
ss.public_header_files = 'src/objective-c/GRPCClient/GRPCCall.h',
'src/objective-c/GRPCClient/GRPCCall+Interceptor.h',
'src/objective-c/GRPCClient/GRPCCallOptions.h',
'src/objective-c/GRPCClient/GRPCInterceptor.h',
'src/objective-c/GRPCClient/GRPCTransport.h',
'src/objective-c/GRPCClient/GRPCDispatchable.h',
'src/objective-c/GRPCClient/version.h'
ss.source_files = 'src/objective-c/GRPCClient/GRPCCall.h',
'src/objective-c/GRPCClient/GRPCCall.m',
'src/objective-c/GRPCClient/GRPCCall+Interceptor.h',
'src/objective-c/GRPCClient/GRPCCall+Interceptor.m',
'src/objective-c/GRPCClient/GRPCCallOptions.h',
'src/objective-c/GRPCClient/GRPCCallOptions.m',
'src/objective-c/GRPCClient/GRPCDispatchable.h',
'src/objective-c/GRPCClient/GRPCInterceptor.h',
'src/objective-c/GRPCClient/GRPCInterceptor.m',
'src/objective-c/GRPCClient/GRPCTransport.h',
'src/objective-c/GRPCClient/GRPCTransport.m',
'src/objective-c/GRPCClient/internal/*.h',
'src/objective-c/GRPCClient/private/GRPCTransport+Private.h',
'src/objective-c/GRPCClient/private/GRPCTransport+Private.m',
'src/objective-c/GRPCClient/version.h'
ss.dependency "#{s.name}/Interface-Legacy", version
end
ss.source_files = "#{src_dir}/*.{h,m}", "#{src_dir}/**/*.{h,m}"
ss.exclude_files = "#{src_dir}/GRPCCall+GID.{h,m}"
ss.private_header_files = "#{src_dir}/private/*.h", "#{src_dir}/internal/*.h"
s.subspec 'GRPCCore' do |ss|
ss.header_mappings_dir = 'src/objective-c/GRPCClient'
ss.public_header_files = 'src/objective-c/GRPCClient/GRPCCall+ChannelCredentials.h',
'src/objective-c/GRPCClient/GRPCCall+Cronet.h',
'src/objective-c/GRPCClient/GRPCCall+OAuth2.h',
'src/objective-c/GRPCClient/GRPCCall+Tests.h',
'src/objective-c/GRPCClient/GRPCCall+ChannelArg.h',
'src/objective-c/GRPCClient/internal_testing/*.h'
ss.private_header_files = 'src/objective-c/GRPCClient/private/GRPCCore/*.h'
ss.source_files = 'src/objective-c/GRPCClient/internal_testing/*.{h,m}',
'src/objective-c/GRPCClient/private/GRPCCore/*.{h,m}',
'src/objective-c/GRPCClient/GRPCCall+ChannelArg.h',
'src/objective-c/GRPCClient/GRPCCall+ChannelArg.m',
'src/objective-c/GRPCClient/GRPCCall+ChannelCredentials.h',
'src/objective-c/GRPCClient/GRPCCall+ChannelCredentials.m',
'src/objective-c/GRPCClient/GRPCCall+Cronet.h',
'src/objective-c/GRPCClient/GRPCCall+Cronet.m',
'src/objective-c/GRPCClient/GRPCCall+OAuth2.h',
'src/objective-c/GRPCClient/GRPCCall+OAuth2.m',
'src/objective-c/GRPCClient/GRPCCall+Tests.h',
'src/objective-c/GRPCClient/GRPCCall+Tests.m',
'src/objective-c/GRPCClient/GRPCCallLegacy.m'
# Certificates, to be able to establish TLS connections:
ss.resource_bundles = { 'gRPCCertificates' => ['etc/roots.pem'] }
ss.dependency "#{s.name}/Interface-Legacy", version
ss.dependency "#{s.name}/Interface", version
ss.dependency 'gRPC-Core', version
ss.dependency 'gRPC-RxLibrary', version
end
s.subspec 'GRPCCoreCronet' do |ss|
ss.header_mappings_dir = 'src/objective-c/GRPCClient'
ss.source_files = 'src/objective-c/GRPCClient/GRPCCall+Cronet.h',
'src/objective-c/GRPCClient/GRPCCall+Cronet.m',
'src/objective-c/GRPCClient/private/GRPCCore/GRPCCoreCronet/*.{h,m}'
ss.dependency "#{s.name}/GRPCCore", version
ss.dependency 'gRPC-Core/Cronet-Implementation', version
ss.dependency 'CronetFramework'
end
# CFStream is now default. Leaving this subspec only for compatibility purpose.
s.subspec 'CFStream' do |ss|
ss.dependency "#{s.name}/GRPCCore", version
ss.dependency "#{s.name}/Main", version
end
s.subspec 'GID' do |ss|
ss.ios.deployment_target = '7.0'
ss.header_mappings_dir = "#{src_dir}"
ss.source_files = "#{src_dir}/GRPCCall+GID.{h,m}"
ss.dependency "#{s.name}/Main", version
ss.dependency 'Google/SignIn'
end
end

@ -282,6 +282,7 @@ Gem::Specification.new do |s|
s.files += %w( src/core/tsi/transport_security_interface.h )
s.files += %w( src/core/ext/transport/chttp2/client/authority.h )
s.files += %w( src/core/ext/transport/chttp2/client/chttp2_connector.h )
s.files += %w( src/core/ext/filters/client_channel/backend_metric.h )
s.files += %w( src/core/ext/filters/client_channel/backup_poller.h )
s.files += %w( src/core/ext/filters/client_channel/client_channel.h )
s.files += %w( src/core/ext/filters/client_channel/client_channel_channelz.h )
@ -311,6 +312,19 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/filters/client_channel/subchannel_pool_interface.h )
s.files += %w( src/core/ext/filters/deadline/deadline_filter.h )
s.files += %w( src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h )
s.files += %w( src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.h )
s.files += %w( src/core/ext/upb-generated/gogoproto/gogo.upb.h )
s.files += %w( src/core/ext/upb-generated/validate/validate.upb.h )
s.files += %w( src/core/ext/upb-generated/google/api/annotations.upb.h )
s.files += %w( src/core/ext/upb-generated/google/api/http.upb.h )
s.files += %w( src/core/ext/upb-generated/google/protobuf/any.upb.h )
s.files += %w( src/core/ext/upb-generated/google/protobuf/descriptor.upb.h )
s.files += %w( src/core/ext/upb-generated/google/protobuf/duration.upb.h )
s.files += %w( src/core/ext/upb-generated/google/protobuf/empty.upb.h )
s.files += %w( src/core/ext/upb-generated/google/protobuf/struct.upb.h )
s.files += %w( src/core/ext/upb-generated/google/protobuf/timestamp.upb.h )
s.files += %w( src/core/ext/upb-generated/google/protobuf/wrappers.upb.h )
s.files += %w( src/core/ext/upb-generated/google/rpc/status.upb.h )
s.files += %w( src/core/tsi/fake_transport_security.h )
s.files += %w( src/core/tsi/local_transport_security.h )
s.files += %w( src/core/tsi/ssl/session_cache/ssl_session.h )
@ -470,16 +484,6 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h )
s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h )
s.files += %w( src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h )
s.files += %w( src/core/ext/upb-generated/google/api/annotations.upb.h )
s.files += %w( src/core/ext/upb-generated/google/api/http.upb.h )
s.files += %w( src/core/ext/upb-generated/google/protobuf/any.upb.h )
s.files += %w( src/core/ext/upb-generated/google/protobuf/descriptor.upb.h )
s.files += %w( src/core/ext/upb-generated/google/protobuf/duration.upb.h )
s.files += %w( src/core/ext/upb-generated/google/protobuf/empty.upb.h )
s.files += %w( src/core/ext/upb-generated/google/protobuf/struct.upb.h )
s.files += %w( src/core/ext/upb-generated/google/protobuf/timestamp.upb.h )
s.files += %w( src/core/ext/upb-generated/google/protobuf/wrappers.upb.h )
s.files += %w( src/core/ext/upb-generated/google/rpc/status.upb.h )
s.files += %w( src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h )
s.files += %w( src/core/ext/filters/client_channel/lb_policy/xds/xds_channel.h )
s.files += %w( src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.h )
@ -487,6 +491,7 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/api/v2/cds.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/api/v2/cluster/filter.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/api/v2/discovery.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/api/v2/eds.upb.h )
@ -499,11 +504,10 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/api/v2/core/http_uri.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/type/percent.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/type/range.upb.h )
s.files += %w( src/core/ext/upb-generated/gogoproto/gogo.upb.h )
s.files += %w( src/core/ext/upb-generated/validate/validate.upb.h )
s.files += %w( src/core/ext/filters/client_channel/lb_policy/subchannel_list.h )
s.files += %w( src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h )
s.files += %w( src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h )
@ -777,6 +781,7 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc )
s.files += %w( src/core/ext/transport/chttp2/client/authority.cc )
s.files += %w( src/core/ext/transport/chttp2/client/chttp2_connector.cc )
s.files += %w( src/core/ext/filters/client_channel/backend_metric.cc )
s.files += %w( src/core/ext/filters/client_channel/backup_poller.cc )
s.files += %w( src/core/ext/filters/client_channel/channel_connectivity.cc )
s.files += %w( src/core/ext/filters/client_channel/client_channel.cc )
@ -805,6 +810,19 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/filters/client_channel/subchannel_pool_interface.cc )
s.files += %w( src/core/ext/filters/deadline/deadline_filter.cc )
s.files += %w( src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c )
s.files += %w( src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c )
s.files += %w( src/core/ext/upb-generated/gogoproto/gogo.upb.c )
s.files += %w( src/core/ext/upb-generated/validate/validate.upb.c )
s.files += %w( src/core/ext/upb-generated/google/api/annotations.upb.c )
s.files += %w( src/core/ext/upb-generated/google/api/http.upb.c )
s.files += %w( src/core/ext/upb-generated/google/protobuf/any.upb.c )
s.files += %w( src/core/ext/upb-generated/google/protobuf/descriptor.upb.c )
s.files += %w( src/core/ext/upb-generated/google/protobuf/duration.upb.c )
s.files += %w( src/core/ext/upb-generated/google/protobuf/empty.upb.c )
s.files += %w( src/core/ext/upb-generated/google/protobuf/struct.upb.c )
s.files += %w( src/core/ext/upb-generated/google/protobuf/timestamp.upb.c )
s.files += %w( src/core/ext/upb-generated/google/protobuf/wrappers.upb.c )
s.files += %w( src/core/ext/upb-generated/google/rpc/status.upb.c )
s.files += %w( src/core/tsi/fake_transport_security.cc )
s.files += %w( src/core/tsi/local_transport_security.cc )
s.files += %w( src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc )
@ -824,16 +842,6 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc )
s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc )
s.files += %w( src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c )
s.files += %w( src/core/ext/upb-generated/google/api/annotations.upb.c )
s.files += %w( src/core/ext/upb-generated/google/api/http.upb.c )
s.files += %w( src/core/ext/upb-generated/google/protobuf/any.upb.c )
s.files += %w( src/core/ext/upb-generated/google/protobuf/descriptor.upb.c )
s.files += %w( src/core/ext/upb-generated/google/protobuf/duration.upb.c )
s.files += %w( src/core/ext/upb-generated/google/protobuf/empty.upb.c )
s.files += %w( src/core/ext/upb-generated/google/protobuf/struct.upb.c )
s.files += %w( src/core/ext/upb-generated/google/protobuf/timestamp.upb.c )
s.files += %w( src/core/ext/upb-generated/google/protobuf/wrappers.upb.c )
s.files += %w( src/core/ext/upb-generated/google/rpc/status.upb.c )
s.files += %w( src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc )
s.files += %w( src/core/ext/filters/client_channel/lb_policy/xds/xds.cc )
s.files += %w( src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_secure.cc )
@ -842,6 +850,7 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c )
s.files += %w( src/core/ext/upb-generated/envoy/api/v2/cds.upb.c )
s.files += %w( src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c )
s.files += %w( src/core/ext/upb-generated/envoy/api/v2/cluster/filter.upb.c )
s.files += %w( src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c )
s.files += %w( src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c )
s.files += %w( src/core/ext/upb-generated/envoy/api/v2/eds.upb.c )
@ -854,11 +863,10 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c )
s.files += %w( src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c )
s.files += %w( src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c )
s.files += %w( src/core/ext/upb-generated/envoy/api/v2/core/http_uri.upb.c )
s.files += %w( src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c )
s.files += %w( src/core/ext/upb-generated/envoy/type/percent.upb.c )
s.files += %w( src/core/ext/upb-generated/envoy/type/range.upb.c )
s.files += %w( src/core/ext/upb-generated/gogoproto/gogo.upb.c )
s.files += %w( src/core/ext/upb-generated/validate/validate.upb.c )
s.files += %w( src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc )
s.files += %w( src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc )
s.files += %w( src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc )

@ -553,6 +553,7 @@
'src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc',
'src/core/ext/transport/chttp2/client/authority.cc',
'src/core/ext/transport/chttp2/client/chttp2_connector.cc',
'src/core/ext/filters/client_channel/backend_metric.cc',
'src/core/ext/filters/client_channel/backup_poller.cc',
'src/core/ext/filters/client_channel/channel_connectivity.cc',
'src/core/ext/filters/client_channel/client_channel.cc',
@ -581,6 +582,19 @@
'src/core/ext/filters/client_channel/subchannel_pool_interface.cc',
'src/core/ext/filters/deadline/deadline_filter.cc',
'src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c',
'src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c',
'src/core/ext/upb-generated/gogoproto/gogo.upb.c',
'src/core/ext/upb-generated/validate/validate.upb.c',
'src/core/ext/upb-generated/google/api/annotations.upb.c',
'src/core/ext/upb-generated/google/api/http.upb.c',
'src/core/ext/upb-generated/google/protobuf/any.upb.c',
'src/core/ext/upb-generated/google/protobuf/descriptor.upb.c',
'src/core/ext/upb-generated/google/protobuf/duration.upb.c',
'src/core/ext/upb-generated/google/protobuf/empty.upb.c',
'src/core/ext/upb-generated/google/protobuf/struct.upb.c',
'src/core/ext/upb-generated/google/protobuf/timestamp.upb.c',
'src/core/ext/upb-generated/google/protobuf/wrappers.upb.c',
'src/core/ext/upb-generated/google/rpc/status.upb.c',
'src/core/tsi/fake_transport_security.cc',
'src/core/tsi/local_transport_security.cc',
'src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc',
@ -600,16 +614,6 @@
'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc',
'src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc',
'src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c',
'src/core/ext/upb-generated/google/api/annotations.upb.c',
'src/core/ext/upb-generated/google/api/http.upb.c',
'src/core/ext/upb-generated/google/protobuf/any.upb.c',
'src/core/ext/upb-generated/google/protobuf/descriptor.upb.c',
'src/core/ext/upb-generated/google/protobuf/duration.upb.c',
'src/core/ext/upb-generated/google/protobuf/empty.upb.c',
'src/core/ext/upb-generated/google/protobuf/struct.upb.c',
'src/core/ext/upb-generated/google/protobuf/timestamp.upb.c',
'src/core/ext/upb-generated/google/protobuf/wrappers.upb.c',
'src/core/ext/upb-generated/google/rpc/status.upb.c',
'src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc',
'src/core/ext/filters/client_channel/lb_policy/xds/xds.cc',
'src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_secure.cc',
@ -618,6 +622,7 @@
'src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c',
'src/core/ext/upb-generated/envoy/api/v2/cds.upb.c',
'src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c',
'src/core/ext/upb-generated/envoy/api/v2/cluster/filter.upb.c',
'src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c',
'src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c',
'src/core/ext/upb-generated/envoy/api/v2/eds.upb.c',
@ -630,11 +635,10 @@
'src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c',
'src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c',
'src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c',
'src/core/ext/upb-generated/envoy/api/v2/core/http_uri.upb.c',
'src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c',
'src/core/ext/upb-generated/envoy/type/percent.upb.c',
'src/core/ext/upb-generated/envoy/type/range.upb.c',
'src/core/ext/upb-generated/gogoproto/gogo.upb.c',
'src/core/ext/upb-generated/validate/validate.upb.c',
'src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc',
'src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc',
@ -857,6 +861,7 @@
'src/core/lib/transport/transport_op_string.cc',
'src/core/lib/uri/uri_parser.cc',
'src/core/lib/debug/trace.cc',
'src/core/ext/filters/client_channel/backend_metric.cc',
'src/core/ext/filters/client_channel/backup_poller.cc',
'src/core/ext/filters/client_channel/channel_connectivity.cc',
'src/core/ext/filters/client_channel/client_channel.cc',
@ -891,6 +896,19 @@
'third_party/upb/upb/port.c',
'third_party/upb/upb/table.c',
'third_party/upb/upb/upb.c',
'src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c',
'src/core/ext/upb-generated/gogoproto/gogo.upb.c',
'src/core/ext/upb-generated/validate/validate.upb.c',
'src/core/ext/upb-generated/google/api/annotations.upb.c',
'src/core/ext/upb-generated/google/api/http.upb.c',
'src/core/ext/upb-generated/google/protobuf/any.upb.c',
'src/core/ext/upb-generated/google/protobuf/descriptor.upb.c',
'src/core/ext/upb-generated/google/protobuf/duration.upb.c',
'src/core/ext/upb-generated/google/protobuf/empty.upb.c',
'src/core/ext/upb-generated/google/protobuf/struct.upb.c',
'src/core/ext/upb-generated/google/protobuf/timestamp.upb.c',
'src/core/ext/upb-generated/google/protobuf/wrappers.upb.c',
'src/core/ext/upb-generated/google/rpc/status.upb.c',
'src/core/ext/transport/chttp2/transport/bin_decoder.cc',
'src/core/ext/transport/chttp2/transport/bin_encoder.cc',
'src/core/ext/transport/chttp2/transport/chttp2_plugin.cc',
@ -1112,6 +1130,7 @@
'src/core/lib/transport/transport_op_string.cc',
'src/core/lib/uri/uri_parser.cc',
'src/core/lib/debug/trace.cc',
'src/core/ext/filters/client_channel/backend_metric.cc',
'src/core/ext/filters/client_channel/backup_poller.cc',
'src/core/ext/filters/client_channel/channel_connectivity.cc',
'src/core/ext/filters/client_channel/client_channel.cc',
@ -1146,6 +1165,19 @@
'third_party/upb/upb/port.c',
'third_party/upb/upb/table.c',
'third_party/upb/upb/upb.c',
'src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c',
'src/core/ext/upb-generated/gogoproto/gogo.upb.c',
'src/core/ext/upb-generated/validate/validate.upb.c',
'src/core/ext/upb-generated/google/api/annotations.upb.c',
'src/core/ext/upb-generated/google/api/http.upb.c',
'src/core/ext/upb-generated/google/protobuf/any.upb.c',
'src/core/ext/upb-generated/google/protobuf/descriptor.upb.c',
'src/core/ext/upb-generated/google/protobuf/duration.upb.c',
'src/core/ext/upb-generated/google/protobuf/empty.upb.c',
'src/core/ext/upb-generated/google/protobuf/struct.upb.c',
'src/core/ext/upb-generated/google/protobuf/timestamp.upb.c',
'src/core/ext/upb-generated/google/protobuf/wrappers.upb.c',
'src/core/ext/upb-generated/google/rpc/status.upb.c',
'src/core/ext/transport/chttp2/transport/bin_decoder.cc',
'src/core/ext/transport/chttp2/transport/bin_encoder.cc',
'src/core/ext/transport/chttp2/transport/chttp2_plugin.cc',
@ -1378,6 +1410,7 @@
'src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc',
'src/core/ext/transport/chttp2/client/authority.cc',
'src/core/ext/transport/chttp2/client/chttp2_connector.cc',
'src/core/ext/filters/client_channel/backend_metric.cc',
'src/core/ext/filters/client_channel/backup_poller.cc',
'src/core/ext/filters/client_channel/channel_connectivity.cc',
'src/core/ext/filters/client_channel/client_channel.cc',
@ -1412,6 +1445,19 @@
'third_party/upb/upb/port.c',
'third_party/upb/upb/table.c',
'third_party/upb/upb/upb.c',
'src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c',
'src/core/ext/upb-generated/gogoproto/gogo.upb.c',
'src/core/ext/upb-generated/validate/validate.upb.c',
'src/core/ext/upb-generated/google/api/annotations.upb.c',
'src/core/ext/upb-generated/google/api/http.upb.c',
'src/core/ext/upb-generated/google/protobuf/any.upb.c',
'src/core/ext/upb-generated/google/protobuf/descriptor.upb.c',
'src/core/ext/upb-generated/google/protobuf/duration.upb.c',
'src/core/ext/upb-generated/google/protobuf/empty.upb.c',
'src/core/ext/upb-generated/google/protobuf/struct.upb.c',
'src/core/ext/upb-generated/google/protobuf/timestamp.upb.c',
'src/core/ext/upb-generated/google/protobuf/wrappers.upb.c',
'src/core/ext/upb-generated/google/rpc/status.upb.c',
'src/core/ext/transport/inproc/inproc_plugin.cc',
'src/core/ext/transport/inproc/inproc_transport.cc',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc',
@ -1435,16 +1481,6 @@
'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc',
'src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc',
'src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c',
'src/core/ext/upb-generated/google/api/annotations.upb.c',
'src/core/ext/upb-generated/google/api/http.upb.c',
'src/core/ext/upb-generated/google/protobuf/any.upb.c',
'src/core/ext/upb-generated/google/protobuf/descriptor.upb.c',
'src/core/ext/upb-generated/google/protobuf/duration.upb.c',
'src/core/ext/upb-generated/google/protobuf/empty.upb.c',
'src/core/ext/upb-generated/google/protobuf/struct.upb.c',
'src/core/ext/upb-generated/google/protobuf/timestamp.upb.c',
'src/core/ext/upb-generated/google/protobuf/wrappers.upb.c',
'src/core/ext/upb-generated/google/rpc/status.upb.c',
'src/core/ext/filters/client_channel/lb_policy/xds/xds.cc',
'src/core/ext/filters/client_channel/lb_policy/xds/xds_channel.cc',
'src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.cc',
@ -1452,6 +1488,7 @@
'src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c',
'src/core/ext/upb-generated/envoy/api/v2/cds.upb.c',
'src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c',
'src/core/ext/upb-generated/envoy/api/v2/cluster/filter.upb.c',
'src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c',
'src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c',
'src/core/ext/upb-generated/envoy/api/v2/eds.upb.c',
@ -1464,11 +1501,10 @@
'src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c',
'src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c',
'src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c',
'src/core/ext/upb-generated/envoy/api/v2/core/http_uri.upb.c',
'src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c',
'src/core/ext/upb-generated/envoy/type/percent.upb.c',
'src/core/ext/upb-generated/envoy/type/range.upb.c',
'src/core/ext/upb-generated/gogoproto/gogo.upb.c',
'src/core/ext/upb-generated/validate/validate.upb.c',
'src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc',
'src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc',
'src/core/ext/filters/census/grpc_context.cc',

@ -287,6 +287,7 @@
<file baseinstalldir="/" name="src/core/tsi/transport_security_interface.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/client/authority.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/client/chttp2_connector.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/backend_metric.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/backup_poller.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/client_channel.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/client_channel_channelz.h" role="src" />
@ -316,6 +317,19 @@
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/subchannel_pool_interface.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/deadline/deadline_filter.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/gogoproto/gogo.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/validate/validate.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/api/annotations.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/api/http.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/protobuf/any.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/protobuf/descriptor.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/protobuf/duration.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/protobuf/empty.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/protobuf/struct.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/protobuf/timestamp.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/protobuf/wrappers.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/rpc/status.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/tsi/fake_transport_security.h" role="src" />
<file baseinstalldir="/" name="src/core/tsi/local_transport_security.h" role="src" />
<file baseinstalldir="/" name="src/core/tsi/ssl/session_cache/ssl_session.h" role="src" />
@ -475,16 +489,6 @@
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/api/annotations.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/api/http.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/protobuf/any.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/protobuf/descriptor.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/protobuf/duration.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/protobuf/empty.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/protobuf/struct.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/protobuf/timestamp.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/protobuf/wrappers.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/rpc/status.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/xds/xds_channel.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.h" role="src" />
@ -492,6 +496,7 @@
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/api/v2/cds.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/api/v2/cluster/filter.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/api/v2/discovery.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/api/v2/eds.upb.h" role="src" />
@ -504,11 +509,10 @@
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/api/v2/core/http_uri.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/type/percent.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/type/range.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/gogoproto/gogo.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/validate/validate.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/subchannel_list.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h" role="src" />
@ -782,6 +786,7 @@
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/client/authority.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/client/chttp2_connector.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/backend_metric.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/backup_poller.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/channel_connectivity.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/client_channel.cc" role="src" />
@ -810,6 +815,19 @@
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/subchannel_pool_interface.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/deadline/deadline_filter.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/gogoproto/gogo.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/validate/validate.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/api/annotations.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/api/http.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/protobuf/any.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/protobuf/descriptor.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/protobuf/duration.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/protobuf/empty.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/protobuf/struct.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/protobuf/timestamp.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/protobuf/wrappers.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/rpc/status.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/tsi/fake_transport_security.cc" role="src" />
<file baseinstalldir="/" name="src/core/tsi/local_transport_security.cc" role="src" />
<file baseinstalldir="/" name="src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc" role="src" />
@ -829,16 +847,6 @@
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/api/annotations.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/api/http.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/protobuf/any.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/protobuf/descriptor.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/protobuf/duration.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/protobuf/empty.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/protobuf/struct.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/protobuf/timestamp.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/protobuf/wrappers.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/rpc/status.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/xds/xds.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_secure.cc" role="src" />
@ -847,6 +855,7 @@
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/api/v2/cds.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/api/v2/cluster/filter.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/api/v2/eds.upb.c" role="src" />
@ -859,11 +868,10 @@
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/api/v2/core/http_uri.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/type/percent.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/type/range.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/gogoproto/gogo.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/validate/validate.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc" role="src" />

@ -238,21 +238,19 @@ void PrintV2Implementation(Printer* printer, const MethodDescriptor* method,
}
void PrintMethodImplementations(Printer* printer,
const MethodDescriptor* method,
const Parameters& generator_params) {
const MethodDescriptor* method) {
map< ::grpc::string, ::grpc::string> vars = GetMethodVars(method);
PrintProtoRpcDeclarationAsPragma(printer, method, vars);
if (!generator_params.no_v1_compatibility) {
// TODO(jcanizales): Print documentation from the method.
PrintSimpleSignature(printer, method, vars);
PrintSimpleImplementation(printer, method, vars);
// TODO(jcanizales): Print documentation from the method.
printer->Print("// Deprecated methods.\n");
PrintSimpleSignature(printer, method, vars);
PrintSimpleImplementation(printer, method, vars);
printer->Print("// Returns a not-yet-started RPC object.\n");
PrintAdvancedSignature(printer, method, vars);
PrintAdvancedImplementation(printer, method, vars);
}
printer->Print("// Returns a not-yet-started RPC object.\n");
PrintAdvancedSignature(printer, method, vars);
PrintAdvancedImplementation(printer, method, vars);
PrintV2Signature(printer, method, vars);
PrintV2Implementation(printer, method, vars);
@ -278,12 +276,9 @@ void PrintMethodImplementations(Printer* printer,
return output;
}
::grpc::string GetProtocol(const ServiceDescriptor* service,
const Parameters& generator_params) {
::grpc::string GetProtocol(const ServiceDescriptor* service) {
::grpc::string output;
if (generator_params.no_v1_compatibility) return output;
// Scope the output stream so it closes and finalizes output to the string.
grpc::protobuf::io::StringOutputStream output_stream(&output);
Printer printer(&output_stream, '$');
@ -326,8 +321,7 @@ void PrintMethodImplementations(Printer* printer,
return output;
}
::grpc::string GetInterface(const ServiceDescriptor* service,
const Parameters& generator_params) {
::grpc::string GetInterface(const ServiceDescriptor* service) {
::grpc::string output;
// Scope the output stream so it closes and finalizes output to the string.
@ -344,11 +338,7 @@ void PrintMethodImplementations(Printer* printer,
" */\n");
printer.Print(vars,
"@interface $service_class$ :"
" GRPCProtoService<$service_class$2");
if (!generator_params.no_v1_compatibility) {
printer.Print(vars, ", $service_class$");
}
printer.Print(">\n");
" GRPCProtoService<$service_class$, $service_class$2>\n");
printer.Print(
"- (instancetype)initWithHost:(NSString *)host "
"callOptions:(GRPCCallOptions "
@ -357,20 +347,17 @@ void PrintMethodImplementations(Printer* printer,
printer.Print(
"+ (instancetype)serviceWithHost:(NSString *)host "
"callOptions:(GRPCCallOptions *_Nullable)callOptions;\n");
if (!generator_params.no_v1_compatibility) {
printer.Print(
"// The following methods belong to a set of old APIs that have been "
"deprecated.\n");
printer.Print("- (instancetype)initWithHost:(NSString *)host;\n");
printer.Print("+ (instancetype)serviceWithHost:(NSString *)host;\n");
}
printer.Print(
"// The following methods belong to a set of old APIs that have been "
"deprecated.\n");
printer.Print("- (instancetype)initWithHost:(NSString *)host;\n");
printer.Print("+ (instancetype)serviceWithHost:(NSString *)host;\n");
printer.Print("@end\n");
return output;
}
::grpc::string GetSource(const ServiceDescriptor* service,
const Parameters& generator_params) {
::grpc::string GetSource(const ServiceDescriptor* service) {
::grpc::string output;
{
// Scope the output stream so it closes and finalizes output to the string.
@ -394,28 +381,22 @@ void PrintMethodImplementations(Printer* printer,
" packageName:@\"$package$\"\n"
" serviceName:@\"$service_name$\"\n"
" callOptions:callOptions];\n"
"}\n\n");
if (!generator_params.no_v1_compatibility) {
printer.Print(vars,
"- (instancetype)initWithHost:(NSString *)host {\n"
" return [super initWithHost:host\n"
" packageName:@\"$package$\"\n"
" serviceName:@\"$service_name$\"];\n"
"}\n\n");
}
printer.Print("#pragma clang diagnostic pop\n\n");
if (!generator_params.no_v1_compatibility) {
printer.Print(
"// Override superclass initializer to disallow different"
" package and service names.\n"
"- (instancetype)initWithHost:(NSString *)host\n"
" packageName:(NSString *)packageName\n"
" serviceName:(NSString *)serviceName {\n"
" return [self initWithHost:host];\n"
"}\n\n");
}
"}\n\n"
"- (instancetype)initWithHost:(NSString *)host {\n"
" return [super initWithHost:host\n"
" packageName:@\"$package$\"\n"
" serviceName:@\"$service_name$\"];\n"
"}\n\n"
"#pragma clang diagnostic pop\n\n");
printer.Print(
"// Override superclass initializer to disallow different"
" package and service names.\n"
"- (instancetype)initWithHost:(NSString *)host\n"
" packageName:(NSString *)packageName\n"
" serviceName:(NSString *)serviceName {\n"
" return [self initWithHost:host];\n"
"}\n\n"
"- (instancetype)initWithHost:(NSString *)host\n"
" packageName:(NSString *)packageName\n"
" serviceName:(NSString *)serviceName\n"
@ -423,14 +404,11 @@ void PrintMethodImplementations(Printer* printer,
" return [self initWithHost:host callOptions:callOptions];\n"
"}\n\n");
printer.Print("#pragma mark - Class Methods\n\n");
if (!generator_params.no_v1_compatibility) {
printer.Print(
"+ (instancetype)serviceWithHost:(NSString *)host {\n"
" return [[self alloc] initWithHost:host];\n"
"}\n\n");
}
printer.Print(
"#pragma mark - Class Methods\n\n"
"+ (instancetype)serviceWithHost:(NSString *)host {\n"
" return [[self alloc] initWithHost:host];\n"
"}\n\n"
"+ (instancetype)serviceWithHost:(NSString *)host "
"callOptions:(GRPCCallOptions *_Nullable)callOptions {\n"
" return [[self alloc] initWithHost:host callOptions:callOptions];\n"
@ -439,8 +417,7 @@ void PrintMethodImplementations(Printer* printer,
printer.Print("#pragma mark - Method Implementations\n\n");
for (int i = 0; i < service->method_count(); i++) {
PrintMethodImplementations(&printer, service->method(i),
generator_params);
PrintMethodImplementations(&printer, service->method(i));
}
printer.Print("@end\n");

@ -23,11 +23,6 @@
namespace grpc_objective_c_generator {
struct Parameters {
// Do not generate V1 interface and implementation
bool no_v1_compatibility;
};
using ::grpc::protobuf::FileDescriptor;
using ::grpc::protobuf::FileDescriptor;
using ::grpc::protobuf::ServiceDescriptor;
@ -39,8 +34,7 @@ string GetAllMessageClasses(const FileDescriptor* file);
// Returns the content to be included defining the @protocol segment at the
// insertion point of the generated implementation file. This interface is
// legacy and for backwards compatibility.
string GetProtocol(const ServiceDescriptor* service,
const Parameters& generator_params);
string GetProtocol(const ServiceDescriptor* service);
// Returns the content to be included defining the @protocol segment at the
// insertion point of the generated implementation file.
@ -48,13 +42,11 @@ string GetV2Protocol(const ServiceDescriptor* service);
// Returns the content to be included defining the @interface segment at the
// insertion point of the generated implementation file.
string GetInterface(const ServiceDescriptor* service,
const Parameters& generator_params);
string GetInterface(const ServiceDescriptor* service);
// Returns the content to be included in the "global_scope" insertion point of
// the generated implementation file.
string GetSource(const ServiceDescriptor* service,
const Parameters& generator_params);
string GetSource(const ServiceDescriptor* service);
} // namespace grpc_objective_c_generator

@ -111,22 +111,6 @@ class ObjectiveCGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator {
::grpc::string file_name =
google::protobuf::compiler::objectivec::FilePath(file);
grpc_objective_c_generator::Parameters generator_params;
generator_params.no_v1_compatibility = false;
if (!parameter.empty()) {
std::vector<grpc::string> parameters_list =
grpc_generator::tokenize(parameter, ",");
for (auto parameter_string = parameters_list.begin();
parameter_string != parameters_list.end(); parameter_string++) {
std::vector<grpc::string> param =
grpc_generator::tokenize(*parameter_string, "=");
if (param[0] == "no_v1_compatibility") {
generator_params.no_v1_compatibility = true;
}
}
}
{
// Generate .pbrpc.h
@ -137,25 +121,18 @@ class ObjectiveCGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator {
imports = FrameworkImport(file_name + ".pbobjc.h", framework);
}
::grpc::string system_imports =
SystemImport("ProtoRPC/ProtoService.h") +
(generator_params.no_v1_compatibility
? SystemImport("ProtoRPC/ProtoRPC.h")
: SystemImport("ProtoRPC/ProtoRPCLegacy.h"));
if (!generator_params.no_v1_compatibility) {
system_imports += SystemImport("RxLibrary/GRXWriteable.h") +
SystemImport("RxLibrary/GRXWriter.h");
}
::grpc::string system_imports = SystemImport("ProtoRPC/ProtoService.h") +
SystemImport("ProtoRPC/ProtoRPC.h") +
SystemImport("RxLibrary/GRXWriteable.h") +
SystemImport("RxLibrary/GRXWriter.h");
::grpc::string forward_declarations =
"@class GRPCProtoCall;\n"
"@class GRPCUnaryProtoCall;\n"
"@class GRPCStreamingProtoCall;\n"
"@class GRPCCallOptions;\n"
"@protocol GRPCProtoResponseHandler;\n";
if (!generator_params.no_v1_compatibility) {
forward_declarations += "@class GRPCProtoCall;\n";
}
forward_declarations += "\n";
"@protocol GRPCProtoResponseHandler;\n"
"\n";
::grpc::string class_declarations =
grpc_objective_c_generator::GetAllMessageClasses(file);
@ -175,15 +152,13 @@ class ObjectiveCGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator {
::grpc::string protocols;
for (int i = 0; i < file->service_count(); i++) {
const grpc::protobuf::ServiceDescriptor* service = file->service(i);
protocols +=
grpc_objective_c_generator::GetProtocol(service, generator_params);
protocols += grpc_objective_c_generator::GetProtocol(service);
}
::grpc::string interfaces;
for (int i = 0; i < file->service_count(); i++) {
const grpc::protobuf::ServiceDescriptor* service = file->service(i);
interfaces +=
grpc_objective_c_generator::GetInterface(service, generator_params);
interfaces += grpc_objective_c_generator::GetInterface(service);
}
Write(context, file_name + ".pbrpc.h",
@ -203,16 +178,14 @@ class ObjectiveCGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator {
::grpc::string imports;
if (framework.empty()) {
imports = LocalImport(file_name + ".pbrpc.h") +
LocalImport(file_name + ".pbobjc.h");
LocalImport(file_name + ".pbobjc.h") +
SystemImport("ProtoRPC/ProtoRPC.h") +
SystemImport("RxLibrary/GRXWriter+Immediate.h");
} else {
imports = FrameworkImport(file_name + ".pbrpc.h", framework) +
FrameworkImport(file_name + ".pbobjc.h", framework);
}
imports += (generator_params.no_v1_compatibility
? SystemImport("ProtoRPC/ProtoRPC.h")
: SystemImport("ProtoRPC/ProtoRPCLegacy.h"));
if (!generator_params.no_v1_compatibility) {
imports += SystemImport("RxLibrary/GRXWriter+Immediate.h");
FrameworkImport(file_name + ".pbobjc.h", framework) +
SystemImport("ProtoRPC/ProtoRPC.h") +
SystemImport("RxLibrary/GRXWriter+Immediate.h");
}
::grpc::string class_imports;
@ -223,8 +196,7 @@ class ObjectiveCGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator {
::grpc::string definitions;
for (int i = 0; i < file->service_count(); i++) {
const grpc::protobuf::ServiceDescriptor* service = file->service(i);
definitions +=
grpc_objective_c_generator::GetSource(service, generator_params);
definitions += grpc_objective_c_generator::GetSource(service);
}
Write(context, file_name + ".pbrpc.m",

@ -0,0 +1,78 @@
//
// Copyright 2019 gRPC authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#include <grpc/support/port_platform.h>
#include "src/core/ext/filters/client_channel/backend_metric.h"
#include "src/core/lib/gprpp/string_view.h"
#include "udpa/data/orca/v1/orca_load_report.upb.h"
namespace grpc_core {
namespace {
template <typename EntryType>
Map<StringView, double, StringLess> ParseMap(
udpa_data_orca_v1_OrcaLoadReport* msg,
EntryType** (*entry_func)(udpa_data_orca_v1_OrcaLoadReport*, size_t*),
upb_strview (*key_func)(const EntryType*),
double (*value_func)(const EntryType*), Arena* arena) {
Map<StringView, double, StringLess> result;
size_t size;
const auto* const* entries = entry_func(msg, &size);
for (size_t i = 0; i < size; ++i) {
upb_strview key_view = key_func(entries[i]);
char* key = static_cast<char*>(arena->Alloc(key_view.size + 1));
memcpy(key, key_view.data, key_view.size);
result[StringView(key, key_view.size)] = value_func(entries[i]);
}
return result;
}
} // namespace
const LoadBalancingPolicy::BackendMetricData* ParseBackendMetricData(
const grpc_slice& serialized_load_report, Arena* arena) {
upb::Arena upb_arena;
udpa_data_orca_v1_OrcaLoadReport* msg =
udpa_data_orca_v1_OrcaLoadReport_parse(
reinterpret_cast<const char*>(
GRPC_SLICE_START_PTR(serialized_load_report)),
GRPC_SLICE_LENGTH(serialized_load_report), upb_arena.ptr());
if (msg == nullptr) return nullptr;
LoadBalancingPolicy::BackendMetricData* backend_metric_data =
arena->New<LoadBalancingPolicy::BackendMetricData>();
backend_metric_data->cpu_utilization =
udpa_data_orca_v1_OrcaLoadReport_cpu_utilization(msg);
backend_metric_data->mem_utilization =
udpa_data_orca_v1_OrcaLoadReport_mem_utilization(msg);
backend_metric_data->requests_per_second =
udpa_data_orca_v1_OrcaLoadReport_rps(msg);
backend_metric_data->request_cost =
ParseMap<udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry>(
msg, udpa_data_orca_v1_OrcaLoadReport_mutable_request_cost,
udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry_key,
udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry_value, arena);
backend_metric_data->utilization =
ParseMap<udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry>(
msg, udpa_data_orca_v1_OrcaLoadReport_mutable_utilization,
udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry_key,
udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry_value, arena);
return backend_metric_data;
}
} // namespace grpc_core

@ -0,0 +1,36 @@
//
// Copyright 2019 gRPC authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_BACKEND_METRIC_H
#define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_BACKEND_METRIC_H
#include <grpc/support/port_platform.h>
#include <grpc/slice.h>
#include "src/core/ext/filters/client_channel/lb_policy.h"
#include "src/core/lib/gprpp/arena.h"
namespace grpc_core {
// Parses the serialized load report and allocates a BackendMetricData
// object on the arena.
const LoadBalancingPolicy::BackendMetricData* ParseBackendMetricData(
const grpc_slice& serialized_load_report, Arena* arena);
} // namespace grpc_core
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_BACKEND_METRIC_H */

@ -31,6 +31,7 @@
#include <grpc/support/string_util.h>
#include <grpc/support/sync.h>
#include "src/core/ext/filters/client_channel/backend_metric.h"
#include "src/core/ext/filters/client_channel/backup_poller.h"
#include "src/core/ext/filters/client_channel/global_subchannel_pool.h"
#include "src/core/ext/filters/client_channel/http_connect_handshaker.h"
@ -273,6 +274,12 @@ class ChannelData {
bool received_first_resolver_result_ = false;
// The number of SubchannelWrapper instances referencing a given Subchannel.
Map<Subchannel*, int> subchannel_refcount_map_;
// The set of SubchannelWrappers that currently exist.
// No need to hold a ref, since the map is updated in the control-plane
// combiner when the SubchannelWrappers are created and destroyed.
// TODO(roth): We really want to use a set here, not a map. Since we don't
// currently have a set implementation, we use a map and ignore the value.
Map<SubchannelWrapper*, bool> subchannel_wrappers_;
// Pending ConnectedSubchannel updates for each SubchannelWrapper.
// Updates are queued here in the control plane combiner and then applied
// in the data plane combiner when the picker is updated.
@ -374,6 +381,19 @@ class CallData {
void* Alloc(size_t size) override { return calld_->arena_->Alloc(size); }
const LoadBalancingPolicy::BackendMetricData* GetBackendMetricData()
override {
if (calld_->backend_metric_data_ == nullptr) {
grpc_linked_mdelem* md = calld_->recv_trailing_metadata_->idx.named
.x_endpoint_load_metrics_bin;
if (md != nullptr) {
calld_->backend_metric_data_ =
ParseBackendMetricData(GRPC_MDVALUE(md->md), calld_->arena_);
}
}
return calld_->backend_metric_data_;
}
private:
CallData* calld_;
};
@ -706,6 +726,7 @@ class CallData {
bool service_config_applied_ = false;
QueuedPickCanceller* pick_canceller_ = nullptr;
LbCallState lb_call_state_;
const LoadBalancingPolicy::BackendMetricData* backend_metric_data_ = nullptr;
RefCountedPtr<ConnectedSubchannel> connected_subchannel_;
void (*lb_recv_trailing_metadata_ready_)(
void* user_data, grpc_error* error,
@ -799,14 +820,14 @@ class ChannelData::SubchannelWrapper : public SubchannelInterface {
GRPC_CHANNEL_STACK_REF(chand_->owning_stack_, "SubchannelWrapper");
auto* subchannel_node = subchannel_->channelz_node();
if (subchannel_node != nullptr) {
intptr_t subchannel_uuid = subchannel_node->uuid();
auto it = chand_->subchannel_refcount_map_.find(subchannel_);
if (it == chand_->subchannel_refcount_map_.end()) {
chand_->channelz_node_->AddChildSubchannel(subchannel_uuid);
chand_->channelz_node_->AddChildSubchannel(subchannel_node->uuid());
it = chand_->subchannel_refcount_map_.emplace(subchannel_, 0).first;
}
++it->second;
}
chand_->subchannel_wrappers_[this] = true;
}
~SubchannelWrapper() {
@ -815,14 +836,14 @@ class ChannelData::SubchannelWrapper : public SubchannelInterface {
"chand=%p: destroying subchannel wrapper %p for subchannel %p",
chand_, this, subchannel_);
}
chand_->subchannel_wrappers_.erase(this);
auto* subchannel_node = subchannel_->channelz_node();
if (subchannel_node != nullptr) {
intptr_t subchannel_uuid = subchannel_node->uuid();
auto it = chand_->subchannel_refcount_map_.find(subchannel_);
GPR_ASSERT(it != chand_->subchannel_refcount_map_.end());
--it->second;
if (it->second == 0) {
chand_->channelz_node_->RemoveChildSubchannel(subchannel_uuid);
chand_->channelz_node_->RemoveChildSubchannel(subchannel_node->uuid());
chand_->subchannel_refcount_map_.erase(it);
}
}
@ -844,8 +865,9 @@ class ChannelData::SubchannelWrapper : public SubchannelInterface {
UniquePtr<ConnectivityStateWatcherInterface> watcher) override {
auto& watcher_wrapper = watcher_map_[watcher.get()];
GPR_ASSERT(watcher_wrapper == nullptr);
watcher_wrapper = New<WatcherWrapper>(
std::move(watcher), Ref(DEBUG_LOCATION, "WatcherWrapper"));
watcher_wrapper = New<WatcherWrapper>(std::move(watcher),
Ref(DEBUG_LOCATION, "WatcherWrapper"),
initial_state);
subchannel_->WatchConnectivityState(
initial_state,
UniquePtr<char>(gpr_strdup(health_check_service_name_.get())),
@ -870,6 +892,40 @@ class ChannelData::SubchannelWrapper : public SubchannelInterface {
return subchannel_->channel_args();
}
void UpdateHealthCheckServiceName(UniquePtr<char> health_check_service_name) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
gpr_log(GPR_INFO,
"chand=%p: subchannel wrapper %p: updating health check service "
"name from \"%s\" to \"%s\"",
chand_, this, health_check_service_name_.get(),
health_check_service_name.get());
}
for (auto& p : watcher_map_) {
WatcherWrapper*& watcher_wrapper = p.second;
// Cancel the current watcher and create a new one using the new
// health check service name.
// TODO(roth): If there is not already an existing health watch
// call for the new name, then the watcher will initially report
// state CONNECTING. If the LB policy is currently reporting
// state READY, this may cause it to switch to CONNECTING before
// switching back to READY. This could cause a small delay for
// RPCs being started on the channel. If/when this becomes a
// problem, we may be able to handle it by waiting for the new
// watcher to report READY before we use it to replace the old one.
WatcherWrapper* replacement = watcher_wrapper->MakeReplacement();
subchannel_->CancelConnectivityStateWatch(
health_check_service_name_.get(), watcher_wrapper);
watcher_wrapper = replacement;
subchannel_->WatchConnectivityState(
replacement->last_seen_state(),
UniquePtr<char>(gpr_strdup(health_check_service_name.get())),
OrphanablePtr<Subchannel::ConnectivityStateWatcherInterface>(
replacement));
}
// Save the new health check service name.
health_check_service_name_ = std::move(health_check_service_name);
}
// Caller must be holding the control-plane combiner.
ConnectedSubchannel* connected_subchannel() const {
return connected_subchannel_.get();
@ -904,8 +960,11 @@ class ChannelData::SubchannelWrapper : public SubchannelInterface {
WatcherWrapper(
UniquePtr<SubchannelInterface::ConnectivityStateWatcherInterface>
watcher,
RefCountedPtr<SubchannelWrapper> parent)
: watcher_(std::move(watcher)), parent_(std::move(parent)) {}
RefCountedPtr<SubchannelWrapper> parent,
grpc_connectivity_state initial_state)
: watcher_(std::move(watcher)),
parent_(std::move(parent)),
last_seen_state_(initial_state) {}
~WatcherWrapper() { parent_.reset(DEBUG_LOCATION, "WatcherWrapper"); }
@ -928,9 +987,21 @@ class ChannelData::SubchannelWrapper : public SubchannelInterface {
}
grpc_pollset_set* interested_parties() override {
return watcher_->interested_parties();
SubchannelInterface::ConnectivityStateWatcherInterface* watcher =
watcher_.get();
if (watcher_ == nullptr) watcher = replacement_->watcher_.get();
return watcher->interested_parties();
}
WatcherWrapper* MakeReplacement() {
auto* replacement =
New<WatcherWrapper>(std::move(watcher_), parent_, last_seen_state_);
replacement_ = replacement;
return replacement;
}
grpc_connectivity_state last_seen_state() const { return last_seen_state_; }
private:
class Updater {
public:
@ -954,12 +1025,17 @@ class ChannelData::SubchannelWrapper : public SubchannelInterface {
gpr_log(GPR_INFO,
"chand=%p: processing connectivity change in combiner "
"for subchannel wrapper %p subchannel %p "
"(connected_subchannel=%p state=%s)",
"(connected_subchannel=%p state=%s): watcher=%p",
self->parent_->parent_->chand_, self->parent_->parent_.get(),
self->parent_->parent_->subchannel_,
self->connected_subchannel_.get(),
grpc_connectivity_state_name(self->state_));
grpc_connectivity_state_name(self->state_),
self->parent_->watcher_.get());
}
// Ignore update if the parent WatcherWrapper has been replaced
// since this callback was scheduled.
if (self->parent_->watcher_ == nullptr) return;
self->parent_->last_seen_state_ = self->state_;
self->parent_->parent_->MaybeUpdateConnectedSubchannel(
std::move(self->connected_subchannel_));
self->parent_->watcher_->OnConnectivityStateChange(self->state_);
@ -974,6 +1050,8 @@ class ChannelData::SubchannelWrapper : public SubchannelInterface {
UniquePtr<SubchannelInterface::ConnectivityStateWatcherInterface> watcher_;
RefCountedPtr<SubchannelWrapper> parent_;
grpc_connectivity_state last_seen_state_;
WatcherWrapper* replacement_ = nullptr;
};
void MaybeUpdateConnectedSubchannel(
@ -1340,11 +1418,11 @@ class ChannelData::ClientChannelControlHelper
// No-op -- we should never get this from ResolvingLoadBalancingPolicy.
void RequestReresolution() override {}
void AddTraceEvent(TraceSeverity severity, const char* message) override {
void AddTraceEvent(TraceSeverity severity, StringView message) override {
if (chand_->channelz_node_ != nullptr) {
chand_->channelz_node_->AddTraceEvent(
ConvertSeverityEnum(severity),
grpc_slice_from_copied_string(message));
grpc_slice_from_copied_buffer(message.data(), message.size()));
}
}
@ -1655,6 +1733,11 @@ bool ChannelData::ProcessResolverResultLocked(
} else {
chand->health_check_service_name_.reset();
}
// Update health check service name used by existing subchannel wrappers.
for (const auto& p : chand->subchannel_wrappers_) {
p.first->UpdateHealthCheckServiceName(
UniquePtr<char>(gpr_strdup(chand->health_check_service_name_.get())));
}
// Save service config.
chand->saved_service_config_ = std::move(service_config);
}
@ -1927,6 +2010,10 @@ CallData::CallData(grpc_call_element* elem, const ChannelData& chand,
CallData::~CallData() {
grpc_slice_unref_internal(path_);
GRPC_ERROR_UNREF(cancel_error_);
if (backend_metric_data_ != nullptr) {
backend_metric_data_
->LoadBalancingPolicy::BackendMetricData::~BackendMetricData();
}
// Make sure there are no remaining pending batches.
for (size_t i = 0; i < GPR_ARRAY_SIZE(pending_batches_); ++i) {
GPR_ASSERT(pending_batches_[i].batch == nullptr);
@ -3163,8 +3250,8 @@ void CallData::AddRetriableSendInitialMetadataOp(
SubchannelCallRetryState* retry_state,
SubchannelCallBatchData* batch_data) {
// Maps the number of retries to the corresponding metadata value slice.
static const grpc_slice* retry_count_strings[] = {
&GRPC_MDSTR_1, &GRPC_MDSTR_2, &GRPC_MDSTR_3, &GRPC_MDSTR_4};
const grpc_slice* retry_count_strings[] = {&GRPC_MDSTR_1, &GRPC_MDSTR_2,
&GRPC_MDSTR_3, &GRPC_MDSTR_4};
// We need to make a copy of the metadata batch for each attempt, since
// the filters in the subchannel stack may modify this batch, and we don't
// want those modifications to be passed forward to subsequent attempts.
@ -3725,8 +3812,8 @@ const char* PickResultTypeName(
return "COMPLETE";
case LoadBalancingPolicy::PickResult::PICK_QUEUE:
return "QUEUE";
case LoadBalancingPolicy::PickResult::PICK_TRANSIENT_FAILURE:
return "TRANSIENT_FAILURE";
case LoadBalancingPolicy::PickResult::PICK_FAILED:
return "FAILED";
}
GPR_UNREACHABLE_CODE(return "UNKNOWN");
}
@ -3787,7 +3874,7 @@ void CallData::StartPickLocked(void* arg, grpc_error* error) {
result.subchannel.get(), grpc_error_string(result.error));
}
switch (result.type) {
case LoadBalancingPolicy::PickResult::PICK_TRANSIENT_FAILURE: {
case LoadBalancingPolicy::PickResult::PICK_FAILED: {
// If we're shutting down, fail all RPCs.
grpc_error* disconnect_error = chand->disconnect_error();
if (disconnect_error != GRPC_ERROR_NONE) {

@ -47,10 +47,12 @@ static char* get_http_proxy_server(char** user_cred) {
char* proxy_name = nullptr;
char** authority_strs = nullptr;
size_t authority_nstrs;
/* Prefer using 'https_proxy'. Fallback on 'http_proxy' if it is not set. The
/* Prefer using 'grpc_proxy'. Fallback on 'http_proxy' if it is not set.
* Also prefer using 'https_proxy' with fallback on 'http_proxy'. The
* fallback behavior can be removed if there's a demand for it.
*/
char* uri_str = gpr_getenv("https_proxy");
char* uri_str = gpr_getenv("grpc_proxy");
if (uri_str == nullptr) uri_str = gpr_getenv("https_proxy");
if (uri_str == nullptr) uri_str = gpr_getenv("http_proxy");
if (uri_str == nullptr) return nullptr;
grpc_uri* uri = grpc_uri_parse(uri_str, false /* suppress_errors */);
@ -122,7 +124,9 @@ static bool proxy_mapper_map_name(grpc_proxy_mapper* mapper,
server_uri);
goto no_use_proxy;
}
no_proxy_str = gpr_getenv("no_proxy");
/* Prefer using 'no_grpc_proxy'. Fallback on 'no_proxy' if it is not set. */
no_proxy_str = gpr_getenv("no_grpc_proxy");
if (no_proxy_str == nullptr) no_proxy_str = gpr_getenv("no_proxy");
if (no_proxy_str != nullptr) {
static const char* NO_PROXY_SEPARATOR = ",";
bool use_proxy = true;

@ -129,7 +129,7 @@ void LoadBalancingPolicy::QueuePicker::CallExitIdle(void* arg,
LoadBalancingPolicy::PickResult
LoadBalancingPolicy::TransientFailurePicker::Pick(PickArgs args) {
PickResult result;
result.type = PickResult::PICK_TRANSIENT_FAILURE;
result.type = PickResult::PICK_FAILED;
result.error = GRPC_ERROR_REF(error_);
return result;
}

@ -25,6 +25,7 @@
#include "src/core/ext/filters/client_channel/service_config.h"
#include "src/core/ext/filters/client_channel/subchannel_interface.h"
#include "src/core/lib/gprpp/abstract.h"
#include "src/core/lib/gprpp/map.h"
#include "src/core/lib/gprpp/orphanable.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/gprpp/string_view.h"
@ -42,15 +43,15 @@ extern DebugOnlyTraceFlag grpc_trace_lb_policy_refcount;
///
/// Channel: An abstraction that manages connections to backend servers
/// on behalf of a client application. The application creates a channel
/// for a given server name and then sends RPCs on it, and the channel
/// figures out which backend server to send each RPC to. A channel
/// for a given server name and then sends calls (RPCs) on it, and the
/// channel figures out which backend server to send each call to. A channel
/// contains a resolver, a load balancing policy (or a tree of LB policies),
/// and a set of one or more subchannels.
///
/// Subchannel: A subchannel represents a connection to one backend server.
/// The LB policy decides which subchannels to create, manages the
/// connectivity state of those subchannels, and decides which subchannel
/// to send any given RPC to.
/// to send any given call to.
///
/// Resolver: A plugin that takes a gRPC server URI and resolves it to a
/// list of one or more addresses and a service config, as described
@ -59,12 +60,12 @@ extern DebugOnlyTraceFlag grpc_trace_lb_policy_refcount;
///
/// Load Balancing (LB) Policy: A plugin that takes a list of addresses
/// from the resolver, maintains and manages a subchannel for each
/// backend address, and decides which subchannel to send each RPC on.
/// backend address, and decides which subchannel to send each call on.
/// An LB policy has two parts:
/// - A LoadBalancingPolicy, which deals with the control plane work of
/// managing subchannels.
/// - A SubchannelPicker, which handles the data plane work of
/// determining which subchannel a given RPC should be sent on.
/// determining which subchannel a given call should be sent on.
/// LoadBalacingPolicy API.
///
@ -77,7 +78,28 @@ extern DebugOnlyTraceFlag grpc_trace_lb_policy_refcount;
// interested_parties() hooks from the API.
class LoadBalancingPolicy : public InternallyRefCounted<LoadBalancingPolicy> {
public:
// Represents backend metrics reported by the backend to the client.
struct BackendMetricData {
/// CPU utilization expressed as a fraction of available CPU resources.
double cpu_utilization;
/// Memory utilization expressed as a fraction of available memory
/// resources.
double mem_utilization;
/// Total requests per second being served by the backend. This
/// should include all services that a backend is responsible for.
uint64_t requests_per_second;
/// Application-specific requests cost metrics. Metric names are
/// determined by the application. Each value is an absolute cost
/// (e.g. 3487 bytes of storage) associated with the request.
Map<StringView, double, StringLess> request_cost;
/// Application-specific resource utilization metrics. Metric names
/// are determined by the application. Each value is expressed as a
/// fraction of total resources available.
Map<StringView, double, StringLess> utilization;
};
/// Interface for accessing per-call state.
/// Implemented by the client channel and used by the SubchannelPicker.
class CallState {
public:
CallState() = default;
@ -89,10 +111,15 @@ class LoadBalancingPolicy : public InternallyRefCounted<LoadBalancingPolicy> {
/// for allocations that need to be made on a per-call basis.
virtual void* Alloc(size_t size) GRPC_ABSTRACT;
/// Returns the backend metric data returned by the server for the call,
/// or null if no backend metric data was returned.
virtual const BackendMetricData* GetBackendMetricData() GRPC_ABSTRACT;
GRPC_ABSTRACT_BASE_CLASS
};
/// Interface for accessing metadata.
/// Implemented by the client channel and used by the SubchannelPicker.
class MetadataInterface {
public:
// Implementations whose iterators fit in intptr_t may internally
@ -123,7 +150,7 @@ class LoadBalancingPolicy : public InternallyRefCounted<LoadBalancingPolicy> {
GRPC_ABSTRACT_BASE_CLASS
};
/// Arguments used when picking a subchannel for an RPC.
/// Arguments used when picking a subchannel for a call.
struct PickArgs {
/// Initial metadata associated with the picking call.
/// The LB policy may use the existing metadata to influence its routing
@ -135,24 +162,23 @@ class LoadBalancingPolicy : public InternallyRefCounted<LoadBalancingPolicy> {
CallState* call_state;
};
/// The result of picking a subchannel for an RPC.
/// The result of picking a subchannel for a call.
struct PickResult {
enum ResultType {
/// Pick complete. If connected_subchannel is non-null, client channel
/// can immediately proceed with the call on connected_subchannel;
/// otherwise, call should be dropped.
/// Pick complete. If \a subchannel is non-null, the client channel
/// will immediately proceed with the call on that subchannel;
/// otherwise, it will drop the call.
PICK_COMPLETE,
/// Pick cannot be completed until something changes on the control
/// plane. Client channel will queue the pick and try again the
/// plane. The client channel will queue the pick and try again the
/// next time the picker is updated.
PICK_QUEUE,
/// LB policy is in transient failure. If the pick is wait_for_ready,
/// client channel will wait for the next picker and try again;
/// otherwise, the call will be failed immediately (although it may
/// be retried if the client channel is configured to do so).
/// The Pick() method will set its error parameter if this value is
/// returned.
PICK_TRANSIENT_FAILURE,
/// Pick failed. If the call is wait_for_ready, the client channel
/// will wait for the next picker and try again; otherwise, it
/// will immediately fail the call with the status indicated via
/// \a error (although the call may be retried if the client channel
/// is configured to do so).
PICK_FAILED,
};
ResultType type;
@ -160,20 +186,21 @@ class LoadBalancingPolicy : public InternallyRefCounted<LoadBalancingPolicy> {
/// subchannel, or nullptr if the LB policy decides to drop the call.
RefCountedPtr<SubchannelInterface> subchannel;
/// Used only if type is PICK_TRANSIENT_FAILURE.
/// Error to be set when returning a transient failure.
/// Used only if type is PICK_FAILED.
/// Error to be set when returning a failure.
// TODO(roth): Replace this with something similar to grpc::Status,
// so that we don't expose grpc_error to this API.
grpc_error* error = GRPC_ERROR_NONE;
/// Used only if type is PICK_COMPLETE.
/// Callback set by lb policy to be notified of trailing metadata.
/// Callback set by LB policy to be notified of trailing metadata.
/// The user_data argument will be set to the
/// recv_trailing_metadata_ready_user_data field.
/// recv_trailing_metadata will be set to the metadata, which may be
/// modified by the callback. The callback does not take ownership,
/// however, so any data that needs to be used after returning must
/// be copied.
/// call_state can be used to obtain backend metric data.
// TODO(roth): Replace grpc_error with something better before we allow
// people outside of gRPC team to use this API.
void (*recv_trailing_metadata_ready)(
@ -184,11 +211,12 @@ class LoadBalancingPolicy : public InternallyRefCounted<LoadBalancingPolicy> {
};
/// A subchannel picker is the object used to pick the subchannel to
/// use for a given RPC.
/// use for a given call. This is implemented by the LB policy and
/// used by the client channel to perform picks.
///
/// Pickers are intended to encapsulate all of the state and logic
/// needed on the data plane (i.e., to actually process picks for
/// individual RPCs sent on the channel) while excluding all of the
/// individual calls sent on the channel) while excluding all of the
/// state and logic needed on the control plane (i.e., resolver
/// updates, connectivity state notifications, etc); the latter should
/// live in the LB policy object itself.
@ -206,8 +234,8 @@ class LoadBalancingPolicy : public InternallyRefCounted<LoadBalancingPolicy> {
GRPC_ABSTRACT_BASE_CLASS
};
/// A proxy object used by the LB policy to communicate with the client
/// channel.
/// A proxy object implemented by the client channel and used by the
/// LB policy to communicate with the channel.
// TODO(juanlishen): Consider adding a mid-layer subclass that helps handle
// things like swapping in pending policy when it's ready. Currently, we are
// duplicating the logic in many subclasses.
@ -229,10 +257,9 @@ class LoadBalancingPolicy : public InternallyRefCounted<LoadBalancingPolicy> {
virtual void RequestReresolution() GRPC_ABSTRACT;
/// Adds a trace message associated with the channel.
/// Does NOT take ownership of \a message.
enum TraceSeverity { TRACE_INFO, TRACE_WARNING, TRACE_ERROR };
virtual void AddTraceEvent(TraceSeverity severity,
const char* message) GRPC_ABSTRACT;
StringView message) GRPC_ABSTRACT;
GRPC_ABSTRACT_BASE_CLASS
};

@ -296,7 +296,7 @@ class GrpcLb : public LoadBalancingPolicy {
void UpdateState(grpc_connectivity_state state,
UniquePtr<SubchannelPicker> picker) override;
void RequestReresolution() override;
void AddTraceEvent(TraceSeverity severity, const char* message) override;
void AddTraceEvent(TraceSeverity severity, StringView message) override;
void set_child(LoadBalancingPolicy* child) { child_ = child; }
@ -745,8 +745,7 @@ void GrpcLb::Helper::RequestReresolution() {
}
}
void GrpcLb::Helper::AddTraceEvent(TraceSeverity severity,
const char* message) {
void GrpcLb::Helper::AddTraceEvent(TraceSeverity severity, StringView message) {
if (parent_->shutting_down_ ||
(!CalledByPendingChild() && !CalledByCurrentChild())) {
return;

@ -434,7 +434,7 @@ class XdsLb : public LoadBalancingPolicy {
void UpdateState(grpc_connectivity_state state,
UniquePtr<SubchannelPicker> picker) override;
void RequestReresolution() override;
void AddTraceEvent(TraceSeverity severity, const char* message) override;
void AddTraceEvent(TraceSeverity severity, StringView message) override;
void set_child(LoadBalancingPolicy* child) { child_ = child; }
@ -483,8 +483,7 @@ class XdsLb : public LoadBalancingPolicy {
void UpdateState(grpc_connectivity_state state,
UniquePtr<SubchannelPicker> picker) override;
void RequestReresolution() override;
void AddTraceEvent(TraceSeverity severity,
const char* message) override;
void AddTraceEvent(TraceSeverity severity, StringView message) override;
void set_child(LoadBalancingPolicy* child) { child_ = child; }
private:
@ -761,7 +760,7 @@ void XdsLb::FallbackHelper::RequestReresolution() {
}
void XdsLb::FallbackHelper::AddTraceEvent(TraceSeverity severity,
const char* message) {
StringView message) {
if (parent_->shutting_down_ ||
(!CalledByPendingFallback() && !CalledByCurrentFallback())) {
return;
@ -2487,7 +2486,7 @@ void XdsLb::LocalityMap::LocalityEntry::Helper::RequestReresolution() {
}
void XdsLb::LocalityMap::LocalityEntry::Helper::AddTraceEvent(
TraceSeverity severity, const char* message) {
TraceSeverity severity, StringView message) {
if (entry_->parent_->shutting_down_ ||
(!CalledByPendingChild() && !CalledByCurrentChild())) {
return;

@ -153,7 +153,7 @@ class ResolvingLoadBalancingPolicy::ResolvingControlHelper
}
}
void AddTraceEvent(TraceSeverity severity, const char* message) override {}
void AddTraceEvent(TraceSeverity severity, StringView message) override {}
void set_child(LoadBalancingPolicy* child) { child_ = child; }
@ -428,7 +428,7 @@ void ResolvingLoadBalancingPolicy::ConcatenateAndAddChannelTraceLocked(
size_t len = 0;
UniquePtr<char> message(gpr_strvec_flatten(&v, &len));
channel_control_helper()->AddTraceEvent(ChannelControlHelper::TRACE_INFO,
message.get());
StringView(message.get()));
gpr_strvec_destroy(&v);
}
}

@ -22,6 +22,7 @@
#include <grpc/support/port_platform.h>
#include "opencensus/stats/stats.h"
#include "opencensus/tags/tag_key.h"
#include "src/cpp/server/load_reporter/constants.h"
@ -80,33 +81,33 @@ inline ::opencensus::stats::MeasureDouble MeasureOtherCallMetric() {
// Tags.
inline ::opencensus::stats::TagKey TagKeyToken() {
static const ::opencensus::stats::TagKey token =
opencensus::stats::TagKey::Register(kTagKeyToken);
inline ::opencensus::tags::TagKey TagKeyToken() {
static const ::opencensus::tags::TagKey token =
opencensus::tags::TagKey::Register(kTagKeyToken);
return token;
}
inline ::opencensus::stats::TagKey TagKeyHost() {
static const ::opencensus::stats::TagKey token =
opencensus::stats::TagKey::Register(kTagKeyHost);
inline ::opencensus::tags::TagKey TagKeyHost() {
static const ::opencensus::tags::TagKey token =
opencensus::tags::TagKey::Register(kTagKeyHost);
return token;
}
inline ::opencensus::stats::TagKey TagKeyUserId() {
static const ::opencensus::stats::TagKey token =
opencensus::stats::TagKey::Register(kTagKeyUserId);
inline ::opencensus::tags::TagKey TagKeyUserId() {
static const ::opencensus::tags::TagKey token =
opencensus::tags::TagKey::Register(kTagKeyUserId);
return token;
}
inline ::opencensus::stats::TagKey TagKeyStatus() {
static const ::opencensus::stats::TagKey token =
opencensus::stats::TagKey::Register(kTagKeyStatus);
inline ::opencensus::tags::TagKey TagKeyStatus() {
static const ::opencensus::tags::TagKey token =
opencensus::tags::TagKey::Register(kTagKeyStatus);
return token;
}
inline ::opencensus::stats::TagKey TagKeyMetricName() {
static const ::opencensus::stats::TagKey token =
opencensus::stats::TagKey::Register(kTagKeyMetricName);
inline ::opencensus::tags::TagKey TagKeyMetricName() {
static const ::opencensus::tags::TagKey token =
opencensus::tags::TagKey::Register(kTagKeyMetricName);
return token;
}

@ -189,7 +189,7 @@ grpc_chttp2_hptbl_find_result grpc_chttp2_hptbl_find(
/* See if the string is in the static table */
for (i = 0; i < GRPC_CHTTP2_LAST_STATIC_ENTRY; i++) {
grpc_mdelem ent = grpc_static_mdelem_manifested[i];
grpc_mdelem ent = grpc_static_mdelem_manifested()[i];
if (!grpc_slice_eq(GRPC_MDKEY(md), GRPC_MDKEY(ent))) continue;
r.index = i + 1u;
r.has_value = grpc_slice_eq(GRPC_MDVALUE(md), GRPC_MDVALUE(ent));

@ -104,7 +104,7 @@ inline grpc_mdelem grpc_chttp2_hptbl_lookup(const grpc_chttp2_hptbl* tbl,
reading the core static metadata table here; at that point we'd need our
own singleton static metadata in the correct order. */
return index <= GRPC_CHTTP2_LAST_STATIC_ENTRY
? grpc_static_mdelem_manifested[index - 1]
? grpc_static_mdelem_manifested()[index - 1]
: grpc_chttp2_hptbl_lookup_dynamic_index(tbl, index);
}
/* add a table entry to the index */
@ -120,7 +120,7 @@ size_t grpc_chttp2_get_size_in_hpack_table(grpc_mdelem elem,
inline uintptr_t grpc_chttp2_get_static_hpack_table_index(grpc_mdelem md) {
uintptr_t index =
reinterpret_cast<grpc_core::StaticMetadata*>(GRPC_MDELEM_DATA(md)) -
grpc_static_mdelem_table;
grpc_static_mdelem_table();
if (index < GRPC_CHTTP2_LAST_STATIC_ENTRY) {
return index + 1; // Hpack static metadata element indices start at 1
}

@ -11,6 +11,8 @@
#include "envoy/api/v2/auth/cert.upb.h"
#include "envoy/api/v2/core/base.upb.h"
#include "envoy/api/v2/core/config_source.upb.h"
#include "google/protobuf/any.upb.h"
#include "google/protobuf/struct.upb.h"
#include "google/protobuf/wrappers.upb.h"
#include "validate/validate.upb.h"
#include "gogoproto/gogo.upb.h"
@ -30,22 +32,41 @@ const upb_msglayout envoy_api_v2_auth_TlsParameters_msginit = {
UPB_SIZE(24, 32), 4, false,
};
static const upb_msglayout *const envoy_api_v2_auth_TlsCertificate_submsgs[5] = {
static const upb_msglayout *const envoy_api_v2_auth_PrivateKeyProvider_submsgs[2] = {
&google_protobuf_Any_msginit,
&google_protobuf_Struct_msginit,
};
static const upb_msglayout_field envoy_api_v2_auth_PrivateKeyProvider__fields[3] = {
{1, UPB_SIZE(0, 0), 0, 0, 9, 1},
{2, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 1, 11, 1},
{3, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, 1},
};
const upb_msglayout envoy_api_v2_auth_PrivateKeyProvider_msginit = {
&envoy_api_v2_auth_PrivateKeyProvider_submsgs[0],
&envoy_api_v2_auth_PrivateKeyProvider__fields[0],
UPB_SIZE(16, 32), 3, false,
};
static const upb_msglayout *const envoy_api_v2_auth_TlsCertificate_submsgs[6] = {
&envoy_api_v2_auth_PrivateKeyProvider_msginit,
&envoy_api_v2_core_DataSource_msginit,
};
static const upb_msglayout_field envoy_api_v2_auth_TlsCertificate__fields[5] = {
{1, UPB_SIZE(0, 0), 0, 0, 11, 1},
{2, UPB_SIZE(4, 8), 0, 0, 11, 1},
{3, UPB_SIZE(8, 16), 0, 0, 11, 1},
{4, UPB_SIZE(12, 24), 0, 0, 11, 1},
{5, UPB_SIZE(16, 32), 0, 0, 11, 3},
static const upb_msglayout_field envoy_api_v2_auth_TlsCertificate__fields[6] = {
{1, UPB_SIZE(0, 0), 0, 1, 11, 1},
{2, UPB_SIZE(4, 8), 0, 1, 11, 1},
{3, UPB_SIZE(8, 16), 0, 1, 11, 1},
{4, UPB_SIZE(12, 24), 0, 1, 11, 1},
{5, UPB_SIZE(20, 40), 0, 1, 11, 3},
{6, UPB_SIZE(16, 32), 0, 0, 11, 1},
};
const upb_msglayout envoy_api_v2_auth_TlsCertificate_msginit = {
&envoy_api_v2_auth_TlsCertificate_submsgs[0],
&envoy_api_v2_auth_TlsCertificate__fields[0],
UPB_SIZE(20, 40), 5, false,
UPB_SIZE(24, 48), 6, false,
};
static const upb_msglayout *const envoy_api_v2_auth_TlsSessionTicketKeys_submsgs[1] = {

@ -21,6 +21,7 @@ extern "C" {
#endif
struct envoy_api_v2_auth_TlsParameters;
struct envoy_api_v2_auth_PrivateKeyProvider;
struct envoy_api_v2_auth_TlsCertificate;
struct envoy_api_v2_auth_TlsSessionTicketKeys;
struct envoy_api_v2_auth_CertificateValidationContext;
@ -31,6 +32,7 @@ struct envoy_api_v2_auth_DownstreamTlsContext;
struct envoy_api_v2_auth_SdsSecretConfig;
struct envoy_api_v2_auth_Secret;
typedef struct envoy_api_v2_auth_TlsParameters envoy_api_v2_auth_TlsParameters;
typedef struct envoy_api_v2_auth_PrivateKeyProvider envoy_api_v2_auth_PrivateKeyProvider;
typedef struct envoy_api_v2_auth_TlsCertificate envoy_api_v2_auth_TlsCertificate;
typedef struct envoy_api_v2_auth_TlsSessionTicketKeys envoy_api_v2_auth_TlsSessionTicketKeys;
typedef struct envoy_api_v2_auth_CertificateValidationContext envoy_api_v2_auth_CertificateValidationContext;
@ -41,6 +43,7 @@ typedef struct envoy_api_v2_auth_DownstreamTlsContext envoy_api_v2_auth_Downstre
typedef struct envoy_api_v2_auth_SdsSecretConfig envoy_api_v2_auth_SdsSecretConfig;
typedef struct envoy_api_v2_auth_Secret envoy_api_v2_auth_Secret;
extern const upb_msglayout envoy_api_v2_auth_TlsParameters_msginit;
extern const upb_msglayout envoy_api_v2_auth_PrivateKeyProvider_msginit;
extern const upb_msglayout envoy_api_v2_auth_TlsCertificate_msginit;
extern const upb_msglayout envoy_api_v2_auth_TlsSessionTicketKeys_msginit;
extern const upb_msglayout envoy_api_v2_auth_CertificateValidationContext_msginit;
@ -52,11 +55,15 @@ extern const upb_msglayout envoy_api_v2_auth_SdsSecretConfig_msginit;
extern const upb_msglayout envoy_api_v2_auth_Secret_msginit;
struct envoy_api_v2_core_ConfigSource;
struct envoy_api_v2_core_DataSource;
struct google_protobuf_Any;
struct google_protobuf_BoolValue;
struct google_protobuf_Struct;
struct google_protobuf_UInt32Value;
extern const upb_msglayout envoy_api_v2_core_ConfigSource_msginit;
extern const upb_msglayout envoy_api_v2_core_DataSource_msginit;
extern const upb_msglayout google_protobuf_Any_msginit;
extern const upb_msglayout google_protobuf_BoolValue_msginit;
extern const upb_msglayout google_protobuf_Struct_msginit;
extern const upb_msglayout google_protobuf_UInt32Value_msginit;
typedef enum {
@ -114,6 +121,61 @@ UPB_INLINE bool envoy_api_v2_auth_TlsParameters_add_ecdh_curves(envoy_api_v2_aut
msg, UPB_SIZE(20, 24), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val, arena);
}
/* envoy.api.v2.auth.PrivateKeyProvider */
UPB_INLINE envoy_api_v2_auth_PrivateKeyProvider *envoy_api_v2_auth_PrivateKeyProvider_new(upb_arena *arena) {
return (envoy_api_v2_auth_PrivateKeyProvider *)upb_msg_new(&envoy_api_v2_auth_PrivateKeyProvider_msginit, arena);
}
UPB_INLINE envoy_api_v2_auth_PrivateKeyProvider *envoy_api_v2_auth_PrivateKeyProvider_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_api_v2_auth_PrivateKeyProvider *ret = envoy_api_v2_auth_PrivateKeyProvider_new(arena);
return (ret && upb_decode(buf, size, ret, &envoy_api_v2_auth_PrivateKeyProvider_msginit, arena)) ? ret : NULL;
}
UPB_INLINE char *envoy_api_v2_auth_PrivateKeyProvider_serialize(const envoy_api_v2_auth_PrivateKeyProvider *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_api_v2_auth_PrivateKeyProvider_msginit, arena, len);
}
typedef enum {
envoy_api_v2_auth_PrivateKeyProvider_config_type_config = 2,
envoy_api_v2_auth_PrivateKeyProvider_config_type_typed_config = 3,
envoy_api_v2_auth_PrivateKeyProvider_config_type_NOT_SET = 0
} envoy_api_v2_auth_PrivateKeyProvider_config_type_oneofcases;
UPB_INLINE envoy_api_v2_auth_PrivateKeyProvider_config_type_oneofcases envoy_api_v2_auth_PrivateKeyProvider_config_type_case(const envoy_api_v2_auth_PrivateKeyProvider* msg) { return (envoy_api_v2_auth_PrivateKeyProvider_config_type_oneofcases)UPB_FIELD_AT(msg, int32_t, UPB_SIZE(12, 24)); }
UPB_INLINE upb_strview envoy_api_v2_auth_PrivateKeyProvider_provider_name(const envoy_api_v2_auth_PrivateKeyProvider *msg) { return UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(0, 0)); }
UPB_INLINE bool envoy_api_v2_auth_PrivateKeyProvider_has_config(const envoy_api_v2_auth_PrivateKeyProvider *msg) { return _upb_has_oneof_field(msg, UPB_SIZE(12, 24), 2); }
UPB_INLINE const struct google_protobuf_Struct* envoy_api_v2_auth_PrivateKeyProvider_config(const envoy_api_v2_auth_PrivateKeyProvider *msg) { return UPB_READ_ONEOF(msg, const struct google_protobuf_Struct*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 2, NULL); }
UPB_INLINE bool envoy_api_v2_auth_PrivateKeyProvider_has_typed_config(const envoy_api_v2_auth_PrivateKeyProvider *msg) { return _upb_has_oneof_field(msg, UPB_SIZE(12, 24), 3); }
UPB_INLINE const struct google_protobuf_Any* envoy_api_v2_auth_PrivateKeyProvider_typed_config(const envoy_api_v2_auth_PrivateKeyProvider *msg) { return UPB_READ_ONEOF(msg, const struct google_protobuf_Any*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 3, NULL); }
UPB_INLINE void envoy_api_v2_auth_PrivateKeyProvider_set_provider_name(envoy_api_v2_auth_PrivateKeyProvider *msg, upb_strview value) {
UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(0, 0)) = value;
}
UPB_INLINE void envoy_api_v2_auth_PrivateKeyProvider_set_config(envoy_api_v2_auth_PrivateKeyProvider *msg, struct google_protobuf_Struct* value) {
UPB_WRITE_ONEOF(msg, struct google_protobuf_Struct*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 2);
}
UPB_INLINE struct google_protobuf_Struct* envoy_api_v2_auth_PrivateKeyProvider_mutable_config(envoy_api_v2_auth_PrivateKeyProvider *msg, upb_arena *arena) {
struct google_protobuf_Struct* sub = (struct google_protobuf_Struct*)envoy_api_v2_auth_PrivateKeyProvider_config(msg);
if (sub == NULL) {
sub = (struct google_protobuf_Struct*)upb_msg_new(&google_protobuf_Struct_msginit, arena);
if (!sub) return NULL;
envoy_api_v2_auth_PrivateKeyProvider_set_config(msg, sub);
}
return sub;
}
UPB_INLINE void envoy_api_v2_auth_PrivateKeyProvider_set_typed_config(envoy_api_v2_auth_PrivateKeyProvider *msg, struct google_protobuf_Any* value) {
UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 3);
}
UPB_INLINE struct google_protobuf_Any* envoy_api_v2_auth_PrivateKeyProvider_mutable_typed_config(envoy_api_v2_auth_PrivateKeyProvider *msg, upb_arena *arena) {
struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_api_v2_auth_PrivateKeyProvider_typed_config(msg);
if (sub == NULL) {
sub = (struct google_protobuf_Any*)upb_msg_new(&google_protobuf_Any_msginit, arena);
if (!sub) return NULL;
envoy_api_v2_auth_PrivateKeyProvider_set_typed_config(msg, sub);
}
return sub;
}
/* envoy.api.v2.auth.TlsCertificate */
UPB_INLINE envoy_api_v2_auth_TlsCertificate *envoy_api_v2_auth_TlsCertificate_new(upb_arena *arena) {
@ -132,7 +194,8 @@ UPB_INLINE const struct envoy_api_v2_core_DataSource* envoy_api_v2_auth_TlsCerti
UPB_INLINE const struct envoy_api_v2_core_DataSource* envoy_api_v2_auth_TlsCertificate_private_key(const envoy_api_v2_auth_TlsCertificate *msg) { return UPB_FIELD_AT(msg, const struct envoy_api_v2_core_DataSource*, UPB_SIZE(4, 8)); }
UPB_INLINE const struct envoy_api_v2_core_DataSource* envoy_api_v2_auth_TlsCertificate_password(const envoy_api_v2_auth_TlsCertificate *msg) { return UPB_FIELD_AT(msg, const struct envoy_api_v2_core_DataSource*, UPB_SIZE(8, 16)); }
UPB_INLINE const struct envoy_api_v2_core_DataSource* envoy_api_v2_auth_TlsCertificate_ocsp_staple(const envoy_api_v2_auth_TlsCertificate *msg) { return UPB_FIELD_AT(msg, const struct envoy_api_v2_core_DataSource*, UPB_SIZE(12, 24)); }
UPB_INLINE const struct envoy_api_v2_core_DataSource* const* envoy_api_v2_auth_TlsCertificate_signed_certificate_timestamp(const envoy_api_v2_auth_TlsCertificate *msg, size_t *len) { return (const struct envoy_api_v2_core_DataSource* const*)_upb_array_accessor(msg, UPB_SIZE(16, 32), len); }
UPB_INLINE const struct envoy_api_v2_core_DataSource* const* envoy_api_v2_auth_TlsCertificate_signed_certificate_timestamp(const envoy_api_v2_auth_TlsCertificate *msg, size_t *len) { return (const struct envoy_api_v2_core_DataSource* const*)_upb_array_accessor(msg, UPB_SIZE(20, 40), len); }
UPB_INLINE const envoy_api_v2_auth_PrivateKeyProvider* envoy_api_v2_auth_TlsCertificate_private_key_provider(const envoy_api_v2_auth_TlsCertificate *msg) { return UPB_FIELD_AT(msg, const envoy_api_v2_auth_PrivateKeyProvider*, UPB_SIZE(16, 32)); }
UPB_INLINE void envoy_api_v2_auth_TlsCertificate_set_certificate_chain(envoy_api_v2_auth_TlsCertificate *msg, struct envoy_api_v2_core_DataSource* value) {
UPB_FIELD_AT(msg, struct envoy_api_v2_core_DataSource*, UPB_SIZE(0, 0)) = value;
@ -183,18 +246,30 @@ UPB_INLINE struct envoy_api_v2_core_DataSource* envoy_api_v2_auth_TlsCertificate
return sub;
}
UPB_INLINE struct envoy_api_v2_core_DataSource** envoy_api_v2_auth_TlsCertificate_mutable_signed_certificate_timestamp(envoy_api_v2_auth_TlsCertificate *msg, size_t *len) {
return (struct envoy_api_v2_core_DataSource**)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 32), len);
return (struct envoy_api_v2_core_DataSource**)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 40), len);
}
UPB_INLINE struct envoy_api_v2_core_DataSource** envoy_api_v2_auth_TlsCertificate_resize_signed_certificate_timestamp(envoy_api_v2_auth_TlsCertificate *msg, size_t len, upb_arena *arena) {
return (struct envoy_api_v2_core_DataSource**)_upb_array_resize_accessor(msg, UPB_SIZE(16, 32), len, UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, arena);
return (struct envoy_api_v2_core_DataSource**)_upb_array_resize_accessor(msg, UPB_SIZE(20, 40), len, UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, arena);
}
UPB_INLINE struct envoy_api_v2_core_DataSource* envoy_api_v2_auth_TlsCertificate_add_signed_certificate_timestamp(envoy_api_v2_auth_TlsCertificate *msg, upb_arena *arena) {
struct envoy_api_v2_core_DataSource* sub = (struct envoy_api_v2_core_DataSource*)upb_msg_new(&envoy_api_v2_core_DataSource_msginit, arena);
bool ok = _upb_array_append_accessor(
msg, UPB_SIZE(16, 32), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
msg, UPB_SIZE(20, 40), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
if (!ok) return NULL;
return sub;
}
UPB_INLINE void envoy_api_v2_auth_TlsCertificate_set_private_key_provider(envoy_api_v2_auth_TlsCertificate *msg, envoy_api_v2_auth_PrivateKeyProvider* value) {
UPB_FIELD_AT(msg, envoy_api_v2_auth_PrivateKeyProvider*, UPB_SIZE(16, 32)) = value;
}
UPB_INLINE struct envoy_api_v2_auth_PrivateKeyProvider* envoy_api_v2_auth_TlsCertificate_mutable_private_key_provider(envoy_api_v2_auth_TlsCertificate *msg, upb_arena *arena) {
struct envoy_api_v2_auth_PrivateKeyProvider* sub = (struct envoy_api_v2_auth_PrivateKeyProvider*)envoy_api_v2_auth_TlsCertificate_private_key_provider(msg);
if (sub == NULL) {
sub = (struct envoy_api_v2_auth_PrivateKeyProvider*)upb_msg_new(&envoy_api_v2_auth_PrivateKeyProvider_msginit, arena);
if (!sub) return NULL;
envoy_api_v2_auth_TlsCertificate_set_private_key_provider(msg, sub);
}
return sub;
}
/* envoy.api.v2.auth.TlsSessionTicketKeys */

@ -17,6 +17,7 @@
#include "envoy/api/v2/core/health_check.upb.h"
#include "envoy/api/v2/core/protocol.upb.h"
#include "envoy/api/v2/cluster/circuit_breaker.upb.h"
#include "envoy/api/v2/cluster/filter.upb.h"
#include "envoy/api/v2/cluster/outlier_detection.upb.h"
#include "envoy/api/v2/eds.upb.h"
#include "envoy/type/percent.upb.h"
@ -30,7 +31,7 @@
#include "upb/port_def.inc"
static const upb_msglayout *const envoy_api_v2_Cluster_submsgs[28] = {
static const upb_msglayout *const envoy_api_v2_Cluster_submsgs[29] = {
&envoy_api_v2_Cluster_CommonLbConfig_msginit,
&envoy_api_v2_Cluster_CustomClusterType_msginit,
&envoy_api_v2_Cluster_EdsClusterConfig_msginit,
@ -44,6 +45,7 @@ static const upb_msglayout *const envoy_api_v2_Cluster_submsgs[28] = {
&envoy_api_v2_UpstreamConnectionOptions_msginit,
&envoy_api_v2_auth_UpstreamTlsContext_msginit,
&envoy_api_v2_cluster_CircuitBreakers_msginit,
&envoy_api_v2_cluster_Filter_msginit,
&envoy_api_v2_cluster_OutlierDetection_msginit,
&envoy_api_v2_core_Address_msginit,
&envoy_api_v2_core_BindConfig_msginit,
@ -57,49 +59,51 @@ static const upb_msglayout *const envoy_api_v2_Cluster_submsgs[28] = {
&google_protobuf_UInt32Value_msginit,
};
static const upb_msglayout_field envoy_api_v2_Cluster__fields[36] = {
static const upb_msglayout_field envoy_api_v2_Cluster__fields[38] = {
{1, UPB_SIZE(28, 32), 0, 0, 9, 1},
{2, UPB_SIZE(144, 256), UPB_SIZE(-153, -265), 0, 14, 1},
{2, UPB_SIZE(144, 264), UPB_SIZE(-153, -273), 0, 14, 1},
{3, UPB_SIZE(44, 64), 0, 2, 11, 1},
{4, UPB_SIZE(48, 72), 0, 22, 11, 1},
{5, UPB_SIZE(52, 80), 0, 23, 11, 1},
{4, UPB_SIZE(48, 72), 0, 23, 11, 1},
{5, UPB_SIZE(52, 80), 0, 24, 11, 1},
{6, UPB_SIZE(0, 0), 0, 0, 14, 1},
{7, UPB_SIZE(120, 216), 0, 14, 11, 3},
{8, UPB_SIZE(124, 224), 0, 16, 11, 3},
{9, UPB_SIZE(56, 88), 0, 23, 11, 1},
{7, UPB_SIZE(120, 216), 0, 15, 11, 3},
{8, UPB_SIZE(124, 224), 0, 17, 11, 3},
{9, UPB_SIZE(56, 88), 0, 24, 11, 1},
{10, UPB_SIZE(60, 96), 0, 12, 11, 1},
{11, UPB_SIZE(64, 104), 0, 11, 11, 1},
{13, UPB_SIZE(68, 112), 0, 17, 11, 1},
{14, UPB_SIZE(72, 120), 0, 18, 11, 1},
{16, UPB_SIZE(76, 128), 0, 22, 11, 1},
{13, UPB_SIZE(68, 112), 0, 18, 11, 1},
{14, UPB_SIZE(72, 120), 0, 19, 11, 1},
{16, UPB_SIZE(76, 128), 0, 23, 11, 1},
{17, UPB_SIZE(8, 8), 0, 0, 14, 1},
{18, UPB_SIZE(128, 232), 0, 14, 11, 3},
{19, UPB_SIZE(80, 136), 0, 13, 11, 1},
{20, UPB_SIZE(84, 144), 0, 22, 11, 1},
{21, UPB_SIZE(88, 152), 0, 15, 11, 1},
{18, UPB_SIZE(128, 232), 0, 15, 11, 3},
{19, UPB_SIZE(80, 136), 0, 14, 11, 1},
{20, UPB_SIZE(84, 144), 0, 23, 11, 1},
{21, UPB_SIZE(88, 152), 0, 16, 11, 1},
{22, UPB_SIZE(92, 160), 0, 4, 11, 1},
{23, UPB_SIZE(156, 272), UPB_SIZE(-161, -281), 7, 11, 1},
{24, UPB_SIZE(96, 168), 0, 21, 11, 1},
{25, UPB_SIZE(100, 176), 0, 20, 11, 1},
{23, UPB_SIZE(156, 280), UPB_SIZE(-161, -289), 7, 11, 1},
{24, UPB_SIZE(96, 168), 0, 22, 11, 1},
{25, UPB_SIZE(100, 176), 0, 21, 11, 1},
{26, UPB_SIZE(16, 16), 0, 0, 14, 1},
{27, UPB_SIZE(104, 184), 0, 0, 11, 1},
{28, UPB_SIZE(36, 48), 0, 0, 9, 1},
{29, UPB_SIZE(108, 192), 0, 19, 11, 1},
{29, UPB_SIZE(108, 192), 0, 20, 11, 1},
{30, UPB_SIZE(112, 200), 0, 10, 11, 1},
{31, UPB_SIZE(24, 24), 0, 0, 8, 1},
{32, UPB_SIZE(25, 25), 0, 0, 8, 1},
{33, UPB_SIZE(116, 208), 0, 9, 11, 1},
{34, UPB_SIZE(156, 272), UPB_SIZE(-161, -281), 6, 11, 1},
{34, UPB_SIZE(156, 280), UPB_SIZE(-161, -289), 6, 11, 1},
{35, UPB_SIZE(132, 240), 0, 3, 11, 3},
{36, UPB_SIZE(136, 248), 0, 8, 11, 3},
{37, UPB_SIZE(156, 272), UPB_SIZE(-161, -281), 5, 11, 1},
{38, UPB_SIZE(144, 256), UPB_SIZE(-153, -265), 1, 11, 1},
{37, UPB_SIZE(156, 280), UPB_SIZE(-161, -289), 5, 11, 1},
{38, UPB_SIZE(144, 264), UPB_SIZE(-153, -273), 1, 11, 1},
{39, UPB_SIZE(26, 26), 0, 0, 8, 1},
{40, UPB_SIZE(140, 256), 0, 13, 11, 3},
};
const upb_msglayout envoy_api_v2_Cluster_msginit = {
&envoy_api_v2_Cluster_submsgs[0],
&envoy_api_v2_Cluster__fields[0],
UPB_SIZE(168, 288), 36, false,
UPB_SIZE(168, 304), 38, false,
};
static const upb_msglayout *const envoy_api_v2_Cluster_CustomClusterType_submsgs[1] = {
@ -167,29 +171,31 @@ static const upb_msglayout *const envoy_api_v2_Cluster_LbSubsetConfig_submsgs[2]
&google_protobuf_Struct_msginit,
};
static const upb_msglayout_field envoy_api_v2_Cluster_LbSubsetConfig__fields[6] = {
static const upb_msglayout_field envoy_api_v2_Cluster_LbSubsetConfig__fields[7] = {
{1, UPB_SIZE(0, 0), 0, 0, 14, 1},
{2, UPB_SIZE(12, 16), 0, 1, 11, 1},
{3, UPB_SIZE(16, 24), 0, 0, 11, 3},
{4, UPB_SIZE(8, 8), 0, 0, 8, 1},
{5, UPB_SIZE(9, 9), 0, 0, 8, 1},
{6, UPB_SIZE(10, 10), 0, 0, 8, 1},
{7, UPB_SIZE(11, 11), 0, 0, 8, 1},
};
const upb_msglayout envoy_api_v2_Cluster_LbSubsetConfig_msginit = {
&envoy_api_v2_Cluster_LbSubsetConfig_submsgs[0],
&envoy_api_v2_Cluster_LbSubsetConfig__fields[0],
UPB_SIZE(24, 32), 6, false,
UPB_SIZE(24, 32), 7, false,
};
static const upb_msglayout_field envoy_api_v2_Cluster_LbSubsetConfig_LbSubsetSelector__fields[1] = {
{1, UPB_SIZE(0, 0), 0, 0, 9, 3},
static const upb_msglayout_field envoy_api_v2_Cluster_LbSubsetConfig_LbSubsetSelector__fields[2] = {
{1, UPB_SIZE(8, 8), 0, 0, 9, 3},
{2, UPB_SIZE(0, 0), 0, 0, 14, 1},
};
const upb_msglayout envoy_api_v2_Cluster_LbSubsetConfig_LbSubsetSelector_msginit = {
NULL,
&envoy_api_v2_Cluster_LbSubsetConfig_LbSubsetSelector__fields[0],
UPB_SIZE(4, 8), 1, false,
UPB_SIZE(16, 16), 2, false,
};
static const upb_msglayout *const envoy_api_v2_Cluster_LeastRequestLbConfig_submsgs[1] = {
@ -239,18 +245,19 @@ static const upb_msglayout *const envoy_api_v2_Cluster_CommonLbConfig_submsgs[4]
&google_protobuf_Duration_msginit,
};
static const upb_msglayout_field envoy_api_v2_Cluster_CommonLbConfig__fields[5] = {
static const upb_msglayout_field envoy_api_v2_Cluster_CommonLbConfig__fields[6] = {
{1, UPB_SIZE(4, 8), 0, 2, 11, 1},
{2, UPB_SIZE(12, 24), UPB_SIZE(-17, -33), 1, 11, 1},
{3, UPB_SIZE(12, 24), UPB_SIZE(-17, -33), 0, 11, 1},
{4, UPB_SIZE(8, 16), 0, 3, 11, 1},
{5, UPB_SIZE(0, 0), 0, 0, 8, 1},
{6, UPB_SIZE(1, 1), 0, 0, 8, 1},
};
const upb_msglayout envoy_api_v2_Cluster_CommonLbConfig_msginit = {
&envoy_api_v2_Cluster_CommonLbConfig_submsgs[0],
&envoy_api_v2_Cluster_CommonLbConfig__fields[0],
UPB_SIZE(20, 40), 5, false,
UPB_SIZE(20, 40), 6, false,
};
static const upb_msglayout *const envoy_api_v2_Cluster_CommonLbConfig_ZoneAwareLbConfig_submsgs[2] = {

@ -68,6 +68,7 @@ extern const upb_msglayout envoy_api_v2_UpstreamConnectionOptions_msginit;
struct envoy_api_v2_ClusterLoadAssignment;
struct envoy_api_v2_auth_UpstreamTlsContext;
struct envoy_api_v2_cluster_CircuitBreakers;
struct envoy_api_v2_cluster_Filter;
struct envoy_api_v2_cluster_OutlierDetection;
struct envoy_api_v2_core_Address;
struct envoy_api_v2_core_BindConfig;
@ -88,6 +89,7 @@ struct google_protobuf_UInt64Value;
extern const upb_msglayout envoy_api_v2_ClusterLoadAssignment_msginit;
extern const upb_msglayout envoy_api_v2_auth_UpstreamTlsContext_msginit;
extern const upb_msglayout envoy_api_v2_cluster_CircuitBreakers_msginit;
extern const upb_msglayout envoy_api_v2_cluster_Filter_msginit;
extern const upb_msglayout envoy_api_v2_cluster_OutlierDetection_msginit;
extern const upb_msglayout envoy_api_v2_core_Address_msginit;
extern const upb_msglayout envoy_api_v2_core_BindConfig_msginit;
@ -141,6 +143,13 @@ typedef enum {
envoy_api_v2_Cluster_LbSubsetConfig_DEFAULT_SUBSET = 2
} envoy_api_v2_Cluster_LbSubsetConfig_LbSubsetFallbackPolicy;
typedef enum {
envoy_api_v2_Cluster_LbSubsetConfig_LbSubsetSelector_NOT_DEFINED = 0,
envoy_api_v2_Cluster_LbSubsetConfig_LbSubsetSelector_NO_FALLBACK = 1,
envoy_api_v2_Cluster_LbSubsetConfig_LbSubsetSelector_ANY_ENDPOINT = 2,
envoy_api_v2_Cluster_LbSubsetConfig_LbSubsetSelector_DEFAULT_SUBSET = 3
} envoy_api_v2_Cluster_LbSubsetConfig_LbSubsetSelector_LbSubsetSelectorFallbackPolicy;
typedef enum {
envoy_api_v2_Cluster_RingHashLbConfig_XX_HASH = 0,
envoy_api_v2_Cluster_RingHashLbConfig_MURMUR_HASH_2 = 1
@ -166,7 +175,7 @@ typedef enum {
envoy_api_v2_Cluster_cluster_discovery_type_cluster_type = 38,
envoy_api_v2_Cluster_cluster_discovery_type_NOT_SET = 0
} envoy_api_v2_Cluster_cluster_discovery_type_oneofcases;
UPB_INLINE envoy_api_v2_Cluster_cluster_discovery_type_oneofcases envoy_api_v2_Cluster_cluster_discovery_type_case(const envoy_api_v2_Cluster* msg) { return (envoy_api_v2_Cluster_cluster_discovery_type_oneofcases)UPB_FIELD_AT(msg, int32_t, UPB_SIZE(152, 264)); }
UPB_INLINE envoy_api_v2_Cluster_cluster_discovery_type_oneofcases envoy_api_v2_Cluster_cluster_discovery_type_case(const envoy_api_v2_Cluster* msg) { return (envoy_api_v2_Cluster_cluster_discovery_type_oneofcases)UPB_FIELD_AT(msg, int32_t, UPB_SIZE(152, 272)); }
typedef enum {
envoy_api_v2_Cluster_lb_config_ring_hash_lb_config = 23,
@ -174,11 +183,11 @@ typedef enum {
envoy_api_v2_Cluster_lb_config_least_request_lb_config = 37,
envoy_api_v2_Cluster_lb_config_NOT_SET = 0
} envoy_api_v2_Cluster_lb_config_oneofcases;
UPB_INLINE envoy_api_v2_Cluster_lb_config_oneofcases envoy_api_v2_Cluster_lb_config_case(const envoy_api_v2_Cluster* msg) { return (envoy_api_v2_Cluster_lb_config_oneofcases)UPB_FIELD_AT(msg, int32_t, UPB_SIZE(160, 280)); }
UPB_INLINE envoy_api_v2_Cluster_lb_config_oneofcases envoy_api_v2_Cluster_lb_config_case(const envoy_api_v2_Cluster* msg) { return (envoy_api_v2_Cluster_lb_config_oneofcases)UPB_FIELD_AT(msg, int32_t, UPB_SIZE(160, 288)); }
UPB_INLINE upb_strview envoy_api_v2_Cluster_name(const envoy_api_v2_Cluster *msg) { return UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(28, 32)); }
UPB_INLINE bool envoy_api_v2_Cluster_has_type(const envoy_api_v2_Cluster *msg) { return _upb_has_oneof_field(msg, UPB_SIZE(152, 264), 2); }
UPB_INLINE int32_t envoy_api_v2_Cluster_type(const envoy_api_v2_Cluster *msg) { return UPB_READ_ONEOF(msg, int32_t, UPB_SIZE(144, 256), UPB_SIZE(152, 264), 2, envoy_api_v2_Cluster_STATIC); }
UPB_INLINE bool envoy_api_v2_Cluster_has_type(const envoy_api_v2_Cluster *msg) { return _upb_has_oneof_field(msg, UPB_SIZE(152, 272), 2); }
UPB_INLINE int32_t envoy_api_v2_Cluster_type(const envoy_api_v2_Cluster *msg) { return UPB_READ_ONEOF(msg, int32_t, UPB_SIZE(144, 264), UPB_SIZE(152, 272), 2, envoy_api_v2_Cluster_STATIC); }
UPB_INLINE const envoy_api_v2_Cluster_EdsClusterConfig* envoy_api_v2_Cluster_eds_cluster_config(const envoy_api_v2_Cluster *msg) { return UPB_FIELD_AT(msg, const envoy_api_v2_Cluster_EdsClusterConfig*, UPB_SIZE(44, 64)); }
UPB_INLINE const struct google_protobuf_Duration* envoy_api_v2_Cluster_connect_timeout(const envoy_api_v2_Cluster *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_Duration*, UPB_SIZE(48, 72)); }
UPB_INLINE const struct google_protobuf_UInt32Value* envoy_api_v2_Cluster_per_connection_buffer_limit_bytes(const envoy_api_v2_Cluster *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_UInt32Value*, UPB_SIZE(52, 80)); }
@ -197,8 +206,8 @@ UPB_INLINE const struct envoy_api_v2_cluster_OutlierDetection* envoy_api_v2_Clus
UPB_INLINE const struct google_protobuf_Duration* envoy_api_v2_Cluster_cleanup_interval(const envoy_api_v2_Cluster *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_Duration*, UPB_SIZE(84, 144)); }
UPB_INLINE const struct envoy_api_v2_core_BindConfig* envoy_api_v2_Cluster_upstream_bind_config(const envoy_api_v2_Cluster *msg) { return UPB_FIELD_AT(msg, const struct envoy_api_v2_core_BindConfig*, UPB_SIZE(88, 152)); }
UPB_INLINE const envoy_api_v2_Cluster_LbSubsetConfig* envoy_api_v2_Cluster_lb_subset_config(const envoy_api_v2_Cluster *msg) { return UPB_FIELD_AT(msg, const envoy_api_v2_Cluster_LbSubsetConfig*, UPB_SIZE(92, 160)); }
UPB_INLINE bool envoy_api_v2_Cluster_has_ring_hash_lb_config(const envoy_api_v2_Cluster *msg) { return _upb_has_oneof_field(msg, UPB_SIZE(160, 280), 23); }
UPB_INLINE const envoy_api_v2_Cluster_RingHashLbConfig* envoy_api_v2_Cluster_ring_hash_lb_config(const envoy_api_v2_Cluster *msg) { return UPB_READ_ONEOF(msg, const envoy_api_v2_Cluster_RingHashLbConfig*, UPB_SIZE(156, 272), UPB_SIZE(160, 280), 23, NULL); }
UPB_INLINE bool envoy_api_v2_Cluster_has_ring_hash_lb_config(const envoy_api_v2_Cluster *msg) { return _upb_has_oneof_field(msg, UPB_SIZE(160, 288), 23); }
UPB_INLINE const envoy_api_v2_Cluster_RingHashLbConfig* envoy_api_v2_Cluster_ring_hash_lb_config(const envoy_api_v2_Cluster *msg) { return UPB_READ_ONEOF(msg, const envoy_api_v2_Cluster_RingHashLbConfig*, UPB_SIZE(156, 280), UPB_SIZE(160, 288), 23, NULL); }
UPB_INLINE const struct envoy_api_v2_core_TransportSocket* envoy_api_v2_Cluster_transport_socket(const envoy_api_v2_Cluster *msg) { return UPB_FIELD_AT(msg, const struct envoy_api_v2_core_TransportSocket*, UPB_SIZE(96, 168)); }
UPB_INLINE const struct envoy_api_v2_core_Metadata* envoy_api_v2_Cluster_metadata(const envoy_api_v2_Cluster *msg) { return UPB_FIELD_AT(msg, const struct envoy_api_v2_core_Metadata*, UPB_SIZE(100, 176)); }
UPB_INLINE int32_t envoy_api_v2_Cluster_protocol_selection(const envoy_api_v2_Cluster *msg) { return UPB_FIELD_AT(msg, int32_t, UPB_SIZE(16, 16)); }
@ -209,20 +218,22 @@ UPB_INLINE const envoy_api_v2_UpstreamConnectionOptions* envoy_api_v2_Cluster_up
UPB_INLINE bool envoy_api_v2_Cluster_close_connections_on_host_health_failure(const envoy_api_v2_Cluster *msg) { return UPB_FIELD_AT(msg, bool, UPB_SIZE(24, 24)); }
UPB_INLINE bool envoy_api_v2_Cluster_drain_connections_on_host_removal(const envoy_api_v2_Cluster *msg) { return UPB_FIELD_AT(msg, bool, UPB_SIZE(25, 25)); }
UPB_INLINE const struct envoy_api_v2_ClusterLoadAssignment* envoy_api_v2_Cluster_load_assignment(const envoy_api_v2_Cluster *msg) { return UPB_FIELD_AT(msg, const struct envoy_api_v2_ClusterLoadAssignment*, UPB_SIZE(116, 208)); }
UPB_INLINE bool envoy_api_v2_Cluster_has_original_dst_lb_config(const envoy_api_v2_Cluster *msg) { return _upb_has_oneof_field(msg, UPB_SIZE(160, 280), 34); }
UPB_INLINE const envoy_api_v2_Cluster_OriginalDstLbConfig* envoy_api_v2_Cluster_original_dst_lb_config(const envoy_api_v2_Cluster *msg) { return UPB_READ_ONEOF(msg, const envoy_api_v2_Cluster_OriginalDstLbConfig*, UPB_SIZE(156, 272), UPB_SIZE(160, 280), 34, NULL); }
UPB_INLINE bool envoy_api_v2_Cluster_has_original_dst_lb_config(const envoy_api_v2_Cluster *msg) { return _upb_has_oneof_field(msg, UPB_SIZE(160, 288), 34); }
UPB_INLINE const envoy_api_v2_Cluster_OriginalDstLbConfig* envoy_api_v2_Cluster_original_dst_lb_config(const envoy_api_v2_Cluster *msg) { return UPB_READ_ONEOF(msg, const envoy_api_v2_Cluster_OriginalDstLbConfig*, UPB_SIZE(156, 280), UPB_SIZE(160, 288), 34, NULL); }
UPB_INLINE const envoy_api_v2_Cluster_ExtensionProtocolOptionsEntry* const* envoy_api_v2_Cluster_extension_protocol_options(const envoy_api_v2_Cluster *msg, size_t *len) { return (const envoy_api_v2_Cluster_ExtensionProtocolOptionsEntry* const*)_upb_array_accessor(msg, UPB_SIZE(132, 240), len); }
UPB_INLINE const envoy_api_v2_Cluster_TypedExtensionProtocolOptionsEntry* const* envoy_api_v2_Cluster_typed_extension_protocol_options(const envoy_api_v2_Cluster *msg, size_t *len) { return (const envoy_api_v2_Cluster_TypedExtensionProtocolOptionsEntry* const*)_upb_array_accessor(msg, UPB_SIZE(136, 248), len); }
UPB_INLINE bool envoy_api_v2_Cluster_has_least_request_lb_config(const envoy_api_v2_Cluster *msg) { return _upb_has_oneof_field(msg, UPB_SIZE(160, 280), 37); }
UPB_INLINE const envoy_api_v2_Cluster_LeastRequestLbConfig* envoy_api_v2_Cluster_least_request_lb_config(const envoy_api_v2_Cluster *msg) { return UPB_READ_ONEOF(msg, const envoy_api_v2_Cluster_LeastRequestLbConfig*, UPB_SIZE(156, 272), UPB_SIZE(160, 280), 37, NULL); }
UPB_INLINE bool envoy_api_v2_Cluster_has_cluster_type(const envoy_api_v2_Cluster *msg) { return _upb_has_oneof_field(msg, UPB_SIZE(152, 264), 38); }
UPB_INLINE const envoy_api_v2_Cluster_CustomClusterType* envoy_api_v2_Cluster_cluster_type(const envoy_api_v2_Cluster *msg) { return UPB_READ_ONEOF(msg, const envoy_api_v2_Cluster_CustomClusterType*, UPB_SIZE(144, 256), UPB_SIZE(152, 264), 38, NULL); }
UPB_INLINE bool envoy_api_v2_Cluster_has_least_request_lb_config(const envoy_api_v2_Cluster *msg) { return _upb_has_oneof_field(msg, UPB_SIZE(160, 288), 37); }
UPB_INLINE const envoy_api_v2_Cluster_LeastRequestLbConfig* envoy_api_v2_Cluster_least_request_lb_config(const envoy_api_v2_Cluster *msg) { return UPB_READ_ONEOF(msg, const envoy_api_v2_Cluster_LeastRequestLbConfig*, UPB_SIZE(156, 280), UPB_SIZE(160, 288), 37, NULL); }
UPB_INLINE bool envoy_api_v2_Cluster_has_cluster_type(const envoy_api_v2_Cluster *msg) { return _upb_has_oneof_field(msg, UPB_SIZE(152, 272), 38); }
UPB_INLINE const envoy_api_v2_Cluster_CustomClusterType* envoy_api_v2_Cluster_cluster_type(const envoy_api_v2_Cluster *msg) { return UPB_READ_ONEOF(msg, const envoy_api_v2_Cluster_CustomClusterType*, UPB_SIZE(144, 264), UPB_SIZE(152, 272), 38, NULL); }
UPB_INLINE bool envoy_api_v2_Cluster_respect_dns_ttl(const envoy_api_v2_Cluster *msg) { return UPB_FIELD_AT(msg, bool, UPB_SIZE(26, 26)); }
UPB_INLINE const struct envoy_api_v2_cluster_Filter* const* envoy_api_v2_Cluster_filters(const envoy_api_v2_Cluster *msg, size_t *len) { return (const struct envoy_api_v2_cluster_Filter* const*)_upb_array_accessor(msg, UPB_SIZE(140, 256), len); }
UPB_INLINE void envoy_api_v2_Cluster_set_name(envoy_api_v2_Cluster *msg, upb_strview value) {
UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(28, 32)) = value;
}
UPB_INLINE void envoy_api_v2_Cluster_set_type(envoy_api_v2_Cluster *msg, int32_t value) {
UPB_WRITE_ONEOF(msg, int32_t, UPB_SIZE(144, 256), value, UPB_SIZE(152, 264), 2);
UPB_WRITE_ONEOF(msg, int32_t, UPB_SIZE(144, 264), value, UPB_SIZE(152, 272), 2);
}
UPB_INLINE void envoy_api_v2_Cluster_set_eds_cluster_config(envoy_api_v2_Cluster *msg, envoy_api_v2_Cluster_EdsClusterConfig* value) {
UPB_FIELD_AT(msg, envoy_api_v2_Cluster_EdsClusterConfig*, UPB_SIZE(44, 64)) = value;
@ -426,7 +437,7 @@ UPB_INLINE struct envoy_api_v2_Cluster_LbSubsetConfig* envoy_api_v2_Cluster_muta
return sub;
}
UPB_INLINE void envoy_api_v2_Cluster_set_ring_hash_lb_config(envoy_api_v2_Cluster *msg, envoy_api_v2_Cluster_RingHashLbConfig* value) {
UPB_WRITE_ONEOF(msg, envoy_api_v2_Cluster_RingHashLbConfig*, UPB_SIZE(156, 272), value, UPB_SIZE(160, 280), 23);
UPB_WRITE_ONEOF(msg, envoy_api_v2_Cluster_RingHashLbConfig*, UPB_SIZE(156, 280), value, UPB_SIZE(160, 288), 23);
}
UPB_INLINE struct envoy_api_v2_Cluster_RingHashLbConfig* envoy_api_v2_Cluster_mutable_ring_hash_lb_config(envoy_api_v2_Cluster *msg, upb_arena *arena) {
struct envoy_api_v2_Cluster_RingHashLbConfig* sub = (struct envoy_api_v2_Cluster_RingHashLbConfig*)envoy_api_v2_Cluster_ring_hash_lb_config(msg);
@ -522,7 +533,7 @@ UPB_INLINE struct envoy_api_v2_ClusterLoadAssignment* envoy_api_v2_Cluster_mutab
return sub;
}
UPB_INLINE void envoy_api_v2_Cluster_set_original_dst_lb_config(envoy_api_v2_Cluster *msg, envoy_api_v2_Cluster_OriginalDstLbConfig* value) {
UPB_WRITE_ONEOF(msg, envoy_api_v2_Cluster_OriginalDstLbConfig*, UPB_SIZE(156, 272), value, UPB_SIZE(160, 280), 34);
UPB_WRITE_ONEOF(msg, envoy_api_v2_Cluster_OriginalDstLbConfig*, UPB_SIZE(156, 280), value, UPB_SIZE(160, 288), 34);
}
UPB_INLINE struct envoy_api_v2_Cluster_OriginalDstLbConfig* envoy_api_v2_Cluster_mutable_original_dst_lb_config(envoy_api_v2_Cluster *msg, upb_arena *arena) {
struct envoy_api_v2_Cluster_OriginalDstLbConfig* sub = (struct envoy_api_v2_Cluster_OriginalDstLbConfig*)envoy_api_v2_Cluster_original_dst_lb_config(msg);
@ -560,7 +571,7 @@ UPB_INLINE struct envoy_api_v2_Cluster_TypedExtensionProtocolOptionsEntry* envoy
return sub;
}
UPB_INLINE void envoy_api_v2_Cluster_set_least_request_lb_config(envoy_api_v2_Cluster *msg, envoy_api_v2_Cluster_LeastRequestLbConfig* value) {
UPB_WRITE_ONEOF(msg, envoy_api_v2_Cluster_LeastRequestLbConfig*, UPB_SIZE(156, 272), value, UPB_SIZE(160, 280), 37);
UPB_WRITE_ONEOF(msg, envoy_api_v2_Cluster_LeastRequestLbConfig*, UPB_SIZE(156, 280), value, UPB_SIZE(160, 288), 37);
}
UPB_INLINE struct envoy_api_v2_Cluster_LeastRequestLbConfig* envoy_api_v2_Cluster_mutable_least_request_lb_config(envoy_api_v2_Cluster *msg, upb_arena *arena) {
struct envoy_api_v2_Cluster_LeastRequestLbConfig* sub = (struct envoy_api_v2_Cluster_LeastRequestLbConfig*)envoy_api_v2_Cluster_least_request_lb_config(msg);
@ -572,7 +583,7 @@ UPB_INLINE struct envoy_api_v2_Cluster_LeastRequestLbConfig* envoy_api_v2_Cluste
return sub;
}
UPB_INLINE void envoy_api_v2_Cluster_set_cluster_type(envoy_api_v2_Cluster *msg, envoy_api_v2_Cluster_CustomClusterType* value) {
UPB_WRITE_ONEOF(msg, envoy_api_v2_Cluster_CustomClusterType*, UPB_SIZE(144, 256), value, UPB_SIZE(152, 264), 38);
UPB_WRITE_ONEOF(msg, envoy_api_v2_Cluster_CustomClusterType*, UPB_SIZE(144, 264), value, UPB_SIZE(152, 272), 38);
}
UPB_INLINE struct envoy_api_v2_Cluster_CustomClusterType* envoy_api_v2_Cluster_mutable_cluster_type(envoy_api_v2_Cluster *msg, upb_arena *arena) {
struct envoy_api_v2_Cluster_CustomClusterType* sub = (struct envoy_api_v2_Cluster_CustomClusterType*)envoy_api_v2_Cluster_cluster_type(msg);
@ -583,6 +594,22 @@ UPB_INLINE struct envoy_api_v2_Cluster_CustomClusterType* envoy_api_v2_Cluster_m
}
return sub;
}
UPB_INLINE void envoy_api_v2_Cluster_set_respect_dns_ttl(envoy_api_v2_Cluster *msg, bool value) {
UPB_FIELD_AT(msg, bool, UPB_SIZE(26, 26)) = value;
}
UPB_INLINE struct envoy_api_v2_cluster_Filter** envoy_api_v2_Cluster_mutable_filters(envoy_api_v2_Cluster *msg, size_t *len) {
return (struct envoy_api_v2_cluster_Filter**)_upb_array_mutable_accessor(msg, UPB_SIZE(140, 256), len);
}
UPB_INLINE struct envoy_api_v2_cluster_Filter** envoy_api_v2_Cluster_resize_filters(envoy_api_v2_Cluster *msg, size_t len, upb_arena *arena) {
return (struct envoy_api_v2_cluster_Filter**)_upb_array_resize_accessor(msg, UPB_SIZE(140, 256), len, UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, arena);
}
UPB_INLINE struct envoy_api_v2_cluster_Filter* envoy_api_v2_Cluster_add_filters(envoy_api_v2_Cluster *msg, upb_arena *arena) {
struct envoy_api_v2_cluster_Filter* sub = (struct envoy_api_v2_cluster_Filter*)upb_msg_new(&envoy_api_v2_cluster_Filter_msginit, arena);
bool ok = _upb_array_append_accessor(
msg, UPB_SIZE(140, 256), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
if (!ok) return NULL;
return sub;
}
/* envoy.api.v2.Cluster.CustomClusterType */
@ -736,6 +763,7 @@ UPB_INLINE const envoy_api_v2_Cluster_LbSubsetConfig_LbSubsetSelector* const* en
UPB_INLINE bool envoy_api_v2_Cluster_LbSubsetConfig_locality_weight_aware(const envoy_api_v2_Cluster_LbSubsetConfig *msg) { return UPB_FIELD_AT(msg, bool, UPB_SIZE(8, 8)); }
UPB_INLINE bool envoy_api_v2_Cluster_LbSubsetConfig_scale_locality_weight(const envoy_api_v2_Cluster_LbSubsetConfig *msg) { return UPB_FIELD_AT(msg, bool, UPB_SIZE(9, 9)); }
UPB_INLINE bool envoy_api_v2_Cluster_LbSubsetConfig_panic_mode_any(const envoy_api_v2_Cluster_LbSubsetConfig *msg) { return UPB_FIELD_AT(msg, bool, UPB_SIZE(10, 10)); }
UPB_INLINE bool envoy_api_v2_Cluster_LbSubsetConfig_list_as_any(const envoy_api_v2_Cluster_LbSubsetConfig *msg) { return UPB_FIELD_AT(msg, bool, UPB_SIZE(11, 11)); }
UPB_INLINE void envoy_api_v2_Cluster_LbSubsetConfig_set_fallback_policy(envoy_api_v2_Cluster_LbSubsetConfig *msg, int32_t value) {
UPB_FIELD_AT(msg, int32_t, UPB_SIZE(0, 0)) = value;
@ -774,6 +802,9 @@ UPB_INLINE void envoy_api_v2_Cluster_LbSubsetConfig_set_scale_locality_weight(en
UPB_INLINE void envoy_api_v2_Cluster_LbSubsetConfig_set_panic_mode_any(envoy_api_v2_Cluster_LbSubsetConfig *msg, bool value) {
UPB_FIELD_AT(msg, bool, UPB_SIZE(10, 10)) = value;
}
UPB_INLINE void envoy_api_v2_Cluster_LbSubsetConfig_set_list_as_any(envoy_api_v2_Cluster_LbSubsetConfig *msg, bool value) {
UPB_FIELD_AT(msg, bool, UPB_SIZE(11, 11)) = value;
}
/* envoy.api.v2.Cluster.LbSubsetConfig.LbSubsetSelector */
@ -789,17 +820,21 @@ UPB_INLINE char *envoy_api_v2_Cluster_LbSubsetConfig_LbSubsetSelector_serialize(
return upb_encode(msg, &envoy_api_v2_Cluster_LbSubsetConfig_LbSubsetSelector_msginit, arena, len);
}
UPB_INLINE upb_strview const* envoy_api_v2_Cluster_LbSubsetConfig_LbSubsetSelector_keys(const envoy_api_v2_Cluster_LbSubsetConfig_LbSubsetSelector *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
UPB_INLINE upb_strview const* envoy_api_v2_Cluster_LbSubsetConfig_LbSubsetSelector_keys(const envoy_api_v2_Cluster_LbSubsetConfig_LbSubsetSelector *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(8, 8), len); }
UPB_INLINE int32_t envoy_api_v2_Cluster_LbSubsetConfig_LbSubsetSelector_fallback_policy(const envoy_api_v2_Cluster_LbSubsetConfig_LbSubsetSelector *msg) { return UPB_FIELD_AT(msg, int32_t, UPB_SIZE(0, 0)); }
UPB_INLINE upb_strview* envoy_api_v2_Cluster_LbSubsetConfig_LbSubsetSelector_mutable_keys(envoy_api_v2_Cluster_LbSubsetConfig_LbSubsetSelector *msg, size_t *len) {
return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 8), len);
}
UPB_INLINE upb_strview* envoy_api_v2_Cluster_LbSubsetConfig_LbSubsetSelector_resize_keys(envoy_api_v2_Cluster_LbSubsetConfig_LbSubsetSelector *msg, size_t len, upb_arena *arena) {
return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_SIZE(8, 16), UPB_TYPE_STRING, arena);
return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(8, 8), len, UPB_SIZE(8, 16), UPB_TYPE_STRING, arena);
}
UPB_INLINE bool envoy_api_v2_Cluster_LbSubsetConfig_LbSubsetSelector_add_keys(envoy_api_v2_Cluster_LbSubsetConfig_LbSubsetSelector *msg, upb_strview val, upb_arena *arena) {
return _upb_array_append_accessor(
msg, UPB_SIZE(0, 0), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val, arena);
msg, UPB_SIZE(8, 8), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val, arena);
}
UPB_INLINE void envoy_api_v2_Cluster_LbSubsetConfig_LbSubsetSelector_set_fallback_policy(envoy_api_v2_Cluster_LbSubsetConfig_LbSubsetSelector *msg, int32_t value) {
UPB_FIELD_AT(msg, int32_t, UPB_SIZE(0, 0)) = value;
}
/* envoy.api.v2.Cluster.LeastRequestLbConfig */
@ -925,6 +960,7 @@ UPB_INLINE bool envoy_api_v2_Cluster_CommonLbConfig_has_locality_weighted_lb_con
UPB_INLINE const envoy_api_v2_Cluster_CommonLbConfig_LocalityWeightedLbConfig* envoy_api_v2_Cluster_CommonLbConfig_locality_weighted_lb_config(const envoy_api_v2_Cluster_CommonLbConfig *msg) { return UPB_READ_ONEOF(msg, const envoy_api_v2_Cluster_CommonLbConfig_LocalityWeightedLbConfig*, UPB_SIZE(12, 24), UPB_SIZE(16, 32), 3, NULL); }
UPB_INLINE const struct google_protobuf_Duration* envoy_api_v2_Cluster_CommonLbConfig_update_merge_window(const envoy_api_v2_Cluster_CommonLbConfig *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_Duration*, UPB_SIZE(8, 16)); }
UPB_INLINE bool envoy_api_v2_Cluster_CommonLbConfig_ignore_new_hosts_until_first_hc(const envoy_api_v2_Cluster_CommonLbConfig *msg) { return UPB_FIELD_AT(msg, bool, UPB_SIZE(0, 0)); }
UPB_INLINE bool envoy_api_v2_Cluster_CommonLbConfig_close_connections_on_host_set_change(const envoy_api_v2_Cluster_CommonLbConfig *msg) { return UPB_FIELD_AT(msg, bool, UPB_SIZE(1, 1)); }
UPB_INLINE void envoy_api_v2_Cluster_CommonLbConfig_set_healthy_panic_threshold(envoy_api_v2_Cluster_CommonLbConfig *msg, struct envoy_type_Percent* value) {
UPB_FIELD_AT(msg, struct envoy_type_Percent*, UPB_SIZE(4, 8)) = value;
@ -977,6 +1013,9 @@ UPB_INLINE struct google_protobuf_Duration* envoy_api_v2_Cluster_CommonLbConfig_
UPB_INLINE void envoy_api_v2_Cluster_CommonLbConfig_set_ignore_new_hosts_until_first_hc(envoy_api_v2_Cluster_CommonLbConfig *msg, bool value) {
UPB_FIELD_AT(msg, bool, UPB_SIZE(0, 0)) = value;
}
UPB_INLINE void envoy_api_v2_Cluster_CommonLbConfig_set_close_connections_on_host_set_change(envoy_api_v2_Cluster_CommonLbConfig *msg, bool value) {
UPB_FIELD_AT(msg, bool, UPB_SIZE(1, 1)) = value;
}
/* envoy.api.v2.Cluster.CommonLbConfig.ZoneAwareLbConfig */

@ -0,0 +1,34 @@
/* This file was generated by upbc (the upb compiler) from the input
* file:
*
* envoy/api/v2/cluster/filter.proto
*
* Do not edit -- your changes will be discarded when the file is
* regenerated. */
#include <stddef.h>
#include "upb/msg.h"
#include "envoy/api/v2/cluster/filter.upb.h"
#include "google/protobuf/any.upb.h"
#include "validate/validate.upb.h"
#include "gogoproto/gogo.upb.h"
#include "upb/port_def.inc"
static const upb_msglayout *const envoy_api_v2_cluster_Filter_submsgs[1] = {
&google_protobuf_Any_msginit,
};
static const upb_msglayout_field envoy_api_v2_cluster_Filter__fields[2] = {
{1, UPB_SIZE(0, 0), 0, 0, 9, 1},
{2, UPB_SIZE(8, 16), 0, 0, 11, 1},
};
const upb_msglayout envoy_api_v2_cluster_Filter_msginit = {
&envoy_api_v2_cluster_Filter_submsgs[0],
&envoy_api_v2_cluster_Filter__fields[0],
UPB_SIZE(16, 32), 2, false,
};
#include "upb/port_undef.inc"

@ -0,0 +1,69 @@
/* This file was generated by upbc (the upb compiler) from the input
* file:
*
* envoy/api/v2/cluster/filter.proto
*
* Do not edit -- your changes will be discarded when the file is
* regenerated. */
#ifndef ENVOY_API_V2_CLUSTER_FILTER_PROTO_UPB_H_
#define ENVOY_API_V2_CLUSTER_FILTER_PROTO_UPB_H_
#include "upb/generated_util.h"
#include "upb/msg.h"
#include "upb/decode.h"
#include "upb/encode.h"
#include "upb/port_def.inc"
#ifdef __cplusplus
extern "C" {
#endif
struct envoy_api_v2_cluster_Filter;
typedef struct envoy_api_v2_cluster_Filter envoy_api_v2_cluster_Filter;
extern const upb_msglayout envoy_api_v2_cluster_Filter_msginit;
struct google_protobuf_Any;
extern const upb_msglayout google_protobuf_Any_msginit;
/* envoy.api.v2.cluster.Filter */
UPB_INLINE envoy_api_v2_cluster_Filter *envoy_api_v2_cluster_Filter_new(upb_arena *arena) {
return (envoy_api_v2_cluster_Filter *)upb_msg_new(&envoy_api_v2_cluster_Filter_msginit, arena);
}
UPB_INLINE envoy_api_v2_cluster_Filter *envoy_api_v2_cluster_Filter_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_api_v2_cluster_Filter *ret = envoy_api_v2_cluster_Filter_new(arena);
return (ret && upb_decode(buf, size, ret, &envoy_api_v2_cluster_Filter_msginit, arena)) ? ret : NULL;
}
UPB_INLINE char *envoy_api_v2_cluster_Filter_serialize(const envoy_api_v2_cluster_Filter *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_api_v2_cluster_Filter_msginit, arena, len);
}
UPB_INLINE upb_strview envoy_api_v2_cluster_Filter_name(const envoy_api_v2_cluster_Filter *msg) { return UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(0, 0)); }
UPB_INLINE const struct google_protobuf_Any* envoy_api_v2_cluster_Filter_typed_config(const envoy_api_v2_cluster_Filter *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_Any*, UPB_SIZE(8, 16)); }
UPB_INLINE void envoy_api_v2_cluster_Filter_set_name(envoy_api_v2_cluster_Filter *msg, upb_strview value) {
UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(0, 0)) = value;
}
UPB_INLINE void envoy_api_v2_cluster_Filter_set_typed_config(envoy_api_v2_cluster_Filter *msg, struct google_protobuf_Any* value) {
UPB_FIELD_AT(msg, struct google_protobuf_Any*, UPB_SIZE(8, 16)) = value;
}
UPB_INLINE struct google_protobuf_Any* envoy_api_v2_cluster_Filter_mutable_typed_config(envoy_api_v2_cluster_Filter *msg, upb_arena *arena) {
struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_api_v2_cluster_Filter_typed_config(msg);
if (sub == NULL) {
sub = (struct google_protobuf_Any*)upb_msg_new(&google_protobuf_Any_msginit, arena);
if (!sub) return NULL;
envoy_api_v2_cluster_Filter_set_typed_config(msg, sub);
}
return sub;
}
#ifdef __cplusplus
} /* extern "C" */
#endif
#include "upb/port_undef.inc"
#endif /* ENVOY_API_V2_CLUSTER_FILTER_PROTO_UPB_H_ */

@ -16,29 +16,33 @@
#include "upb/port_def.inc"
static const upb_msglayout *const envoy_api_v2_cluster_OutlierDetection_submsgs[11] = {
static const upb_msglayout *const envoy_api_v2_cluster_OutlierDetection_submsgs[14] = {
&google_protobuf_Duration_msginit,
&google_protobuf_UInt32Value_msginit,
};
static const upb_msglayout_field envoy_api_v2_cluster_OutlierDetection__fields[11] = {
{1, UPB_SIZE(0, 0), 0, 1, 11, 1},
{2, UPB_SIZE(4, 8), 0, 0, 11, 1},
{3, UPB_SIZE(8, 16), 0, 0, 11, 1},
{4, UPB_SIZE(12, 24), 0, 1, 11, 1},
{5, UPB_SIZE(16, 32), 0, 1, 11, 1},
{6, UPB_SIZE(20, 40), 0, 1, 11, 1},
{7, UPB_SIZE(24, 48), 0, 1, 11, 1},
{8, UPB_SIZE(28, 56), 0, 1, 11, 1},
{9, UPB_SIZE(32, 64), 0, 1, 11, 1},
{10, UPB_SIZE(36, 72), 0, 1, 11, 1},
{11, UPB_SIZE(40, 80), 0, 1, 11, 1},
static const upb_msglayout_field envoy_api_v2_cluster_OutlierDetection__fields[15] = {
{1, UPB_SIZE(4, 8), 0, 1, 11, 1},
{2, UPB_SIZE(8, 16), 0, 0, 11, 1},
{3, UPB_SIZE(12, 24), 0, 0, 11, 1},
{4, UPB_SIZE(16, 32), 0, 1, 11, 1},
{5, UPB_SIZE(20, 40), 0, 1, 11, 1},
{6, UPB_SIZE(24, 48), 0, 1, 11, 1},
{7, UPB_SIZE(28, 56), 0, 1, 11, 1},
{8, UPB_SIZE(32, 64), 0, 1, 11, 1},
{9, UPB_SIZE(36, 72), 0, 1, 11, 1},
{10, UPB_SIZE(40, 80), 0, 1, 11, 1},
{11, UPB_SIZE(44, 88), 0, 1, 11, 1},
{12, UPB_SIZE(0, 0), 0, 0, 8, 1},
{13, UPB_SIZE(48, 96), 0, 1, 11, 1},
{14, UPB_SIZE(52, 104), 0, 1, 11, 1},
{15, UPB_SIZE(56, 112), 0, 1, 11, 1},
};
const upb_msglayout envoy_api_v2_cluster_OutlierDetection_msginit = {
&envoy_api_v2_cluster_OutlierDetection_submsgs[0],
&envoy_api_v2_cluster_OutlierDetection__fields[0],
UPB_SIZE(44, 88), 11, false,
UPB_SIZE(60, 120), 15, false,
};
#include "upb/port_undef.inc"

@ -43,20 +43,24 @@ UPB_INLINE char *envoy_api_v2_cluster_OutlierDetection_serialize(const envoy_api
return upb_encode(msg, &envoy_api_v2_cluster_OutlierDetection_msginit, arena, len);
}
UPB_INLINE const struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetection_consecutive_5xx(const envoy_api_v2_cluster_OutlierDetection *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_UInt32Value*, UPB_SIZE(0, 0)); }
UPB_INLINE const struct google_protobuf_Duration* envoy_api_v2_cluster_OutlierDetection_interval(const envoy_api_v2_cluster_OutlierDetection *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_Duration*, UPB_SIZE(4, 8)); }
UPB_INLINE const struct google_protobuf_Duration* envoy_api_v2_cluster_OutlierDetection_base_ejection_time(const envoy_api_v2_cluster_OutlierDetection *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_Duration*, UPB_SIZE(8, 16)); }
UPB_INLINE const struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetection_max_ejection_percent(const envoy_api_v2_cluster_OutlierDetection *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_UInt32Value*, UPB_SIZE(12, 24)); }
UPB_INLINE const struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetection_enforcing_consecutive_5xx(const envoy_api_v2_cluster_OutlierDetection *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_UInt32Value*, UPB_SIZE(16, 32)); }
UPB_INLINE const struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetection_enforcing_success_rate(const envoy_api_v2_cluster_OutlierDetection *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_UInt32Value*, UPB_SIZE(20, 40)); }
UPB_INLINE const struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetection_success_rate_minimum_hosts(const envoy_api_v2_cluster_OutlierDetection *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_UInt32Value*, UPB_SIZE(24, 48)); }
UPB_INLINE const struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetection_success_rate_request_volume(const envoy_api_v2_cluster_OutlierDetection *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_UInt32Value*, UPB_SIZE(28, 56)); }
UPB_INLINE const struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetection_success_rate_stdev_factor(const envoy_api_v2_cluster_OutlierDetection *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_UInt32Value*, UPB_SIZE(32, 64)); }
UPB_INLINE const struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetection_consecutive_gateway_failure(const envoy_api_v2_cluster_OutlierDetection *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_UInt32Value*, UPB_SIZE(36, 72)); }
UPB_INLINE const struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetection_enforcing_consecutive_gateway_failure(const envoy_api_v2_cluster_OutlierDetection *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_UInt32Value*, UPB_SIZE(40, 80)); }
UPB_INLINE const struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetection_consecutive_5xx(const envoy_api_v2_cluster_OutlierDetection *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_UInt32Value*, UPB_SIZE(4, 8)); }
UPB_INLINE const struct google_protobuf_Duration* envoy_api_v2_cluster_OutlierDetection_interval(const envoy_api_v2_cluster_OutlierDetection *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_Duration*, UPB_SIZE(8, 16)); }
UPB_INLINE const struct google_protobuf_Duration* envoy_api_v2_cluster_OutlierDetection_base_ejection_time(const envoy_api_v2_cluster_OutlierDetection *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_Duration*, UPB_SIZE(12, 24)); }
UPB_INLINE const struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetection_max_ejection_percent(const envoy_api_v2_cluster_OutlierDetection *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_UInt32Value*, UPB_SIZE(16, 32)); }
UPB_INLINE const struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetection_enforcing_consecutive_5xx(const envoy_api_v2_cluster_OutlierDetection *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_UInt32Value*, UPB_SIZE(20, 40)); }
UPB_INLINE const struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetection_enforcing_success_rate(const envoy_api_v2_cluster_OutlierDetection *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_UInt32Value*, UPB_SIZE(24, 48)); }
UPB_INLINE const struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetection_success_rate_minimum_hosts(const envoy_api_v2_cluster_OutlierDetection *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_UInt32Value*, UPB_SIZE(28, 56)); }
UPB_INLINE const struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetection_success_rate_request_volume(const envoy_api_v2_cluster_OutlierDetection *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_UInt32Value*, UPB_SIZE(32, 64)); }
UPB_INLINE const struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetection_success_rate_stdev_factor(const envoy_api_v2_cluster_OutlierDetection *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_UInt32Value*, UPB_SIZE(36, 72)); }
UPB_INLINE const struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetection_consecutive_gateway_failure(const envoy_api_v2_cluster_OutlierDetection *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_UInt32Value*, UPB_SIZE(40, 80)); }
UPB_INLINE const struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetection_enforcing_consecutive_gateway_failure(const envoy_api_v2_cluster_OutlierDetection *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_UInt32Value*, UPB_SIZE(44, 88)); }
UPB_INLINE bool envoy_api_v2_cluster_OutlierDetection_split_external_local_origin_errors(const envoy_api_v2_cluster_OutlierDetection *msg) { return UPB_FIELD_AT(msg, bool, UPB_SIZE(0, 0)); }
UPB_INLINE const struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetection_consecutive_local_origin_failure(const envoy_api_v2_cluster_OutlierDetection *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_UInt32Value*, UPB_SIZE(48, 96)); }
UPB_INLINE const struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetection_enforcing_consecutive_local_origin_failure(const envoy_api_v2_cluster_OutlierDetection *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_UInt32Value*, UPB_SIZE(52, 104)); }
UPB_INLINE const struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetection_enforcing_local_origin_success_rate(const envoy_api_v2_cluster_OutlierDetection *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_UInt32Value*, UPB_SIZE(56, 112)); }
UPB_INLINE void envoy_api_v2_cluster_OutlierDetection_set_consecutive_5xx(envoy_api_v2_cluster_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) {
UPB_FIELD_AT(msg, struct google_protobuf_UInt32Value*, UPB_SIZE(0, 0)) = value;
UPB_FIELD_AT(msg, struct google_protobuf_UInt32Value*, UPB_SIZE(4, 8)) = value;
}
UPB_INLINE struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetection_mutable_consecutive_5xx(envoy_api_v2_cluster_OutlierDetection *msg, upb_arena *arena) {
struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_api_v2_cluster_OutlierDetection_consecutive_5xx(msg);
@ -68,7 +72,7 @@ UPB_INLINE struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetec
return sub;
}
UPB_INLINE void envoy_api_v2_cluster_OutlierDetection_set_interval(envoy_api_v2_cluster_OutlierDetection *msg, struct google_protobuf_Duration* value) {
UPB_FIELD_AT(msg, struct google_protobuf_Duration*, UPB_SIZE(4, 8)) = value;
UPB_FIELD_AT(msg, struct google_protobuf_Duration*, UPB_SIZE(8, 16)) = value;
}
UPB_INLINE struct google_protobuf_Duration* envoy_api_v2_cluster_OutlierDetection_mutable_interval(envoy_api_v2_cluster_OutlierDetection *msg, upb_arena *arena) {
struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_api_v2_cluster_OutlierDetection_interval(msg);
@ -80,7 +84,7 @@ UPB_INLINE struct google_protobuf_Duration* envoy_api_v2_cluster_OutlierDetectio
return sub;
}
UPB_INLINE void envoy_api_v2_cluster_OutlierDetection_set_base_ejection_time(envoy_api_v2_cluster_OutlierDetection *msg, struct google_protobuf_Duration* value) {
UPB_FIELD_AT(msg, struct google_protobuf_Duration*, UPB_SIZE(8, 16)) = value;
UPB_FIELD_AT(msg, struct google_protobuf_Duration*, UPB_SIZE(12, 24)) = value;
}
UPB_INLINE struct google_protobuf_Duration* envoy_api_v2_cluster_OutlierDetection_mutable_base_ejection_time(envoy_api_v2_cluster_OutlierDetection *msg, upb_arena *arena) {
struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_api_v2_cluster_OutlierDetection_base_ejection_time(msg);
@ -92,7 +96,7 @@ UPB_INLINE struct google_protobuf_Duration* envoy_api_v2_cluster_OutlierDetectio
return sub;
}
UPB_INLINE void envoy_api_v2_cluster_OutlierDetection_set_max_ejection_percent(envoy_api_v2_cluster_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) {
UPB_FIELD_AT(msg, struct google_protobuf_UInt32Value*, UPB_SIZE(12, 24)) = value;
UPB_FIELD_AT(msg, struct google_protobuf_UInt32Value*, UPB_SIZE(16, 32)) = value;
}
UPB_INLINE struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetection_mutable_max_ejection_percent(envoy_api_v2_cluster_OutlierDetection *msg, upb_arena *arena) {
struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_api_v2_cluster_OutlierDetection_max_ejection_percent(msg);
@ -104,7 +108,7 @@ UPB_INLINE struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetec
return sub;
}
UPB_INLINE void envoy_api_v2_cluster_OutlierDetection_set_enforcing_consecutive_5xx(envoy_api_v2_cluster_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) {
UPB_FIELD_AT(msg, struct google_protobuf_UInt32Value*, UPB_SIZE(16, 32)) = value;
UPB_FIELD_AT(msg, struct google_protobuf_UInt32Value*, UPB_SIZE(20, 40)) = value;
}
UPB_INLINE struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetection_mutable_enforcing_consecutive_5xx(envoy_api_v2_cluster_OutlierDetection *msg, upb_arena *arena) {
struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_api_v2_cluster_OutlierDetection_enforcing_consecutive_5xx(msg);
@ -116,7 +120,7 @@ UPB_INLINE struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetec
return sub;
}
UPB_INLINE void envoy_api_v2_cluster_OutlierDetection_set_enforcing_success_rate(envoy_api_v2_cluster_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) {
UPB_FIELD_AT(msg, struct google_protobuf_UInt32Value*, UPB_SIZE(20, 40)) = value;
UPB_FIELD_AT(msg, struct google_protobuf_UInt32Value*, UPB_SIZE(24, 48)) = value;
}
UPB_INLINE struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetection_mutable_enforcing_success_rate(envoy_api_v2_cluster_OutlierDetection *msg, upb_arena *arena) {
struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_api_v2_cluster_OutlierDetection_enforcing_success_rate(msg);
@ -128,7 +132,7 @@ UPB_INLINE struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetec
return sub;
}
UPB_INLINE void envoy_api_v2_cluster_OutlierDetection_set_success_rate_minimum_hosts(envoy_api_v2_cluster_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) {
UPB_FIELD_AT(msg, struct google_protobuf_UInt32Value*, UPB_SIZE(24, 48)) = value;
UPB_FIELD_AT(msg, struct google_protobuf_UInt32Value*, UPB_SIZE(28, 56)) = value;
}
UPB_INLINE struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetection_mutable_success_rate_minimum_hosts(envoy_api_v2_cluster_OutlierDetection *msg, upb_arena *arena) {
struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_api_v2_cluster_OutlierDetection_success_rate_minimum_hosts(msg);
@ -140,7 +144,7 @@ UPB_INLINE struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetec
return sub;
}
UPB_INLINE void envoy_api_v2_cluster_OutlierDetection_set_success_rate_request_volume(envoy_api_v2_cluster_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) {
UPB_FIELD_AT(msg, struct google_protobuf_UInt32Value*, UPB_SIZE(28, 56)) = value;
UPB_FIELD_AT(msg, struct google_protobuf_UInt32Value*, UPB_SIZE(32, 64)) = value;
}
UPB_INLINE struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetection_mutable_success_rate_request_volume(envoy_api_v2_cluster_OutlierDetection *msg, upb_arena *arena) {
struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_api_v2_cluster_OutlierDetection_success_rate_request_volume(msg);
@ -152,7 +156,7 @@ UPB_INLINE struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetec
return sub;
}
UPB_INLINE void envoy_api_v2_cluster_OutlierDetection_set_success_rate_stdev_factor(envoy_api_v2_cluster_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) {
UPB_FIELD_AT(msg, struct google_protobuf_UInt32Value*, UPB_SIZE(32, 64)) = value;
UPB_FIELD_AT(msg, struct google_protobuf_UInt32Value*, UPB_SIZE(36, 72)) = value;
}
UPB_INLINE struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetection_mutable_success_rate_stdev_factor(envoy_api_v2_cluster_OutlierDetection *msg, upb_arena *arena) {
struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_api_v2_cluster_OutlierDetection_success_rate_stdev_factor(msg);
@ -164,7 +168,7 @@ UPB_INLINE struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetec
return sub;
}
UPB_INLINE void envoy_api_v2_cluster_OutlierDetection_set_consecutive_gateway_failure(envoy_api_v2_cluster_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) {
UPB_FIELD_AT(msg, struct google_protobuf_UInt32Value*, UPB_SIZE(36, 72)) = value;
UPB_FIELD_AT(msg, struct google_protobuf_UInt32Value*, UPB_SIZE(40, 80)) = value;
}
UPB_INLINE struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetection_mutable_consecutive_gateway_failure(envoy_api_v2_cluster_OutlierDetection *msg, upb_arena *arena) {
struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_api_v2_cluster_OutlierDetection_consecutive_gateway_failure(msg);
@ -176,7 +180,7 @@ UPB_INLINE struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetec
return sub;
}
UPB_INLINE void envoy_api_v2_cluster_OutlierDetection_set_enforcing_consecutive_gateway_failure(envoy_api_v2_cluster_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) {
UPB_FIELD_AT(msg, struct google_protobuf_UInt32Value*, UPB_SIZE(40, 80)) = value;
UPB_FIELD_AT(msg, struct google_protobuf_UInt32Value*, UPB_SIZE(44, 88)) = value;
}
UPB_INLINE struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetection_mutable_enforcing_consecutive_gateway_failure(envoy_api_v2_cluster_OutlierDetection *msg, upb_arena *arena) {
struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_api_v2_cluster_OutlierDetection_enforcing_consecutive_gateway_failure(msg);
@ -187,6 +191,45 @@ UPB_INLINE struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetec
}
return sub;
}
UPB_INLINE void envoy_api_v2_cluster_OutlierDetection_set_split_external_local_origin_errors(envoy_api_v2_cluster_OutlierDetection *msg, bool value) {
UPB_FIELD_AT(msg, bool, UPB_SIZE(0, 0)) = value;
}
UPB_INLINE void envoy_api_v2_cluster_OutlierDetection_set_consecutive_local_origin_failure(envoy_api_v2_cluster_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) {
UPB_FIELD_AT(msg, struct google_protobuf_UInt32Value*, UPB_SIZE(48, 96)) = value;
}
UPB_INLINE struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetection_mutable_consecutive_local_origin_failure(envoy_api_v2_cluster_OutlierDetection *msg, upb_arena *arena) {
struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_api_v2_cluster_OutlierDetection_consecutive_local_origin_failure(msg);
if (sub == NULL) {
sub = (struct google_protobuf_UInt32Value*)upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
if (!sub) return NULL;
envoy_api_v2_cluster_OutlierDetection_set_consecutive_local_origin_failure(msg, sub);
}
return sub;
}
UPB_INLINE void envoy_api_v2_cluster_OutlierDetection_set_enforcing_consecutive_local_origin_failure(envoy_api_v2_cluster_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) {
UPB_FIELD_AT(msg, struct google_protobuf_UInt32Value*, UPB_SIZE(52, 104)) = value;
}
UPB_INLINE struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetection_mutable_enforcing_consecutive_local_origin_failure(envoy_api_v2_cluster_OutlierDetection *msg, upb_arena *arena) {
struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_api_v2_cluster_OutlierDetection_enforcing_consecutive_local_origin_failure(msg);
if (sub == NULL) {
sub = (struct google_protobuf_UInt32Value*)upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
if (!sub) return NULL;
envoy_api_v2_cluster_OutlierDetection_set_enforcing_consecutive_local_origin_failure(msg, sub);
}
return sub;
}
UPB_INLINE void envoy_api_v2_cluster_OutlierDetection_set_enforcing_local_origin_success_rate(envoy_api_v2_cluster_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) {
UPB_FIELD_AT(msg, struct google_protobuf_UInt32Value*, UPB_SIZE(56, 112)) = value;
}
UPB_INLINE struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetection_mutable_enforcing_local_origin_success_rate(envoy_api_v2_cluster_OutlierDetection *msg, upb_arena *arena) {
struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_api_v2_cluster_OutlierDetection_enforcing_local_origin_success_rate(msg);
if (sub == NULL) {
sub = (struct google_protobuf_UInt32Value*)upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
if (!sub) return NULL;
envoy_api_v2_cluster_OutlierDetection_set_enforcing_local_origin_success_rate(msg, sub);
}
return sub;
}
#ifdef __cplusplus
} /* extern "C" */

@ -9,6 +9,7 @@
#include <stddef.h>
#include "upb/msg.h"
#include "envoy/api/v2/core/base.upb.h"
#include "envoy/api/v2/core/http_uri.upb.h"
#include "google/protobuf/any.upb.h"
#include "google/protobuf/struct.upb.h"
#include "google/protobuf/wrappers.upb.h"
@ -142,6 +143,37 @@ const upb_msglayout envoy_api_v2_core_DataSource_msginit = {
UPB_SIZE(16, 32), 3, false,
};
static const upb_msglayout *const envoy_api_v2_core_RemoteDataSource_submsgs[1] = {
&envoy_api_v2_core_HttpUri_msginit,
};
static const upb_msglayout_field envoy_api_v2_core_RemoteDataSource__fields[2] = {
{1, UPB_SIZE(8, 16), 0, 0, 11, 1},
{2, UPB_SIZE(0, 0), 0, 0, 9, 1},
};
const upb_msglayout envoy_api_v2_core_RemoteDataSource_msginit = {
&envoy_api_v2_core_RemoteDataSource_submsgs[0],
&envoy_api_v2_core_RemoteDataSource__fields[0],
UPB_SIZE(16, 32), 2, false,
};
static const upb_msglayout *const envoy_api_v2_core_AsyncDataSource_submsgs[2] = {
&envoy_api_v2_core_DataSource_msginit,
&envoy_api_v2_core_RemoteDataSource_msginit,
};
static const upb_msglayout_field envoy_api_v2_core_AsyncDataSource__fields[2] = {
{1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
{2, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 1, 11, 1},
};
const upb_msglayout envoy_api_v2_core_AsyncDataSource_msginit = {
&envoy_api_v2_core_AsyncDataSource_submsgs[0],
&envoy_api_v2_core_AsyncDataSource__fields[0],
UPB_SIZE(8, 16), 2, false,
};
static const upb_msglayout *const envoy_api_v2_core_TransportSocket_submsgs[2] = {
&google_protobuf_Any_msginit,
&google_protobuf_Struct_msginit,

@ -29,6 +29,8 @@ struct envoy_api_v2_core_HeaderValue;
struct envoy_api_v2_core_HeaderValueOption;
struct envoy_api_v2_core_HeaderMap;
struct envoy_api_v2_core_DataSource;
struct envoy_api_v2_core_RemoteDataSource;
struct envoy_api_v2_core_AsyncDataSource;
struct envoy_api_v2_core_TransportSocket;
struct envoy_api_v2_core_SocketOption;
struct envoy_api_v2_core_RuntimeFractionalPercent;
@ -42,6 +44,8 @@ typedef struct envoy_api_v2_core_HeaderValue envoy_api_v2_core_HeaderValue;
typedef struct envoy_api_v2_core_HeaderValueOption envoy_api_v2_core_HeaderValueOption;
typedef struct envoy_api_v2_core_HeaderMap envoy_api_v2_core_HeaderMap;
typedef struct envoy_api_v2_core_DataSource envoy_api_v2_core_DataSource;
typedef struct envoy_api_v2_core_RemoteDataSource envoy_api_v2_core_RemoteDataSource;
typedef struct envoy_api_v2_core_AsyncDataSource envoy_api_v2_core_AsyncDataSource;
typedef struct envoy_api_v2_core_TransportSocket envoy_api_v2_core_TransportSocket;
typedef struct envoy_api_v2_core_SocketOption envoy_api_v2_core_SocketOption;
typedef struct envoy_api_v2_core_RuntimeFractionalPercent envoy_api_v2_core_RuntimeFractionalPercent;
@ -55,14 +59,18 @@ extern const upb_msglayout envoy_api_v2_core_HeaderValue_msginit;
extern const upb_msglayout envoy_api_v2_core_HeaderValueOption_msginit;
extern const upb_msglayout envoy_api_v2_core_HeaderMap_msginit;
extern const upb_msglayout envoy_api_v2_core_DataSource_msginit;
extern const upb_msglayout envoy_api_v2_core_RemoteDataSource_msginit;
extern const upb_msglayout envoy_api_v2_core_AsyncDataSource_msginit;
extern const upb_msglayout envoy_api_v2_core_TransportSocket_msginit;
extern const upb_msglayout envoy_api_v2_core_SocketOption_msginit;
extern const upb_msglayout envoy_api_v2_core_RuntimeFractionalPercent_msginit;
extern const upb_msglayout envoy_api_v2_core_ControlPlane_msginit;
struct envoy_api_v2_core_HttpUri;
struct envoy_type_FractionalPercent;
struct google_protobuf_Any;
struct google_protobuf_BoolValue;
struct google_protobuf_Struct;
extern const upb_msglayout envoy_api_v2_core_HttpUri_msginit;
extern const upb_msglayout envoy_type_FractionalPercent_msginit;
extern const upb_msglayout google_protobuf_Any_msginit;
extern const upb_msglayout google_protobuf_BoolValue_msginit;
@ -92,6 +100,12 @@ typedef enum {
envoy_api_v2_core_SocketOption_STATE_LISTENING = 2
} envoy_api_v2_core_SocketOption_SocketState;
typedef enum {
envoy_api_v2_core_UNSPECIFIED = 0,
envoy_api_v2_core_INBOUND = 1,
envoy_api_v2_core_OUTBOUND = 2
} envoy_api_v2_core_TrafficDirection;
/* envoy.api.v2.core.Locality */
@ -397,6 +411,90 @@ UPB_INLINE void envoy_api_v2_core_DataSource_set_inline_string(envoy_api_v2_core
UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 3);
}
/* envoy.api.v2.core.RemoteDataSource */
UPB_INLINE envoy_api_v2_core_RemoteDataSource *envoy_api_v2_core_RemoteDataSource_new(upb_arena *arena) {
return (envoy_api_v2_core_RemoteDataSource *)upb_msg_new(&envoy_api_v2_core_RemoteDataSource_msginit, arena);
}
UPB_INLINE envoy_api_v2_core_RemoteDataSource *envoy_api_v2_core_RemoteDataSource_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_api_v2_core_RemoteDataSource *ret = envoy_api_v2_core_RemoteDataSource_new(arena);
return (ret && upb_decode(buf, size, ret, &envoy_api_v2_core_RemoteDataSource_msginit, arena)) ? ret : NULL;
}
UPB_INLINE char *envoy_api_v2_core_RemoteDataSource_serialize(const envoy_api_v2_core_RemoteDataSource *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_api_v2_core_RemoteDataSource_msginit, arena, len);
}
UPB_INLINE const struct envoy_api_v2_core_HttpUri* envoy_api_v2_core_RemoteDataSource_http_uri(const envoy_api_v2_core_RemoteDataSource *msg) { return UPB_FIELD_AT(msg, const struct envoy_api_v2_core_HttpUri*, UPB_SIZE(8, 16)); }
UPB_INLINE upb_strview envoy_api_v2_core_RemoteDataSource_sha256(const envoy_api_v2_core_RemoteDataSource *msg) { return UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(0, 0)); }
UPB_INLINE void envoy_api_v2_core_RemoteDataSource_set_http_uri(envoy_api_v2_core_RemoteDataSource *msg, struct envoy_api_v2_core_HttpUri* value) {
UPB_FIELD_AT(msg, struct envoy_api_v2_core_HttpUri*, UPB_SIZE(8, 16)) = value;
}
UPB_INLINE struct envoy_api_v2_core_HttpUri* envoy_api_v2_core_RemoteDataSource_mutable_http_uri(envoy_api_v2_core_RemoteDataSource *msg, upb_arena *arena) {
struct envoy_api_v2_core_HttpUri* sub = (struct envoy_api_v2_core_HttpUri*)envoy_api_v2_core_RemoteDataSource_http_uri(msg);
if (sub == NULL) {
sub = (struct envoy_api_v2_core_HttpUri*)upb_msg_new(&envoy_api_v2_core_HttpUri_msginit, arena);
if (!sub) return NULL;
envoy_api_v2_core_RemoteDataSource_set_http_uri(msg, sub);
}
return sub;
}
UPB_INLINE void envoy_api_v2_core_RemoteDataSource_set_sha256(envoy_api_v2_core_RemoteDataSource *msg, upb_strview value) {
UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(0, 0)) = value;
}
/* envoy.api.v2.core.AsyncDataSource */
UPB_INLINE envoy_api_v2_core_AsyncDataSource *envoy_api_v2_core_AsyncDataSource_new(upb_arena *arena) {
return (envoy_api_v2_core_AsyncDataSource *)upb_msg_new(&envoy_api_v2_core_AsyncDataSource_msginit, arena);
}
UPB_INLINE envoy_api_v2_core_AsyncDataSource *envoy_api_v2_core_AsyncDataSource_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_api_v2_core_AsyncDataSource *ret = envoy_api_v2_core_AsyncDataSource_new(arena);
return (ret && upb_decode(buf, size, ret, &envoy_api_v2_core_AsyncDataSource_msginit, arena)) ? ret : NULL;
}
UPB_INLINE char *envoy_api_v2_core_AsyncDataSource_serialize(const envoy_api_v2_core_AsyncDataSource *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_api_v2_core_AsyncDataSource_msginit, arena, len);
}
typedef enum {
envoy_api_v2_core_AsyncDataSource_specifier_local = 1,
envoy_api_v2_core_AsyncDataSource_specifier_remote = 2,
envoy_api_v2_core_AsyncDataSource_specifier_NOT_SET = 0
} envoy_api_v2_core_AsyncDataSource_specifier_oneofcases;
UPB_INLINE envoy_api_v2_core_AsyncDataSource_specifier_oneofcases envoy_api_v2_core_AsyncDataSource_specifier_case(const envoy_api_v2_core_AsyncDataSource* msg) { return (envoy_api_v2_core_AsyncDataSource_specifier_oneofcases)UPB_FIELD_AT(msg, int32_t, UPB_SIZE(4, 8)); }
UPB_INLINE bool envoy_api_v2_core_AsyncDataSource_has_local(const envoy_api_v2_core_AsyncDataSource *msg) { return _upb_has_oneof_field(msg, UPB_SIZE(4, 8), 1); }
UPB_INLINE const envoy_api_v2_core_DataSource* envoy_api_v2_core_AsyncDataSource_local(const envoy_api_v2_core_AsyncDataSource *msg) { return UPB_READ_ONEOF(msg, const envoy_api_v2_core_DataSource*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 1, NULL); }
UPB_INLINE bool envoy_api_v2_core_AsyncDataSource_has_remote(const envoy_api_v2_core_AsyncDataSource *msg) { return _upb_has_oneof_field(msg, UPB_SIZE(4, 8), 2); }
UPB_INLINE const envoy_api_v2_core_RemoteDataSource* envoy_api_v2_core_AsyncDataSource_remote(const envoy_api_v2_core_AsyncDataSource *msg) { return UPB_READ_ONEOF(msg, const envoy_api_v2_core_RemoteDataSource*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 2, NULL); }
UPB_INLINE void envoy_api_v2_core_AsyncDataSource_set_local(envoy_api_v2_core_AsyncDataSource *msg, envoy_api_v2_core_DataSource* value) {
UPB_WRITE_ONEOF(msg, envoy_api_v2_core_DataSource*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 1);
}
UPB_INLINE struct envoy_api_v2_core_DataSource* envoy_api_v2_core_AsyncDataSource_mutable_local(envoy_api_v2_core_AsyncDataSource *msg, upb_arena *arena) {
struct envoy_api_v2_core_DataSource* sub = (struct envoy_api_v2_core_DataSource*)envoy_api_v2_core_AsyncDataSource_local(msg);
if (sub == NULL) {
sub = (struct envoy_api_v2_core_DataSource*)upb_msg_new(&envoy_api_v2_core_DataSource_msginit, arena);
if (!sub) return NULL;
envoy_api_v2_core_AsyncDataSource_set_local(msg, sub);
}
return sub;
}
UPB_INLINE void envoy_api_v2_core_AsyncDataSource_set_remote(envoy_api_v2_core_AsyncDataSource *msg, envoy_api_v2_core_RemoteDataSource* value) {
UPB_WRITE_ONEOF(msg, envoy_api_v2_core_RemoteDataSource*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 2);
}
UPB_INLINE struct envoy_api_v2_core_RemoteDataSource* envoy_api_v2_core_AsyncDataSource_mutable_remote(envoy_api_v2_core_AsyncDataSource *msg, upb_arena *arena) {
struct envoy_api_v2_core_RemoteDataSource* sub = (struct envoy_api_v2_core_RemoteDataSource*)envoy_api_v2_core_AsyncDataSource_remote(msg);
if (sub == NULL) {
sub = (struct envoy_api_v2_core_RemoteDataSource*)upb_msg_new(&envoy_api_v2_core_RemoteDataSource_msginit, arena);
if (!sub) return NULL;
envoy_api_v2_core_AsyncDataSource_set_remote(msg, sub);
}
return sub;
}
/* envoy.api.v2.core.TransportSocket */
UPB_INLINE envoy_api_v2_core_TransportSocket *envoy_api_v2_core_TransportSocket_new(upb_arena *arena) {

@ -23,19 +23,20 @@ static const upb_msglayout *const envoy_api_v2_core_ApiConfigSource_submsgs[4] =
&google_protobuf_Duration_msginit,
};
static const upb_msglayout_field envoy_api_v2_core_ApiConfigSource__fields[6] = {
static const upb_msglayout_field envoy_api_v2_core_ApiConfigSource__fields[7] = {
{1, UPB_SIZE(0, 0), 0, 0, 14, 1},
{2, UPB_SIZE(20, 32), 0, 0, 9, 3},
{3, UPB_SIZE(8, 8), 0, 2, 11, 1},
{4, UPB_SIZE(24, 40), 0, 0, 11, 3},
{5, UPB_SIZE(12, 16), 0, 2, 11, 1},
{6, UPB_SIZE(16, 24), 0, 1, 11, 1},
{2, UPB_SIZE(24, 40), 0, 0, 9, 3},
{3, UPB_SIZE(12, 16), 0, 2, 11, 1},
{4, UPB_SIZE(28, 48), 0, 0, 11, 3},
{5, UPB_SIZE(16, 24), 0, 2, 11, 1},
{6, UPB_SIZE(20, 32), 0, 1, 11, 1},
{7, UPB_SIZE(8, 8), 0, 0, 8, 1},
};
const upb_msglayout envoy_api_v2_core_ApiConfigSource_msginit = {
&envoy_api_v2_core_ApiConfigSource_submsgs[0],
&envoy_api_v2_core_ApiConfigSource__fields[0],
UPB_SIZE(32, 48), 6, false,
UPB_SIZE(32, 56), 7, false,
};
const upb_msglayout envoy_api_v2_core_AggregatedConfigSource_msginit = {

@ -64,27 +64,28 @@ UPB_INLINE char *envoy_api_v2_core_ApiConfigSource_serialize(const envoy_api_v2_
}
UPB_INLINE int32_t envoy_api_v2_core_ApiConfigSource_api_type(const envoy_api_v2_core_ApiConfigSource *msg) { return UPB_FIELD_AT(msg, int32_t, UPB_SIZE(0, 0)); }
UPB_INLINE upb_strview const* envoy_api_v2_core_ApiConfigSource_cluster_names(const envoy_api_v2_core_ApiConfigSource *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(20, 32), len); }
UPB_INLINE const struct google_protobuf_Duration* envoy_api_v2_core_ApiConfigSource_refresh_delay(const envoy_api_v2_core_ApiConfigSource *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_Duration*, UPB_SIZE(8, 8)); }
UPB_INLINE const struct envoy_api_v2_core_GrpcService* const* envoy_api_v2_core_ApiConfigSource_grpc_services(const envoy_api_v2_core_ApiConfigSource *msg, size_t *len) { return (const struct envoy_api_v2_core_GrpcService* const*)_upb_array_accessor(msg, UPB_SIZE(24, 40), len); }
UPB_INLINE const struct google_protobuf_Duration* envoy_api_v2_core_ApiConfigSource_request_timeout(const envoy_api_v2_core_ApiConfigSource *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_Duration*, UPB_SIZE(12, 16)); }
UPB_INLINE const envoy_api_v2_core_RateLimitSettings* envoy_api_v2_core_ApiConfigSource_rate_limit_settings(const envoy_api_v2_core_ApiConfigSource *msg) { return UPB_FIELD_AT(msg, const envoy_api_v2_core_RateLimitSettings*, UPB_SIZE(16, 24)); }
UPB_INLINE upb_strview const* envoy_api_v2_core_ApiConfigSource_cluster_names(const envoy_api_v2_core_ApiConfigSource *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(24, 40), len); }
UPB_INLINE const struct google_protobuf_Duration* envoy_api_v2_core_ApiConfigSource_refresh_delay(const envoy_api_v2_core_ApiConfigSource *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_Duration*, UPB_SIZE(12, 16)); }
UPB_INLINE const struct envoy_api_v2_core_GrpcService* const* envoy_api_v2_core_ApiConfigSource_grpc_services(const envoy_api_v2_core_ApiConfigSource *msg, size_t *len) { return (const struct envoy_api_v2_core_GrpcService* const*)_upb_array_accessor(msg, UPB_SIZE(28, 48), len); }
UPB_INLINE const struct google_protobuf_Duration* envoy_api_v2_core_ApiConfigSource_request_timeout(const envoy_api_v2_core_ApiConfigSource *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_Duration*, UPB_SIZE(16, 24)); }
UPB_INLINE const envoy_api_v2_core_RateLimitSettings* envoy_api_v2_core_ApiConfigSource_rate_limit_settings(const envoy_api_v2_core_ApiConfigSource *msg) { return UPB_FIELD_AT(msg, const envoy_api_v2_core_RateLimitSettings*, UPB_SIZE(20, 32)); }
UPB_INLINE bool envoy_api_v2_core_ApiConfigSource_set_node_on_first_message_only(const envoy_api_v2_core_ApiConfigSource *msg) { return UPB_FIELD_AT(msg, bool, UPB_SIZE(8, 8)); }
UPB_INLINE void envoy_api_v2_core_ApiConfigSource_set_api_type(envoy_api_v2_core_ApiConfigSource *msg, int32_t value) {
UPB_FIELD_AT(msg, int32_t, UPB_SIZE(0, 0)) = value;
}
UPB_INLINE upb_strview* envoy_api_v2_core_ApiConfigSource_mutable_cluster_names(envoy_api_v2_core_ApiConfigSource *msg, size_t *len) {
return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 32), len);
return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 40), len);
}
UPB_INLINE upb_strview* envoy_api_v2_core_ApiConfigSource_resize_cluster_names(envoy_api_v2_core_ApiConfigSource *msg, size_t len, upb_arena *arena) {
return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(20, 32), len, UPB_SIZE(8, 16), UPB_TYPE_STRING, arena);
return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(24, 40), len, UPB_SIZE(8, 16), UPB_TYPE_STRING, arena);
}
UPB_INLINE bool envoy_api_v2_core_ApiConfigSource_add_cluster_names(envoy_api_v2_core_ApiConfigSource *msg, upb_strview val, upb_arena *arena) {
return _upb_array_append_accessor(
msg, UPB_SIZE(20, 32), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val, arena);
msg, UPB_SIZE(24, 40), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val, arena);
}
UPB_INLINE void envoy_api_v2_core_ApiConfigSource_set_refresh_delay(envoy_api_v2_core_ApiConfigSource *msg, struct google_protobuf_Duration* value) {
UPB_FIELD_AT(msg, struct google_protobuf_Duration*, UPB_SIZE(8, 8)) = value;
UPB_FIELD_AT(msg, struct google_protobuf_Duration*, UPB_SIZE(12, 16)) = value;
}
UPB_INLINE struct google_protobuf_Duration* envoy_api_v2_core_ApiConfigSource_mutable_refresh_delay(envoy_api_v2_core_ApiConfigSource *msg, upb_arena *arena) {
struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_api_v2_core_ApiConfigSource_refresh_delay(msg);
@ -96,20 +97,20 @@ UPB_INLINE struct google_protobuf_Duration* envoy_api_v2_core_ApiConfigSource_mu
return sub;
}
UPB_INLINE struct envoy_api_v2_core_GrpcService** envoy_api_v2_core_ApiConfigSource_mutable_grpc_services(envoy_api_v2_core_ApiConfigSource *msg, size_t *len) {
return (struct envoy_api_v2_core_GrpcService**)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 40), len);
return (struct envoy_api_v2_core_GrpcService**)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 48), len);
}
UPB_INLINE struct envoy_api_v2_core_GrpcService** envoy_api_v2_core_ApiConfigSource_resize_grpc_services(envoy_api_v2_core_ApiConfigSource *msg, size_t len, upb_arena *arena) {
return (struct envoy_api_v2_core_GrpcService**)_upb_array_resize_accessor(msg, UPB_SIZE(24, 40), len, UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, arena);
return (struct envoy_api_v2_core_GrpcService**)_upb_array_resize_accessor(msg, UPB_SIZE(28, 48), len, UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, arena);
}
UPB_INLINE struct envoy_api_v2_core_GrpcService* envoy_api_v2_core_ApiConfigSource_add_grpc_services(envoy_api_v2_core_ApiConfigSource *msg, upb_arena *arena) {
struct envoy_api_v2_core_GrpcService* sub = (struct envoy_api_v2_core_GrpcService*)upb_msg_new(&envoy_api_v2_core_GrpcService_msginit, arena);
bool ok = _upb_array_append_accessor(
msg, UPB_SIZE(24, 40), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
msg, UPB_SIZE(28, 48), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
if (!ok) return NULL;
return sub;
}
UPB_INLINE void envoy_api_v2_core_ApiConfigSource_set_request_timeout(envoy_api_v2_core_ApiConfigSource *msg, struct google_protobuf_Duration* value) {
UPB_FIELD_AT(msg, struct google_protobuf_Duration*, UPB_SIZE(12, 16)) = value;
UPB_FIELD_AT(msg, struct google_protobuf_Duration*, UPB_SIZE(16, 24)) = value;
}
UPB_INLINE struct google_protobuf_Duration* envoy_api_v2_core_ApiConfigSource_mutable_request_timeout(envoy_api_v2_core_ApiConfigSource *msg, upb_arena *arena) {
struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_api_v2_core_ApiConfigSource_request_timeout(msg);
@ -121,7 +122,7 @@ UPB_INLINE struct google_protobuf_Duration* envoy_api_v2_core_ApiConfigSource_mu
return sub;
}
UPB_INLINE void envoy_api_v2_core_ApiConfigSource_set_rate_limit_settings(envoy_api_v2_core_ApiConfigSource *msg, envoy_api_v2_core_RateLimitSettings* value) {
UPB_FIELD_AT(msg, envoy_api_v2_core_RateLimitSettings*, UPB_SIZE(16, 24)) = value;
UPB_FIELD_AT(msg, envoy_api_v2_core_RateLimitSettings*, UPB_SIZE(20, 32)) = value;
}
UPB_INLINE struct envoy_api_v2_core_RateLimitSettings* envoy_api_v2_core_ApiConfigSource_mutable_rate_limit_settings(envoy_api_v2_core_ApiConfigSource *msg, upb_arena *arena) {
struct envoy_api_v2_core_RateLimitSettings* sub = (struct envoy_api_v2_core_RateLimitSettings*)envoy_api_v2_core_ApiConfigSource_rate_limit_settings(msg);
@ -132,6 +133,9 @@ UPB_INLINE struct envoy_api_v2_core_RateLimitSettings* envoy_api_v2_core_ApiConf
}
return sub;
}
UPB_INLINE void envoy_api_v2_core_ApiConfigSource_set_set_node_on_first_message_only(envoy_api_v2_core_ApiConfigSource *msg, bool value) {
UPB_FIELD_AT(msg, bool, UPB_SIZE(8, 8)) = value;
}
/* envoy.api.v2.core.AggregatedConfigSource */

@ -0,0 +1,35 @@
/* This file was generated by upbc (the upb compiler) from the input
* file:
*
* envoy/api/v2/core/http_uri.proto
*
* Do not edit -- your changes will be discarded when the file is
* regenerated. */
#include <stddef.h>
#include "upb/msg.h"
#include "envoy/api/v2/core/http_uri.upb.h"
#include "google/protobuf/duration.upb.h"
#include "gogoproto/gogo.upb.h"
#include "validate/validate.upb.h"
#include "upb/port_def.inc"
static const upb_msglayout *const envoy_api_v2_core_HttpUri_submsgs[1] = {
&google_protobuf_Duration_msginit,
};
static const upb_msglayout_field envoy_api_v2_core_HttpUri__fields[3] = {
{1, UPB_SIZE(0, 0), 0, 0, 9, 1},
{2, UPB_SIZE(12, 24), UPB_SIZE(-21, -41), 0, 9, 1},
{3, UPB_SIZE(8, 16), 0, 0, 11, 1},
};
const upb_msglayout envoy_api_v2_core_HttpUri_msginit = {
&envoy_api_v2_core_HttpUri_submsgs[0],
&envoy_api_v2_core_HttpUri__fields[0],
UPB_SIZE(24, 48), 3, false,
};
#include "upb/port_undef.inc"

@ -0,0 +1,80 @@
/* This file was generated by upbc (the upb compiler) from the input
* file:
*
* envoy/api/v2/core/http_uri.proto
*
* Do not edit -- your changes will be discarded when the file is
* regenerated. */
#ifndef ENVOY_API_V2_CORE_HTTP_URI_PROTO_UPB_H_
#define ENVOY_API_V2_CORE_HTTP_URI_PROTO_UPB_H_
#include "upb/generated_util.h"
#include "upb/msg.h"
#include "upb/decode.h"
#include "upb/encode.h"
#include "upb/port_def.inc"
#ifdef __cplusplus
extern "C" {
#endif
struct envoy_api_v2_core_HttpUri;
typedef struct envoy_api_v2_core_HttpUri envoy_api_v2_core_HttpUri;
extern const upb_msglayout envoy_api_v2_core_HttpUri_msginit;
struct google_protobuf_Duration;
extern const upb_msglayout google_protobuf_Duration_msginit;
/* envoy.api.v2.core.HttpUri */
UPB_INLINE envoy_api_v2_core_HttpUri *envoy_api_v2_core_HttpUri_new(upb_arena *arena) {
return (envoy_api_v2_core_HttpUri *)upb_msg_new(&envoy_api_v2_core_HttpUri_msginit, arena);
}
UPB_INLINE envoy_api_v2_core_HttpUri *envoy_api_v2_core_HttpUri_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_api_v2_core_HttpUri *ret = envoy_api_v2_core_HttpUri_new(arena);
return (ret && upb_decode(buf, size, ret, &envoy_api_v2_core_HttpUri_msginit, arena)) ? ret : NULL;
}
UPB_INLINE char *envoy_api_v2_core_HttpUri_serialize(const envoy_api_v2_core_HttpUri *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_api_v2_core_HttpUri_msginit, arena, len);
}
typedef enum {
envoy_api_v2_core_HttpUri_http_upstream_type_cluster = 2,
envoy_api_v2_core_HttpUri_http_upstream_type_NOT_SET = 0
} envoy_api_v2_core_HttpUri_http_upstream_type_oneofcases;
UPB_INLINE envoy_api_v2_core_HttpUri_http_upstream_type_oneofcases envoy_api_v2_core_HttpUri_http_upstream_type_case(const envoy_api_v2_core_HttpUri* msg) { return (envoy_api_v2_core_HttpUri_http_upstream_type_oneofcases)UPB_FIELD_AT(msg, int32_t, UPB_SIZE(20, 40)); }
UPB_INLINE upb_strview envoy_api_v2_core_HttpUri_uri(const envoy_api_v2_core_HttpUri *msg) { return UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(0, 0)); }
UPB_INLINE bool envoy_api_v2_core_HttpUri_has_cluster(const envoy_api_v2_core_HttpUri *msg) { return _upb_has_oneof_field(msg, UPB_SIZE(20, 40), 2); }
UPB_INLINE upb_strview envoy_api_v2_core_HttpUri_cluster(const envoy_api_v2_core_HttpUri *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(12, 24), UPB_SIZE(20, 40), 2, upb_strview_make("", strlen(""))); }
UPB_INLINE const struct google_protobuf_Duration* envoy_api_v2_core_HttpUri_timeout(const envoy_api_v2_core_HttpUri *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_Duration*, UPB_SIZE(8, 16)); }
UPB_INLINE void envoy_api_v2_core_HttpUri_set_uri(envoy_api_v2_core_HttpUri *msg, upb_strview value) {
UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(0, 0)) = value;
}
UPB_INLINE void envoy_api_v2_core_HttpUri_set_cluster(envoy_api_v2_core_HttpUri *msg, upb_strview value) {
UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(12, 24), value, UPB_SIZE(20, 40), 2);
}
UPB_INLINE void envoy_api_v2_core_HttpUri_set_timeout(envoy_api_v2_core_HttpUri *msg, struct google_protobuf_Duration* value) {
UPB_FIELD_AT(msg, struct google_protobuf_Duration*, UPB_SIZE(8, 16)) = value;
}
UPB_INLINE struct google_protobuf_Duration* envoy_api_v2_core_HttpUri_mutable_timeout(envoy_api_v2_core_HttpUri *msg, upb_arena *arena) {
struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_api_v2_core_HttpUri_timeout(msg);
if (sub == NULL) {
sub = (struct google_protobuf_Duration*)upb_msg_new(&google_protobuf_Duration_msginit, arena);
if (!sub) return NULL;
envoy_api_v2_core_HttpUri_set_timeout(msg, sub);
}
return sub;
}
#ifdef __cplusplus
} /* extern "C" */
#endif
#include "upb/port_undef.inc"
#endif /* ENVOY_API_V2_CORE_HTTP_URI_PROTO_UPB_H_ */

@ -52,23 +52,29 @@ const upb_msglayout envoy_api_v2_core_Http1ProtocolOptions_msginit = {
UPB_SIZE(16, 32), 3, false,
};
static const upb_msglayout *const envoy_api_v2_core_Http2ProtocolOptions_submsgs[4] = {
static const upb_msglayout *const envoy_api_v2_core_Http2ProtocolOptions_submsgs[9] = {
&google_protobuf_UInt32Value_msginit,
};
static const upb_msglayout_field envoy_api_v2_core_Http2ProtocolOptions__fields[6] = {
static const upb_msglayout_field envoy_api_v2_core_Http2ProtocolOptions__fields[12] = {
{1, UPB_SIZE(4, 8), 0, 0, 11, 1},
{2, UPB_SIZE(8, 16), 0, 0, 11, 1},
{3, UPB_SIZE(12, 24), 0, 0, 11, 1},
{4, UPB_SIZE(16, 32), 0, 0, 11, 1},
{5, UPB_SIZE(0, 0), 0, 0, 8, 1},
{6, UPB_SIZE(1, 1), 0, 0, 8, 1},
{7, UPB_SIZE(20, 40), 0, 0, 11, 1},
{8, UPB_SIZE(24, 48), 0, 0, 11, 1},
{9, UPB_SIZE(28, 56), 0, 0, 11, 1},
{10, UPB_SIZE(32, 64), 0, 0, 11, 1},
{11, UPB_SIZE(36, 72), 0, 0, 11, 1},
{12, UPB_SIZE(2, 2), 0, 0, 8, 1},
};
const upb_msglayout envoy_api_v2_core_Http2ProtocolOptions_msginit = {
&envoy_api_v2_core_Http2ProtocolOptions_submsgs[0],
&envoy_api_v2_core_Http2ProtocolOptions__fields[0],
UPB_SIZE(20, 40), 6, false,
UPB_SIZE(40, 80), 12, false,
};
static const upb_msglayout *const envoy_api_v2_core_GrpcProtocolOptions_submsgs[1] = {

@ -145,6 +145,12 @@ UPB_INLINE const struct google_protobuf_UInt32Value* envoy_api_v2_core_Http2Prot
UPB_INLINE const struct google_protobuf_UInt32Value* envoy_api_v2_core_Http2ProtocolOptions_initial_connection_window_size(const envoy_api_v2_core_Http2ProtocolOptions *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_UInt32Value*, UPB_SIZE(16, 32)); }
UPB_INLINE bool envoy_api_v2_core_Http2ProtocolOptions_allow_connect(const envoy_api_v2_core_Http2ProtocolOptions *msg) { return UPB_FIELD_AT(msg, bool, UPB_SIZE(0, 0)); }
UPB_INLINE bool envoy_api_v2_core_Http2ProtocolOptions_allow_metadata(const envoy_api_v2_core_Http2ProtocolOptions *msg) { return UPB_FIELD_AT(msg, bool, UPB_SIZE(1, 1)); }
UPB_INLINE const struct google_protobuf_UInt32Value* envoy_api_v2_core_Http2ProtocolOptions_max_outbound_frames(const envoy_api_v2_core_Http2ProtocolOptions *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_UInt32Value*, UPB_SIZE(20, 40)); }
UPB_INLINE const struct google_protobuf_UInt32Value* envoy_api_v2_core_Http2ProtocolOptions_max_outbound_control_frames(const envoy_api_v2_core_Http2ProtocolOptions *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_UInt32Value*, UPB_SIZE(24, 48)); }
UPB_INLINE const struct google_protobuf_UInt32Value* envoy_api_v2_core_Http2ProtocolOptions_max_consecutive_inbound_frames_with_empty_payload(const envoy_api_v2_core_Http2ProtocolOptions *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_UInt32Value*, UPB_SIZE(28, 56)); }
UPB_INLINE const struct google_protobuf_UInt32Value* envoy_api_v2_core_Http2ProtocolOptions_max_inbound_priority_frames_per_stream(const envoy_api_v2_core_Http2ProtocolOptions *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_UInt32Value*, UPB_SIZE(32, 64)); }
UPB_INLINE const struct google_protobuf_UInt32Value* envoy_api_v2_core_Http2ProtocolOptions_max_inbound_window_update_frames_per_data_frame_sent(const envoy_api_v2_core_Http2ProtocolOptions *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_UInt32Value*, UPB_SIZE(36, 72)); }
UPB_INLINE bool envoy_api_v2_core_Http2ProtocolOptions_stream_error_on_invalid_http_messaging(const envoy_api_v2_core_Http2ProtocolOptions *msg) { return UPB_FIELD_AT(msg, bool, UPB_SIZE(2, 2)); }
UPB_INLINE void envoy_api_v2_core_Http2ProtocolOptions_set_hpack_table_size(envoy_api_v2_core_Http2ProtocolOptions *msg, struct google_protobuf_UInt32Value* value) {
UPB_FIELD_AT(msg, struct google_protobuf_UInt32Value*, UPB_SIZE(4, 8)) = value;
@ -200,6 +206,69 @@ UPB_INLINE void envoy_api_v2_core_Http2ProtocolOptions_set_allow_connect(envoy_a
UPB_INLINE void envoy_api_v2_core_Http2ProtocolOptions_set_allow_metadata(envoy_api_v2_core_Http2ProtocolOptions *msg, bool value) {
UPB_FIELD_AT(msg, bool, UPB_SIZE(1, 1)) = value;
}
UPB_INLINE void envoy_api_v2_core_Http2ProtocolOptions_set_max_outbound_frames(envoy_api_v2_core_Http2ProtocolOptions *msg, struct google_protobuf_UInt32Value* value) {
UPB_FIELD_AT(msg, struct google_protobuf_UInt32Value*, UPB_SIZE(20, 40)) = value;
}
UPB_INLINE struct google_protobuf_UInt32Value* envoy_api_v2_core_Http2ProtocolOptions_mutable_max_outbound_frames(envoy_api_v2_core_Http2ProtocolOptions *msg, upb_arena *arena) {
struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_api_v2_core_Http2ProtocolOptions_max_outbound_frames(msg);
if (sub == NULL) {
sub = (struct google_protobuf_UInt32Value*)upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
if (!sub) return NULL;
envoy_api_v2_core_Http2ProtocolOptions_set_max_outbound_frames(msg, sub);
}
return sub;
}
UPB_INLINE void envoy_api_v2_core_Http2ProtocolOptions_set_max_outbound_control_frames(envoy_api_v2_core_Http2ProtocolOptions *msg, struct google_protobuf_UInt32Value* value) {
UPB_FIELD_AT(msg, struct google_protobuf_UInt32Value*, UPB_SIZE(24, 48)) = value;
}
UPB_INLINE struct google_protobuf_UInt32Value* envoy_api_v2_core_Http2ProtocolOptions_mutable_max_outbound_control_frames(envoy_api_v2_core_Http2ProtocolOptions *msg, upb_arena *arena) {
struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_api_v2_core_Http2ProtocolOptions_max_outbound_control_frames(msg);
if (sub == NULL) {
sub = (struct google_protobuf_UInt32Value*)upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
if (!sub) return NULL;
envoy_api_v2_core_Http2ProtocolOptions_set_max_outbound_control_frames(msg, sub);
}
return sub;
}
UPB_INLINE void envoy_api_v2_core_Http2ProtocolOptions_set_max_consecutive_inbound_frames_with_empty_payload(envoy_api_v2_core_Http2ProtocolOptions *msg, struct google_protobuf_UInt32Value* value) {
UPB_FIELD_AT(msg, struct google_protobuf_UInt32Value*, UPB_SIZE(28, 56)) = value;
}
UPB_INLINE struct google_protobuf_UInt32Value* envoy_api_v2_core_Http2ProtocolOptions_mutable_max_consecutive_inbound_frames_with_empty_payload(envoy_api_v2_core_Http2ProtocolOptions *msg, upb_arena *arena) {
struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_api_v2_core_Http2ProtocolOptions_max_consecutive_inbound_frames_with_empty_payload(msg);
if (sub == NULL) {
sub = (struct google_protobuf_UInt32Value*)upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
if (!sub) return NULL;
envoy_api_v2_core_Http2ProtocolOptions_set_max_consecutive_inbound_frames_with_empty_payload(msg, sub);
}
return sub;
}
UPB_INLINE void envoy_api_v2_core_Http2ProtocolOptions_set_max_inbound_priority_frames_per_stream(envoy_api_v2_core_Http2ProtocolOptions *msg, struct google_protobuf_UInt32Value* value) {
UPB_FIELD_AT(msg, struct google_protobuf_UInt32Value*, UPB_SIZE(32, 64)) = value;
}
UPB_INLINE struct google_protobuf_UInt32Value* envoy_api_v2_core_Http2ProtocolOptions_mutable_max_inbound_priority_frames_per_stream(envoy_api_v2_core_Http2ProtocolOptions *msg, upb_arena *arena) {
struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_api_v2_core_Http2ProtocolOptions_max_inbound_priority_frames_per_stream(msg);
if (sub == NULL) {
sub = (struct google_protobuf_UInt32Value*)upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
if (!sub) return NULL;
envoy_api_v2_core_Http2ProtocolOptions_set_max_inbound_priority_frames_per_stream(msg, sub);
}
return sub;
}
UPB_INLINE void envoy_api_v2_core_Http2ProtocolOptions_set_max_inbound_window_update_frames_per_data_frame_sent(envoy_api_v2_core_Http2ProtocolOptions *msg, struct google_protobuf_UInt32Value* value) {
UPB_FIELD_AT(msg, struct google_protobuf_UInt32Value*, UPB_SIZE(36, 72)) = value;
}
UPB_INLINE struct google_protobuf_UInt32Value* envoy_api_v2_core_Http2ProtocolOptions_mutable_max_inbound_window_update_frames_per_data_frame_sent(envoy_api_v2_core_Http2ProtocolOptions *msg, upb_arena *arena) {
struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_api_v2_core_Http2ProtocolOptions_max_inbound_window_update_frames_per_data_frame_sent(msg);
if (sub == NULL) {
sub = (struct google_protobuf_UInt32Value*)upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
if (!sub) return NULL;
envoy_api_v2_core_Http2ProtocolOptions_set_max_inbound_window_update_frames_per_data_frame_sent(msg, sub);
}
return sub;
}
UPB_INLINE void envoy_api_v2_core_Http2ProtocolOptions_set_stream_error_on_invalid_http_messaging(envoy_api_v2_core_Http2ProtocolOptions *msg, bool value) {
UPB_FIELD_AT(msg, bool, UPB_SIZE(2, 2)) = value;
}
/* envoy.api.v2.core.GrpcProtocolOptions */

@ -0,0 +1,58 @@
/* This file was generated by upbc (the upb compiler) from the input
* file:
*
* udpa/data/orca/v1/orca_load_report.proto
*
* Do not edit -- your changes will be discarded when the file is
* regenerated. */
#include <stddef.h>
#include "upb/msg.h"
#include "udpa/data/orca/v1/orca_load_report.upb.h"
#include "validate/validate.upb.h"
#include "upb/port_def.inc"
static const upb_msglayout *const udpa_data_orca_v1_OrcaLoadReport_submsgs[2] = {
&udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry_msginit,
&udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry_msginit,
};
static const upb_msglayout_field udpa_data_orca_v1_OrcaLoadReport__fields[5] = {
{1, UPB_SIZE(0, 0), 0, 0, 1, 1},
{2, UPB_SIZE(8, 8), 0, 0, 1, 1},
{3, UPB_SIZE(16, 16), 0, 0, 4, 1},
{4, UPB_SIZE(24, 24), 0, 0, 11, 3},
{5, UPB_SIZE(28, 32), 0, 1, 11, 3},
};
const upb_msglayout udpa_data_orca_v1_OrcaLoadReport_msginit = {
&udpa_data_orca_v1_OrcaLoadReport_submsgs[0],
&udpa_data_orca_v1_OrcaLoadReport__fields[0],
UPB_SIZE(32, 40), 5, false,
};
static const upb_msglayout_field udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry__fields[2] = {
{1, UPB_SIZE(8, 8), 0, 0, 9, 1},
{2, UPB_SIZE(0, 0), 0, 0, 1, 1},
};
const upb_msglayout udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry_msginit = {
NULL,
&udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry__fields[0],
UPB_SIZE(16, 32), 2, false,
};
static const upb_msglayout_field udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry__fields[2] = {
{1, UPB_SIZE(8, 8), 0, 0, 9, 1},
{2, UPB_SIZE(0, 0), 0, 0, 1, 1},
};
const upb_msglayout udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry_msginit = {
NULL,
&udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry__fields[0],
UPB_SIZE(16, 32), 2, false,
};
#include "upb/port_undef.inc"

@ -0,0 +1,144 @@
/* This file was generated by upbc (the upb compiler) from the input
* file:
*
* udpa/data/orca/v1/orca_load_report.proto
*
* Do not edit -- your changes will be discarded when the file is
* regenerated. */
#ifndef UDPA_DATA_ORCA_V1_ORCA_LOAD_REPORT_PROTO_UPB_H_
#define UDPA_DATA_ORCA_V1_ORCA_LOAD_REPORT_PROTO_UPB_H_
#include "upb/generated_util.h"
#include "upb/msg.h"
#include "upb/decode.h"
#include "upb/encode.h"
#include "upb/port_def.inc"
#ifdef __cplusplus
extern "C" {
#endif
struct udpa_data_orca_v1_OrcaLoadReport;
struct udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry;
struct udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry;
typedef struct udpa_data_orca_v1_OrcaLoadReport udpa_data_orca_v1_OrcaLoadReport;
typedef struct udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry;
typedef struct udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry;
extern const upb_msglayout udpa_data_orca_v1_OrcaLoadReport_msginit;
extern const upb_msglayout udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry_msginit;
extern const upb_msglayout udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry_msginit;
/* udpa.data.orca.v1.OrcaLoadReport */
UPB_INLINE udpa_data_orca_v1_OrcaLoadReport *udpa_data_orca_v1_OrcaLoadReport_new(upb_arena *arena) {
return (udpa_data_orca_v1_OrcaLoadReport *)upb_msg_new(&udpa_data_orca_v1_OrcaLoadReport_msginit, arena);
}
UPB_INLINE udpa_data_orca_v1_OrcaLoadReport *udpa_data_orca_v1_OrcaLoadReport_parse(const char *buf, size_t size,
upb_arena *arena) {
udpa_data_orca_v1_OrcaLoadReport *ret = udpa_data_orca_v1_OrcaLoadReport_new(arena);
return (ret && upb_decode(buf, size, ret, &udpa_data_orca_v1_OrcaLoadReport_msginit, arena)) ? ret : NULL;
}
UPB_INLINE char *udpa_data_orca_v1_OrcaLoadReport_serialize(const udpa_data_orca_v1_OrcaLoadReport *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &udpa_data_orca_v1_OrcaLoadReport_msginit, arena, len);
}
UPB_INLINE double udpa_data_orca_v1_OrcaLoadReport_cpu_utilization(const udpa_data_orca_v1_OrcaLoadReport *msg) { return UPB_FIELD_AT(msg, double, UPB_SIZE(0, 0)); }
UPB_INLINE double udpa_data_orca_v1_OrcaLoadReport_mem_utilization(const udpa_data_orca_v1_OrcaLoadReport *msg) { return UPB_FIELD_AT(msg, double, UPB_SIZE(8, 8)); }
UPB_INLINE uint64_t udpa_data_orca_v1_OrcaLoadReport_rps(const udpa_data_orca_v1_OrcaLoadReport *msg) { return UPB_FIELD_AT(msg, uint64_t, UPB_SIZE(16, 16)); }
UPB_INLINE const udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry* const* udpa_data_orca_v1_OrcaLoadReport_request_cost(const udpa_data_orca_v1_OrcaLoadReport *msg, size_t *len) { return (const udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry* const*)_upb_array_accessor(msg, UPB_SIZE(24, 24), len); }
UPB_INLINE const udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry* const* udpa_data_orca_v1_OrcaLoadReport_utilization(const udpa_data_orca_v1_OrcaLoadReport *msg, size_t *len) { return (const udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry* const*)_upb_array_accessor(msg, UPB_SIZE(28, 32), len); }
UPB_INLINE void udpa_data_orca_v1_OrcaLoadReport_set_cpu_utilization(udpa_data_orca_v1_OrcaLoadReport *msg, double value) {
UPB_FIELD_AT(msg, double, UPB_SIZE(0, 0)) = value;
}
UPB_INLINE void udpa_data_orca_v1_OrcaLoadReport_set_mem_utilization(udpa_data_orca_v1_OrcaLoadReport *msg, double value) {
UPB_FIELD_AT(msg, double, UPB_SIZE(8, 8)) = value;
}
UPB_INLINE void udpa_data_orca_v1_OrcaLoadReport_set_rps(udpa_data_orca_v1_OrcaLoadReport *msg, uint64_t value) {
UPB_FIELD_AT(msg, uint64_t, UPB_SIZE(16, 16)) = value;
}
UPB_INLINE udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry** udpa_data_orca_v1_OrcaLoadReport_mutable_request_cost(udpa_data_orca_v1_OrcaLoadReport *msg, size_t *len) {
return (udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry**)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 24), len);
}
UPB_INLINE udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry** udpa_data_orca_v1_OrcaLoadReport_resize_request_cost(udpa_data_orca_v1_OrcaLoadReport *msg, size_t len, upb_arena *arena) {
return (udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry**)_upb_array_resize_accessor(msg, UPB_SIZE(24, 24), len, UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, arena);
}
UPB_INLINE struct udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry* udpa_data_orca_v1_OrcaLoadReport_add_request_cost(udpa_data_orca_v1_OrcaLoadReport *msg, upb_arena *arena) {
struct udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry* sub = (struct udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry*)upb_msg_new(&udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry_msginit, arena);
bool ok = _upb_array_append_accessor(
msg, UPB_SIZE(24, 24), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
if (!ok) return NULL;
return sub;
}
UPB_INLINE udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry** udpa_data_orca_v1_OrcaLoadReport_mutable_utilization(udpa_data_orca_v1_OrcaLoadReport *msg, size_t *len) {
return (udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry**)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 32), len);
}
UPB_INLINE udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry** udpa_data_orca_v1_OrcaLoadReport_resize_utilization(udpa_data_orca_v1_OrcaLoadReport *msg, size_t len, upb_arena *arena) {
return (udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry**)_upb_array_resize_accessor(msg, UPB_SIZE(28, 32), len, UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, arena);
}
UPB_INLINE struct udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry* udpa_data_orca_v1_OrcaLoadReport_add_utilization(udpa_data_orca_v1_OrcaLoadReport *msg, upb_arena *arena) {
struct udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry* sub = (struct udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry*)upb_msg_new(&udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry_msginit, arena);
bool ok = _upb_array_append_accessor(
msg, UPB_SIZE(28, 32), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
if (!ok) return NULL;
return sub;
}
/* udpa.data.orca.v1.OrcaLoadReport.RequestCostEntry */
UPB_INLINE udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry *udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry_new(upb_arena *arena) {
return (udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry *)upb_msg_new(&udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry_msginit, arena);
}
UPB_INLINE udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry *udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry_parse(const char *buf, size_t size,
upb_arena *arena) {
udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry *ret = udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry_new(arena);
return (ret && upb_decode(buf, size, ret, &udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry_msginit, arena)) ? ret : NULL;
}
UPB_INLINE char *udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry_serialize(const udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry_msginit, arena, len);
}
UPB_INLINE upb_strview udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry_key(const udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry *msg) { return UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(8, 8)); }
UPB_INLINE double udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry_value(const udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry *msg) { return UPB_FIELD_AT(msg, double, UPB_SIZE(0, 0)); }
UPB_INLINE void udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry_set_key(udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry *msg, upb_strview value) {
UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(8, 8)) = value;
}
UPB_INLINE void udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry_set_value(udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry *msg, double value) {
UPB_FIELD_AT(msg, double, UPB_SIZE(0, 0)) = value;
}
/* udpa.data.orca.v1.OrcaLoadReport.UtilizationEntry */
UPB_INLINE udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry *udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry_new(upb_arena *arena) {
return (udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry *)upb_msg_new(&udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry_msginit, arena);
}
UPB_INLINE udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry *udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry_parse(const char *buf, size_t size,
upb_arena *arena) {
udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry *ret = udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry_new(arena);
return (ret && upb_decode(buf, size, ret, &udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry_msginit, arena)) ? ret : NULL;
}
UPB_INLINE char *udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry_serialize(const udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry_msginit, arena, len);
}
UPB_INLINE upb_strview udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry_key(const udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry *msg) { return UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(8, 8)); }
UPB_INLINE double udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry_value(const udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry *msg) { return UPB_FIELD_AT(msg, double, UPB_SIZE(0, 0)); }
UPB_INLINE void udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry_set_key(udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry *msg, upb_strview value) {
UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(8, 8)) = value;
}
UPB_INLINE void udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry_set_value(udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry *msg, double value) {
UPB_FIELD_AT(msg, double, UPB_SIZE(0, 0)) = value;
}
#ifdef __cplusplus
} /* extern "C" */
#endif
#include "upb/port_undef.inc"
#endif /* UDPA_DATA_ORCA_V1_ORCA_LOAD_REPORT_PROTO_UPB_H_ */

@ -35,6 +35,7 @@
#include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/gprpp/pair.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/gprpp/string_view.h"
namespace grpc_core {
@ -42,8 +43,14 @@ struct StringLess {
bool operator()(const char* a, const char* b) const {
return strcmp(a, b) < 0;
}
bool operator()(const UniquePtr<char>& k1, const UniquePtr<char>& k2) const {
return strcmp(k1.get(), k2.get()) < 0;
bool operator()(const UniquePtr<char>& a, const UniquePtr<char>& b) const {
return strcmp(a.get(), b.get()) < 0;
}
bool operator()(const StringView& a, const StringView& b) const {
const size_t min_size = std::min(a.size(), b.size());
int c = strncmp(a.data(), b.data(), min_size);
if (c != 0) return c < 0;
return a.size() < b.size();
}
};

@ -138,11 +138,12 @@ grpc_slice grpc_slice_maybe_static_intern(grpc_slice slice,
for (uint32_t i = 0; i <= max_static_metadata_hash_probe; i++) {
static_metadata_hash_ent ent =
static_metadata_hash[(hash + i) % GPR_ARRAY_SIZE(static_metadata_hash)];
const grpc_core::StaticMetadataSlice* static_slice_table =
grpc_static_slice_table();
if (ent.hash == hash && ent.idx < GRPC_STATIC_MDSTR_COUNT &&
grpc_slice_eq_static_interned(slice,
grpc_static_slice_table[ent.idx])) {
grpc_slice_eq_static_interned(slice, static_slice_table[ent.idx])) {
*returned_slice_is_different = true;
return grpc_static_slice_table[ent.idx];
return static_slice_table[ent.idx];
}
}
@ -168,10 +169,11 @@ static const grpc_core::StaticMetadataSlice* MatchStaticSlice(
for (uint32_t i = 0; i <= max_static_metadata_hash_probe; i++) {
static_metadata_hash_ent ent =
static_metadata_hash[(hash + i) % GPR_ARRAY_SIZE(static_metadata_hash)];
const grpc_core::StaticMetadataSlice* static_slice_table =
grpc_static_slice_table();
if (ent.hash == hash && ent.idx < GRPC_STATIC_MDSTR_COUNT &&
grpc_static_slice_table[ent.idx].Equals(
std::forward<SliceArgs>(args)...)) {
return &grpc_static_slice_table[ent.idx];
static_slice_table[ent.idx].Equals(std::forward<SliceArgs>(args)...)) {
return &static_slice_table[ent.idx];
}
}
return nullptr;
@ -318,9 +320,11 @@ void grpc_slice_intern_init(void) {
static_metadata_hash[i].idx = GRPC_STATIC_MDSTR_COUNT;
}
max_static_metadata_hash_probe = 0;
const grpc_core::StaticMetadataSlice* static_slice_table =
grpc_static_slice_table();
for (size_t i = 0; i < GRPC_STATIC_MDSTR_COUNT; i++) {
grpc_static_metadata_hash_values[i] =
grpc_slice_default_hash_internal(grpc_static_slice_table[i]);
grpc_slice_default_hash_internal(static_slice_table[i]);
for (size_t j = 0; j < GPR_ARRAY_SIZE(static_metadata_hash); j++) {
size_t slot = (grpc_static_metadata_hash_values[i] + j) %
GPR_ARRAY_SIZE(static_metadata_hash);
@ -336,7 +340,7 @@ void grpc_slice_intern_init(void) {
}
// Handle KV hash for all static mdelems.
for (size_t i = 0; i < GRPC_STATIC_MDELEM_COUNT; ++i) {
grpc_static_mdelem_table[i].HashInit();
grpc_static_mdelem_table()[i].HashInit();
}
}

@ -182,7 +182,7 @@ struct StaticSliceRefcount {
index(index) {}
grpc_slice_refcount base;
uint32_t index;
const uint32_t index;
};
extern grpc_slice_refcount kNoopRefcount;

@ -153,10 +153,14 @@ struct ExternallyManagedSlice : public UnmanagedMemorySlice {
};
struct StaticMetadataSlice : public ManagedMemorySlice {
StaticMetadataSlice(grpc_slice_refcount* ref, size_t length, uint8_t* bytes) {
StaticMetadataSlice(grpc_slice_refcount* ref, size_t length,
const uint8_t* bytes) {
refcount = ref;
data.refcounted.length = length;
data.refcounted.bytes = bytes;
// NB: grpc_slice may or may not point to a static slice, but we are
// definitely pointing to static data here. Since we are not changing
// the underlying C-type, we need a const_cast here.
data.refcounted.bytes = const_cast<uint8_t*>(bytes);
}
};

@ -134,6 +134,7 @@ void grpc_init(void) {
grpc_core::Fork::GlobalInit();
grpc_fork_handlers_auto_register();
grpc_stats_init();
grpc_init_static_metadata_ctx();
grpc_slice_intern_init();
grpc_mdctx_global_init();
grpc_channel_init_init();
@ -191,6 +192,8 @@ void grpc_shutdown_internal_locked(void) {
grpc_core::ApplicationCallbackExecCtx::GlobalShutdown();
g_shutting_down = false;
gpr_cv_broadcast(g_shutting_down_cv);
// Absolute last action will be to delete static metadata context.
grpc_destroy_static_metadata_ctx();
}
void grpc_shutdown_internal(void* ignored) {

@ -269,9 +269,9 @@ void grpc_mdctx_global_shutdown() {
#ifndef NDEBUG
static int is_mdelem_static(grpc_mdelem e) {
return reinterpret_cast<grpc_core::StaticMetadata*>(GRPC_MDELEM_DATA(e)) >=
&grpc_static_mdelem_table[0] &&
&grpc_static_mdelem_table()[0] &&
reinterpret_cast<grpc_core::StaticMetadata*>(GRPC_MDELEM_DATA(e)) <
&grpc_static_mdelem_table[GRPC_STATIC_MDELEM_COUNT];
&grpc_static_mdelem_table()[GRPC_STATIC_MDELEM_COUNT];
}
#endif
@ -569,7 +569,7 @@ void* grpc_mdelem_get_user_data(grpc_mdelem md, void (*destroy_func)(void*)) {
grpc_static_mdelem_user_data
[reinterpret_cast<grpc_core::StaticMetadata*>(
GRPC_MDELEM_DATA(md)) -
grpc_static_mdelem_table]);
grpc_static_mdelem_table()]);
case GRPC_MDELEM_STORAGE_ALLOCATED: {
auto* am = reinterpret_cast<AllocatedMetadata*>(GRPC_MDELEM_DATA(md));
return get_user_data(am->user_data(), destroy_func);
@ -611,7 +611,7 @@ void* grpc_mdelem_set_user_data(grpc_mdelem md, void (*destroy_func)(void*),
grpc_static_mdelem_user_data
[reinterpret_cast<grpc_core::StaticMetadata*>(
GRPC_MDELEM_DATA(md)) -
grpc_static_mdelem_table]);
grpc_static_mdelem_table()]);
case GRPC_MDELEM_STORAGE_ALLOCATED: {
auto* am = reinterpret_cast<AllocatedMetadata*>(GRPC_MDELEM_DATA(md));
return set_user_data(am->user_data(), destroy_func, data);

File diff suppressed because it is too large Load Diff

@ -36,241 +36,265 @@
static_assert(
std::is_trivially_destructible<grpc_core::StaticMetadataSlice>::value,
"grpc_core::StaticMetadataSlice must be trivially destructible.");
#define GRPC_STATIC_MDSTR_COUNT 108
extern const grpc_core::StaticMetadataSlice
grpc_static_slice_table[GRPC_STATIC_MDSTR_COUNT];
#define GRPC_STATIC_MDSTR_COUNT 109
void grpc_init_static_metadata_ctx(void);
void grpc_destroy_static_metadata_ctx(void);
namespace grpc_core {
#ifndef NDEBUG
constexpr uint64_t kGrpcStaticMetadataInitCanary = 0xCAFEF00DC0FFEE11L;
uint64_t StaticMetadataInitCanary();
#endif
extern const StaticMetadataSlice* g_static_metadata_slice_table;
}
inline const grpc_core::StaticMetadataSlice* grpc_static_slice_table() {
GPR_DEBUG_ASSERT(grpc_core::StaticMetadataInitCanary() ==
grpc_core::kGrpcStaticMetadataInitCanary);
GPR_DEBUG_ASSERT(grpc_core::g_static_metadata_slice_table != nullptr);
return grpc_core::g_static_metadata_slice_table;
}
/* ":path" */
#define GRPC_MDSTR_PATH (grpc_static_slice_table[0])
#define GRPC_MDSTR_PATH (grpc_static_slice_table()[0])
/* ":method" */
#define GRPC_MDSTR_METHOD (grpc_static_slice_table[1])
#define GRPC_MDSTR_METHOD (grpc_static_slice_table()[1])
/* ":status" */
#define GRPC_MDSTR_STATUS (grpc_static_slice_table[2])
#define GRPC_MDSTR_STATUS (grpc_static_slice_table()[2])
/* ":authority" */
#define GRPC_MDSTR_AUTHORITY (grpc_static_slice_table[3])
#define GRPC_MDSTR_AUTHORITY (grpc_static_slice_table()[3])
/* ":scheme" */
#define GRPC_MDSTR_SCHEME (grpc_static_slice_table[4])
#define GRPC_MDSTR_SCHEME (grpc_static_slice_table()[4])
/* "te" */
#define GRPC_MDSTR_TE (grpc_static_slice_table[5])
#define GRPC_MDSTR_TE (grpc_static_slice_table()[5])
/* "grpc-message" */
#define GRPC_MDSTR_GRPC_MESSAGE (grpc_static_slice_table[6])
#define GRPC_MDSTR_GRPC_MESSAGE (grpc_static_slice_table()[6])
/* "grpc-status" */
#define GRPC_MDSTR_GRPC_STATUS (grpc_static_slice_table[7])
#define GRPC_MDSTR_GRPC_STATUS (grpc_static_slice_table()[7])
/* "grpc-payload-bin" */
#define GRPC_MDSTR_GRPC_PAYLOAD_BIN (grpc_static_slice_table[8])
#define GRPC_MDSTR_GRPC_PAYLOAD_BIN (grpc_static_slice_table()[8])
/* "grpc-encoding" */
#define GRPC_MDSTR_GRPC_ENCODING (grpc_static_slice_table[9])
#define GRPC_MDSTR_GRPC_ENCODING (grpc_static_slice_table()[9])
/* "grpc-accept-encoding" */
#define GRPC_MDSTR_GRPC_ACCEPT_ENCODING (grpc_static_slice_table[10])
#define GRPC_MDSTR_GRPC_ACCEPT_ENCODING (grpc_static_slice_table()[10])
/* "grpc-server-stats-bin" */
#define GRPC_MDSTR_GRPC_SERVER_STATS_BIN (grpc_static_slice_table[11])
#define GRPC_MDSTR_GRPC_SERVER_STATS_BIN (grpc_static_slice_table()[11])
/* "grpc-tags-bin" */
#define GRPC_MDSTR_GRPC_TAGS_BIN (grpc_static_slice_table[12])
#define GRPC_MDSTR_GRPC_TAGS_BIN (grpc_static_slice_table()[12])
/* "grpc-trace-bin" */
#define GRPC_MDSTR_GRPC_TRACE_BIN (grpc_static_slice_table[13])
#define GRPC_MDSTR_GRPC_TRACE_BIN (grpc_static_slice_table()[13])
/* "content-type" */
#define GRPC_MDSTR_CONTENT_TYPE (grpc_static_slice_table[14])
#define GRPC_MDSTR_CONTENT_TYPE (grpc_static_slice_table()[14])
/* "content-encoding" */
#define GRPC_MDSTR_CONTENT_ENCODING (grpc_static_slice_table[15])
#define GRPC_MDSTR_CONTENT_ENCODING (grpc_static_slice_table()[15])
/* "accept-encoding" */
#define GRPC_MDSTR_ACCEPT_ENCODING (grpc_static_slice_table[16])
#define GRPC_MDSTR_ACCEPT_ENCODING (grpc_static_slice_table()[16])
/* "grpc-internal-encoding-request" */
#define GRPC_MDSTR_GRPC_INTERNAL_ENCODING_REQUEST (grpc_static_slice_table[17])
#define GRPC_MDSTR_GRPC_INTERNAL_ENCODING_REQUEST \
(grpc_static_slice_table()[17])
/* "grpc-internal-stream-encoding-request" */
#define GRPC_MDSTR_GRPC_INTERNAL_STREAM_ENCODING_REQUEST \
(grpc_static_slice_table[18])
(grpc_static_slice_table()[18])
/* "user-agent" */
#define GRPC_MDSTR_USER_AGENT (grpc_static_slice_table[19])
#define GRPC_MDSTR_USER_AGENT (grpc_static_slice_table()[19])
/* "host" */
#define GRPC_MDSTR_HOST (grpc_static_slice_table[20])
#define GRPC_MDSTR_HOST (grpc_static_slice_table()[20])
/* "grpc-previous-rpc-attempts" */
#define GRPC_MDSTR_GRPC_PREVIOUS_RPC_ATTEMPTS (grpc_static_slice_table[21])
#define GRPC_MDSTR_GRPC_PREVIOUS_RPC_ATTEMPTS (grpc_static_slice_table()[21])
/* "grpc-retry-pushback-ms" */
#define GRPC_MDSTR_GRPC_RETRY_PUSHBACK_MS (grpc_static_slice_table[22])
#define GRPC_MDSTR_GRPC_RETRY_PUSHBACK_MS (grpc_static_slice_table()[22])
/* "x-endpoint-load-metrics-bin" */
#define GRPC_MDSTR_X_ENDPOINT_LOAD_METRICS_BIN (grpc_static_slice_table()[23])
/* "grpc-timeout" */
#define GRPC_MDSTR_GRPC_TIMEOUT (grpc_static_slice_table[23])
#define GRPC_MDSTR_GRPC_TIMEOUT (grpc_static_slice_table()[24])
/* "1" */
#define GRPC_MDSTR_1 (grpc_static_slice_table[24])
#define GRPC_MDSTR_1 (grpc_static_slice_table()[25])
/* "2" */
#define GRPC_MDSTR_2 (grpc_static_slice_table[25])
#define GRPC_MDSTR_2 (grpc_static_slice_table()[26])
/* "3" */
#define GRPC_MDSTR_3 (grpc_static_slice_table[26])
#define GRPC_MDSTR_3 (grpc_static_slice_table()[27])
/* "4" */
#define GRPC_MDSTR_4 (grpc_static_slice_table[27])
#define GRPC_MDSTR_4 (grpc_static_slice_table()[28])
/* "" */
#define GRPC_MDSTR_EMPTY (grpc_static_slice_table[28])
#define GRPC_MDSTR_EMPTY (grpc_static_slice_table()[29])
/* "grpc.wait_for_ready" */
#define GRPC_MDSTR_GRPC_DOT_WAIT_FOR_READY (grpc_static_slice_table[29])
#define GRPC_MDSTR_GRPC_DOT_WAIT_FOR_READY (grpc_static_slice_table()[30])
/* "grpc.timeout" */
#define GRPC_MDSTR_GRPC_DOT_TIMEOUT (grpc_static_slice_table[30])
#define GRPC_MDSTR_GRPC_DOT_TIMEOUT (grpc_static_slice_table()[31])
/* "grpc.max_request_message_bytes" */
#define GRPC_MDSTR_GRPC_DOT_MAX_REQUEST_MESSAGE_BYTES \
(grpc_static_slice_table[31])
(grpc_static_slice_table()[32])
/* "grpc.max_response_message_bytes" */
#define GRPC_MDSTR_GRPC_DOT_MAX_RESPONSE_MESSAGE_BYTES \
(grpc_static_slice_table[32])
(grpc_static_slice_table()[33])
/* "/grpc.lb.v1.LoadBalancer/BalanceLoad" */
#define GRPC_MDSTR_SLASH_GRPC_DOT_LB_DOT_V1_DOT_LOADBALANCER_SLASH_BALANCELOAD \
(grpc_static_slice_table[33])
(grpc_static_slice_table()[34])
/* "/envoy.service.load_stats.v2.LoadReportingService/StreamLoadStats" */
#define GRPC_MDSTR_SLASH_ENVOY_DOT_SERVICE_DOT_LOAD_STATS_DOT_V2_DOT_LOADREPORTINGSERVICE_SLASH_STREAMLOADSTATS \
(grpc_static_slice_table[34])
(grpc_static_slice_table()[35])
/* "/envoy.api.v2.EndpointDiscoveryService/StreamEndpoints" */
#define GRPC_MDSTR_SLASH_ENVOY_DOT_API_DOT_V2_DOT_ENDPOINTDISCOVERYSERVICE_SLASH_STREAMENDPOINTS \
(grpc_static_slice_table[35])
(grpc_static_slice_table()[36])
/* "/grpc.health.v1.Health/Watch" */
#define GRPC_MDSTR_SLASH_GRPC_DOT_HEALTH_DOT_V1_DOT_HEALTH_SLASH_WATCH \
(grpc_static_slice_table[36])
(grpc_static_slice_table()[37])
/* "/envoy.service.discovery.v2.AggregatedDiscoveryService/StreamAggregatedResources"
*/
#define GRPC_MDSTR_SLASH_ENVOY_DOT_SERVICE_DOT_DISCOVERY_DOT_V2_DOT_AGGREGATEDDISCOVERYSERVICE_SLASH_STREAMAGGREGATEDRESOURCES \
(grpc_static_slice_table[37])
(grpc_static_slice_table()[38])
/* "deflate" */
#define GRPC_MDSTR_DEFLATE (grpc_static_slice_table[38])
#define GRPC_MDSTR_DEFLATE (grpc_static_slice_table()[39])
/* "gzip" */
#define GRPC_MDSTR_GZIP (grpc_static_slice_table[39])
#define GRPC_MDSTR_GZIP (grpc_static_slice_table()[40])
/* "stream/gzip" */
#define GRPC_MDSTR_STREAM_SLASH_GZIP (grpc_static_slice_table[40])
#define GRPC_MDSTR_STREAM_SLASH_GZIP (grpc_static_slice_table()[41])
/* "GET" */
#define GRPC_MDSTR_GET (grpc_static_slice_table[41])
#define GRPC_MDSTR_GET (grpc_static_slice_table()[42])
/* "POST" */
#define GRPC_MDSTR_POST (grpc_static_slice_table[42])
#define GRPC_MDSTR_POST (grpc_static_slice_table()[43])
/* "/" */
#define GRPC_MDSTR_SLASH (grpc_static_slice_table[43])
#define GRPC_MDSTR_SLASH (grpc_static_slice_table()[44])
/* "/index.html" */
#define GRPC_MDSTR_SLASH_INDEX_DOT_HTML (grpc_static_slice_table[44])
#define GRPC_MDSTR_SLASH_INDEX_DOT_HTML (grpc_static_slice_table()[45])
/* "http" */
#define GRPC_MDSTR_HTTP (grpc_static_slice_table[45])
#define GRPC_MDSTR_HTTP (grpc_static_slice_table()[46])
/* "https" */
#define GRPC_MDSTR_HTTPS (grpc_static_slice_table[46])
#define GRPC_MDSTR_HTTPS (grpc_static_slice_table()[47])
/* "200" */
#define GRPC_MDSTR_200 (grpc_static_slice_table[47])
#define GRPC_MDSTR_200 (grpc_static_slice_table()[48])
/* "204" */
#define GRPC_MDSTR_204 (grpc_static_slice_table[48])
#define GRPC_MDSTR_204 (grpc_static_slice_table()[49])
/* "206" */
#define GRPC_MDSTR_206 (grpc_static_slice_table[49])
#define GRPC_MDSTR_206 (grpc_static_slice_table()[50])
/* "304" */
#define GRPC_MDSTR_304 (grpc_static_slice_table[50])
#define GRPC_MDSTR_304 (grpc_static_slice_table()[51])
/* "400" */
#define GRPC_MDSTR_400 (grpc_static_slice_table[51])
#define GRPC_MDSTR_400 (grpc_static_slice_table()[52])
/* "404" */
#define GRPC_MDSTR_404 (grpc_static_slice_table[52])
#define GRPC_MDSTR_404 (grpc_static_slice_table()[53])
/* "500" */
#define GRPC_MDSTR_500 (grpc_static_slice_table[53])
#define GRPC_MDSTR_500 (grpc_static_slice_table()[54])
/* "accept-charset" */
#define GRPC_MDSTR_ACCEPT_CHARSET (grpc_static_slice_table[54])
#define GRPC_MDSTR_ACCEPT_CHARSET (grpc_static_slice_table()[55])
/* "gzip, deflate" */
#define GRPC_MDSTR_GZIP_COMMA_DEFLATE (grpc_static_slice_table[55])
#define GRPC_MDSTR_GZIP_COMMA_DEFLATE (grpc_static_slice_table()[56])
/* "accept-language" */
#define GRPC_MDSTR_ACCEPT_LANGUAGE (grpc_static_slice_table[56])
#define GRPC_MDSTR_ACCEPT_LANGUAGE (grpc_static_slice_table()[57])
/* "accept-ranges" */
#define GRPC_MDSTR_ACCEPT_RANGES (grpc_static_slice_table[57])
#define GRPC_MDSTR_ACCEPT_RANGES (grpc_static_slice_table()[58])
/* "accept" */
#define GRPC_MDSTR_ACCEPT (grpc_static_slice_table[58])
#define GRPC_MDSTR_ACCEPT (grpc_static_slice_table()[59])
/* "access-control-allow-origin" */
#define GRPC_MDSTR_ACCESS_CONTROL_ALLOW_ORIGIN (grpc_static_slice_table[59])
#define GRPC_MDSTR_ACCESS_CONTROL_ALLOW_ORIGIN (grpc_static_slice_table()[60])
/* "age" */
#define GRPC_MDSTR_AGE (grpc_static_slice_table[60])
#define GRPC_MDSTR_AGE (grpc_static_slice_table()[61])
/* "allow" */
#define GRPC_MDSTR_ALLOW (grpc_static_slice_table[61])
#define GRPC_MDSTR_ALLOW (grpc_static_slice_table()[62])
/* "authorization" */
#define GRPC_MDSTR_AUTHORIZATION (grpc_static_slice_table[62])
#define GRPC_MDSTR_AUTHORIZATION (grpc_static_slice_table()[63])
/* "cache-control" */
#define GRPC_MDSTR_CACHE_CONTROL (grpc_static_slice_table[63])
#define GRPC_MDSTR_CACHE_CONTROL (grpc_static_slice_table()[64])
/* "content-disposition" */
#define GRPC_MDSTR_CONTENT_DISPOSITION (grpc_static_slice_table[64])
#define GRPC_MDSTR_CONTENT_DISPOSITION (grpc_static_slice_table()[65])
/* "content-language" */
#define GRPC_MDSTR_CONTENT_LANGUAGE (grpc_static_slice_table[65])
#define GRPC_MDSTR_CONTENT_LANGUAGE (grpc_static_slice_table()[66])
/* "content-length" */
#define GRPC_MDSTR_CONTENT_LENGTH (grpc_static_slice_table[66])
#define GRPC_MDSTR_CONTENT_LENGTH (grpc_static_slice_table()[67])
/* "content-location" */
#define GRPC_MDSTR_CONTENT_LOCATION (grpc_static_slice_table[67])
#define GRPC_MDSTR_CONTENT_LOCATION (grpc_static_slice_table()[68])
/* "content-range" */
#define GRPC_MDSTR_CONTENT_RANGE (grpc_static_slice_table[68])
#define GRPC_MDSTR_CONTENT_RANGE (grpc_static_slice_table()[69])
/* "cookie" */
#define GRPC_MDSTR_COOKIE (grpc_static_slice_table[69])
#define GRPC_MDSTR_COOKIE (grpc_static_slice_table()[70])
/* "date" */
#define GRPC_MDSTR_DATE (grpc_static_slice_table[70])
#define GRPC_MDSTR_DATE (grpc_static_slice_table()[71])
/* "etag" */
#define GRPC_MDSTR_ETAG (grpc_static_slice_table[71])
#define GRPC_MDSTR_ETAG (grpc_static_slice_table()[72])
/* "expect" */
#define GRPC_MDSTR_EXPECT (grpc_static_slice_table[72])
#define GRPC_MDSTR_EXPECT (grpc_static_slice_table()[73])
/* "expires" */
#define GRPC_MDSTR_EXPIRES (grpc_static_slice_table[73])
#define GRPC_MDSTR_EXPIRES (grpc_static_slice_table()[74])
/* "from" */
#define GRPC_MDSTR_FROM (grpc_static_slice_table[74])
#define GRPC_MDSTR_FROM (grpc_static_slice_table()[75])
/* "if-match" */
#define GRPC_MDSTR_IF_MATCH (grpc_static_slice_table[75])
#define GRPC_MDSTR_IF_MATCH (grpc_static_slice_table()[76])
/* "if-modified-since" */
#define GRPC_MDSTR_IF_MODIFIED_SINCE (grpc_static_slice_table[76])
#define GRPC_MDSTR_IF_MODIFIED_SINCE (grpc_static_slice_table()[77])
/* "if-none-match" */
#define GRPC_MDSTR_IF_NONE_MATCH (grpc_static_slice_table[77])
#define GRPC_MDSTR_IF_NONE_MATCH (grpc_static_slice_table()[78])
/* "if-range" */
#define GRPC_MDSTR_IF_RANGE (grpc_static_slice_table[78])
#define GRPC_MDSTR_IF_RANGE (grpc_static_slice_table()[79])
/* "if-unmodified-since" */
#define GRPC_MDSTR_IF_UNMODIFIED_SINCE (grpc_static_slice_table[79])
#define GRPC_MDSTR_IF_UNMODIFIED_SINCE (grpc_static_slice_table()[80])
/* "last-modified" */
#define GRPC_MDSTR_LAST_MODIFIED (grpc_static_slice_table[80])
#define GRPC_MDSTR_LAST_MODIFIED (grpc_static_slice_table()[81])
/* "link" */
#define GRPC_MDSTR_LINK (grpc_static_slice_table[81])
#define GRPC_MDSTR_LINK (grpc_static_slice_table()[82])
/* "location" */
#define GRPC_MDSTR_LOCATION (grpc_static_slice_table[82])
#define GRPC_MDSTR_LOCATION (grpc_static_slice_table()[83])
/* "max-forwards" */
#define GRPC_MDSTR_MAX_FORWARDS (grpc_static_slice_table[83])
#define GRPC_MDSTR_MAX_FORWARDS (grpc_static_slice_table()[84])
/* "proxy-authenticate" */
#define GRPC_MDSTR_PROXY_AUTHENTICATE (grpc_static_slice_table[84])
#define GRPC_MDSTR_PROXY_AUTHENTICATE (grpc_static_slice_table()[85])
/* "proxy-authorization" */
#define GRPC_MDSTR_PROXY_AUTHORIZATION (grpc_static_slice_table[85])
#define GRPC_MDSTR_PROXY_AUTHORIZATION (grpc_static_slice_table()[86])
/* "range" */
#define GRPC_MDSTR_RANGE (grpc_static_slice_table[86])
#define GRPC_MDSTR_RANGE (grpc_static_slice_table()[87])
/* "referer" */
#define GRPC_MDSTR_REFERER (grpc_static_slice_table[87])
#define GRPC_MDSTR_REFERER (grpc_static_slice_table()[88])
/* "refresh" */
#define GRPC_MDSTR_REFRESH (grpc_static_slice_table[88])
#define GRPC_MDSTR_REFRESH (grpc_static_slice_table()[89])
/* "retry-after" */
#define GRPC_MDSTR_RETRY_AFTER (grpc_static_slice_table[89])
#define GRPC_MDSTR_RETRY_AFTER (grpc_static_slice_table()[90])
/* "server" */
#define GRPC_MDSTR_SERVER (grpc_static_slice_table[90])
#define GRPC_MDSTR_SERVER (grpc_static_slice_table()[91])
/* "set-cookie" */
#define GRPC_MDSTR_SET_COOKIE (grpc_static_slice_table[91])
#define GRPC_MDSTR_SET_COOKIE (grpc_static_slice_table()[92])
/* "strict-transport-security" */
#define GRPC_MDSTR_STRICT_TRANSPORT_SECURITY (grpc_static_slice_table[92])
#define GRPC_MDSTR_STRICT_TRANSPORT_SECURITY (grpc_static_slice_table()[93])
/* "transfer-encoding" */
#define GRPC_MDSTR_TRANSFER_ENCODING (grpc_static_slice_table[93])
#define GRPC_MDSTR_TRANSFER_ENCODING (grpc_static_slice_table()[94])
/* "vary" */
#define GRPC_MDSTR_VARY (grpc_static_slice_table[94])
#define GRPC_MDSTR_VARY (grpc_static_slice_table()[95])
/* "via" */
#define GRPC_MDSTR_VIA (grpc_static_slice_table[95])
#define GRPC_MDSTR_VIA (grpc_static_slice_table()[96])
/* "www-authenticate" */
#define GRPC_MDSTR_WWW_AUTHENTICATE (grpc_static_slice_table[96])
#define GRPC_MDSTR_WWW_AUTHENTICATE (grpc_static_slice_table()[97])
/* "0" */
#define GRPC_MDSTR_0 (grpc_static_slice_table[97])
#define GRPC_MDSTR_0 (grpc_static_slice_table()[98])
/* "identity" */
#define GRPC_MDSTR_IDENTITY (grpc_static_slice_table[98])
#define GRPC_MDSTR_IDENTITY (grpc_static_slice_table()[99])
/* "trailers" */
#define GRPC_MDSTR_TRAILERS (grpc_static_slice_table[99])
#define GRPC_MDSTR_TRAILERS (grpc_static_slice_table()[100])
/* "application/grpc" */
#define GRPC_MDSTR_APPLICATION_SLASH_GRPC (grpc_static_slice_table[100])
#define GRPC_MDSTR_APPLICATION_SLASH_GRPC (grpc_static_slice_table()[101])
/* "grpc" */
#define GRPC_MDSTR_GRPC (grpc_static_slice_table[101])
#define GRPC_MDSTR_GRPC (grpc_static_slice_table()[102])
/* "PUT" */
#define GRPC_MDSTR_PUT (grpc_static_slice_table[102])
#define GRPC_MDSTR_PUT (grpc_static_slice_table()[103])
/* "lb-cost-bin" */
#define GRPC_MDSTR_LB_COST_BIN (grpc_static_slice_table[103])
#define GRPC_MDSTR_LB_COST_BIN (grpc_static_slice_table()[104])
/* "identity,deflate" */
#define GRPC_MDSTR_IDENTITY_COMMA_DEFLATE (grpc_static_slice_table[104])
#define GRPC_MDSTR_IDENTITY_COMMA_DEFLATE (grpc_static_slice_table()[105])
/* "identity,gzip" */
#define GRPC_MDSTR_IDENTITY_COMMA_GZIP (grpc_static_slice_table[105])
#define GRPC_MDSTR_IDENTITY_COMMA_GZIP (grpc_static_slice_table()[106])
/* "deflate,gzip" */
#define GRPC_MDSTR_DEFLATE_COMMA_GZIP (grpc_static_slice_table[106])
#define GRPC_MDSTR_DEFLATE_COMMA_GZIP (grpc_static_slice_table()[107])
/* "identity,deflate,gzip" */
#define GRPC_MDSTR_IDENTITY_COMMA_DEFLATE_COMMA_GZIP \
(grpc_static_slice_table[107])
(grpc_static_slice_table()[108])
namespace grpc_core {
struct StaticSliceRefcount;
extern StaticSliceRefcount* g_static_metadata_slice_refcounts;
} // namespace grpc_core
inline grpc_core::StaticSliceRefcount* grpc_static_metadata_refcounts() {
GPR_DEBUG_ASSERT(grpc_core::StaticMetadataInitCanary() ==
grpc_core::kGrpcStaticMetadataInitCanary);
GPR_DEBUG_ASSERT(grpc_core::g_static_metadata_slice_refcounts != nullptr);
return grpc_core::g_static_metadata_slice_refcounts;
}
extern grpc_core::StaticSliceRefcount
grpc_static_metadata_refcounts[GRPC_STATIC_MDSTR_COUNT];
#define GRPC_IS_STATIC_METADATA_STRING(slice) \
((slice).refcount != NULL && \
(slice).refcount->GetType() == grpc_slice_refcount::Type::STATIC)
@ -280,196 +304,216 @@ extern grpc_core::StaticSliceRefcount
->index)
#define GRPC_STATIC_MDELEM_COUNT 85
extern grpc_core::StaticMetadata
grpc_static_mdelem_table[GRPC_STATIC_MDELEM_COUNT];
namespace grpc_core {
extern StaticMetadata* g_static_mdelem_table;
extern grpc_mdelem* g_static_mdelem_manifested;
} // namespace grpc_core
inline grpc_core::StaticMetadata* grpc_static_mdelem_table() {
GPR_DEBUG_ASSERT(grpc_core::StaticMetadataInitCanary() ==
grpc_core::kGrpcStaticMetadataInitCanary);
GPR_DEBUG_ASSERT(grpc_core::g_static_mdelem_table != nullptr);
return grpc_core::g_static_mdelem_table;
}
inline grpc_mdelem* grpc_static_mdelem_manifested() {
GPR_DEBUG_ASSERT(grpc_core::StaticMetadataInitCanary() ==
grpc_core::kGrpcStaticMetadataInitCanary);
GPR_DEBUG_ASSERT(grpc_core::g_static_mdelem_manifested != nullptr);
return grpc_core::g_static_mdelem_manifested;
}
extern uintptr_t grpc_static_mdelem_user_data[GRPC_STATIC_MDELEM_COUNT];
extern grpc_mdelem grpc_static_mdelem_manifested[GRPC_STATIC_MDELEM_COUNT];
/* ":authority": "" */
#define GRPC_MDELEM_AUTHORITY_EMPTY (grpc_static_mdelem_manifested[0])
#define GRPC_MDELEM_AUTHORITY_EMPTY (grpc_static_mdelem_manifested()[0])
/* ":method": "GET" */
#define GRPC_MDELEM_METHOD_GET (grpc_static_mdelem_manifested[1])
#define GRPC_MDELEM_METHOD_GET (grpc_static_mdelem_manifested()[1])
/* ":method": "POST" */
#define GRPC_MDELEM_METHOD_POST (grpc_static_mdelem_manifested[2])
#define GRPC_MDELEM_METHOD_POST (grpc_static_mdelem_manifested()[2])
/* ":path": "/" */
#define GRPC_MDELEM_PATH_SLASH (grpc_static_mdelem_manifested[3])
#define GRPC_MDELEM_PATH_SLASH (grpc_static_mdelem_manifested()[3])
/* ":path": "/index.html" */
#define GRPC_MDELEM_PATH_SLASH_INDEX_DOT_HTML (grpc_static_mdelem_manifested[4])
#define GRPC_MDELEM_PATH_SLASH_INDEX_DOT_HTML \
(grpc_static_mdelem_manifested()[4])
/* ":scheme": "http" */
#define GRPC_MDELEM_SCHEME_HTTP (grpc_static_mdelem_manifested[5])
#define GRPC_MDELEM_SCHEME_HTTP (grpc_static_mdelem_manifested()[5])
/* ":scheme": "https" */
#define GRPC_MDELEM_SCHEME_HTTPS (grpc_static_mdelem_manifested[6])
#define GRPC_MDELEM_SCHEME_HTTPS (grpc_static_mdelem_manifested()[6])
/* ":status": "200" */
#define GRPC_MDELEM_STATUS_200 (grpc_static_mdelem_manifested[7])
#define GRPC_MDELEM_STATUS_200 (grpc_static_mdelem_manifested()[7])
/* ":status": "204" */
#define GRPC_MDELEM_STATUS_204 (grpc_static_mdelem_manifested[8])
#define GRPC_MDELEM_STATUS_204 (grpc_static_mdelem_manifested()[8])
/* ":status": "206" */
#define GRPC_MDELEM_STATUS_206 (grpc_static_mdelem_manifested[9])
#define GRPC_MDELEM_STATUS_206 (grpc_static_mdelem_manifested()[9])
/* ":status": "304" */
#define GRPC_MDELEM_STATUS_304 (grpc_static_mdelem_manifested[10])
#define GRPC_MDELEM_STATUS_304 (grpc_static_mdelem_manifested()[10])
/* ":status": "400" */
#define GRPC_MDELEM_STATUS_400 (grpc_static_mdelem_manifested[11])
#define GRPC_MDELEM_STATUS_400 (grpc_static_mdelem_manifested()[11])
/* ":status": "404" */
#define GRPC_MDELEM_STATUS_404 (grpc_static_mdelem_manifested[12])
#define GRPC_MDELEM_STATUS_404 (grpc_static_mdelem_manifested()[12])
/* ":status": "500" */
#define GRPC_MDELEM_STATUS_500 (grpc_static_mdelem_manifested[13])
#define GRPC_MDELEM_STATUS_500 (grpc_static_mdelem_manifested()[13])
/* "accept-charset": "" */
#define GRPC_MDELEM_ACCEPT_CHARSET_EMPTY (grpc_static_mdelem_manifested[14])
#define GRPC_MDELEM_ACCEPT_CHARSET_EMPTY (grpc_static_mdelem_manifested()[14])
/* "accept-encoding": "gzip, deflate" */
#define GRPC_MDELEM_ACCEPT_ENCODING_GZIP_COMMA_DEFLATE \
(grpc_static_mdelem_manifested[15])
(grpc_static_mdelem_manifested()[15])
/* "accept-language": "" */
#define GRPC_MDELEM_ACCEPT_LANGUAGE_EMPTY (grpc_static_mdelem_manifested[16])
#define GRPC_MDELEM_ACCEPT_LANGUAGE_EMPTY (grpc_static_mdelem_manifested()[16])
/* "accept-ranges": "" */
#define GRPC_MDELEM_ACCEPT_RANGES_EMPTY (grpc_static_mdelem_manifested[17])
#define GRPC_MDELEM_ACCEPT_RANGES_EMPTY (grpc_static_mdelem_manifested()[17])
/* "accept": "" */
#define GRPC_MDELEM_ACCEPT_EMPTY (grpc_static_mdelem_manifested[18])
#define GRPC_MDELEM_ACCEPT_EMPTY (grpc_static_mdelem_manifested()[18])
/* "access-control-allow-origin": "" */
#define GRPC_MDELEM_ACCESS_CONTROL_ALLOW_ORIGIN_EMPTY \
(grpc_static_mdelem_manifested[19])
(grpc_static_mdelem_manifested()[19])
/* "age": "" */
#define GRPC_MDELEM_AGE_EMPTY (grpc_static_mdelem_manifested[20])
#define GRPC_MDELEM_AGE_EMPTY (grpc_static_mdelem_manifested()[20])
/* "allow": "" */
#define GRPC_MDELEM_ALLOW_EMPTY (grpc_static_mdelem_manifested[21])
#define GRPC_MDELEM_ALLOW_EMPTY (grpc_static_mdelem_manifested()[21])
/* "authorization": "" */
#define GRPC_MDELEM_AUTHORIZATION_EMPTY (grpc_static_mdelem_manifested[22])
#define GRPC_MDELEM_AUTHORIZATION_EMPTY (grpc_static_mdelem_manifested()[22])
/* "cache-control": "" */
#define GRPC_MDELEM_CACHE_CONTROL_EMPTY (grpc_static_mdelem_manifested[23])
#define GRPC_MDELEM_CACHE_CONTROL_EMPTY (grpc_static_mdelem_manifested()[23])
/* "content-disposition": "" */
#define GRPC_MDELEM_CONTENT_DISPOSITION_EMPTY \
(grpc_static_mdelem_manifested[24])
(grpc_static_mdelem_manifested()[24])
/* "content-encoding": "" */
#define GRPC_MDELEM_CONTENT_ENCODING_EMPTY (grpc_static_mdelem_manifested[25])
#define GRPC_MDELEM_CONTENT_ENCODING_EMPTY (grpc_static_mdelem_manifested()[25])
/* "content-language": "" */
#define GRPC_MDELEM_CONTENT_LANGUAGE_EMPTY (grpc_static_mdelem_manifested[26])
#define GRPC_MDELEM_CONTENT_LANGUAGE_EMPTY (grpc_static_mdelem_manifested()[26])
/* "content-length": "" */
#define GRPC_MDELEM_CONTENT_LENGTH_EMPTY (grpc_static_mdelem_manifested[27])
#define GRPC_MDELEM_CONTENT_LENGTH_EMPTY (grpc_static_mdelem_manifested()[27])
/* "content-location": "" */
#define GRPC_MDELEM_CONTENT_LOCATION_EMPTY (grpc_static_mdelem_manifested[28])
#define GRPC_MDELEM_CONTENT_LOCATION_EMPTY (grpc_static_mdelem_manifested()[28])
/* "content-range": "" */
#define GRPC_MDELEM_CONTENT_RANGE_EMPTY (grpc_static_mdelem_manifested[29])
#define GRPC_MDELEM_CONTENT_RANGE_EMPTY (grpc_static_mdelem_manifested()[29])
/* "content-type": "" */
#define GRPC_MDELEM_CONTENT_TYPE_EMPTY (grpc_static_mdelem_manifested[30])
#define GRPC_MDELEM_CONTENT_TYPE_EMPTY (grpc_static_mdelem_manifested()[30])
/* "cookie": "" */
#define GRPC_MDELEM_COOKIE_EMPTY (grpc_static_mdelem_manifested[31])
#define GRPC_MDELEM_COOKIE_EMPTY (grpc_static_mdelem_manifested()[31])
/* "date": "" */
#define GRPC_MDELEM_DATE_EMPTY (grpc_static_mdelem_manifested[32])
#define GRPC_MDELEM_DATE_EMPTY (grpc_static_mdelem_manifested()[32])
/* "etag": "" */
#define GRPC_MDELEM_ETAG_EMPTY (grpc_static_mdelem_manifested[33])
#define GRPC_MDELEM_ETAG_EMPTY (grpc_static_mdelem_manifested()[33])
/* "expect": "" */
#define GRPC_MDELEM_EXPECT_EMPTY (grpc_static_mdelem_manifested[34])
#define GRPC_MDELEM_EXPECT_EMPTY (grpc_static_mdelem_manifested()[34])
/* "expires": "" */
#define GRPC_MDELEM_EXPIRES_EMPTY (grpc_static_mdelem_manifested[35])
#define GRPC_MDELEM_EXPIRES_EMPTY (grpc_static_mdelem_manifested()[35])
/* "from": "" */
#define GRPC_MDELEM_FROM_EMPTY (grpc_static_mdelem_manifested[36])
#define GRPC_MDELEM_FROM_EMPTY (grpc_static_mdelem_manifested()[36])
/* "host": "" */
#define GRPC_MDELEM_HOST_EMPTY (grpc_static_mdelem_manifested[37])
#define GRPC_MDELEM_HOST_EMPTY (grpc_static_mdelem_manifested()[37])
/* "if-match": "" */
#define GRPC_MDELEM_IF_MATCH_EMPTY (grpc_static_mdelem_manifested[38])
#define GRPC_MDELEM_IF_MATCH_EMPTY (grpc_static_mdelem_manifested()[38])
/* "if-modified-since": "" */
#define GRPC_MDELEM_IF_MODIFIED_SINCE_EMPTY (grpc_static_mdelem_manifested[39])
#define GRPC_MDELEM_IF_MODIFIED_SINCE_EMPTY \
(grpc_static_mdelem_manifested()[39])
/* "if-none-match": "" */
#define GRPC_MDELEM_IF_NONE_MATCH_EMPTY (grpc_static_mdelem_manifested[40])
#define GRPC_MDELEM_IF_NONE_MATCH_EMPTY (grpc_static_mdelem_manifested()[40])
/* "if-range": "" */
#define GRPC_MDELEM_IF_RANGE_EMPTY (grpc_static_mdelem_manifested[41])
#define GRPC_MDELEM_IF_RANGE_EMPTY (grpc_static_mdelem_manifested()[41])
/* "if-unmodified-since": "" */
#define GRPC_MDELEM_IF_UNMODIFIED_SINCE_EMPTY \
(grpc_static_mdelem_manifested[42])
(grpc_static_mdelem_manifested()[42])
/* "last-modified": "" */
#define GRPC_MDELEM_LAST_MODIFIED_EMPTY (grpc_static_mdelem_manifested[43])
#define GRPC_MDELEM_LAST_MODIFIED_EMPTY (grpc_static_mdelem_manifested()[43])
/* "link": "" */
#define GRPC_MDELEM_LINK_EMPTY (grpc_static_mdelem_manifested[44])
#define GRPC_MDELEM_LINK_EMPTY (grpc_static_mdelem_manifested()[44])
/* "location": "" */
#define GRPC_MDELEM_LOCATION_EMPTY (grpc_static_mdelem_manifested[45])
#define GRPC_MDELEM_LOCATION_EMPTY (grpc_static_mdelem_manifested()[45])
/* "max-forwards": "" */
#define GRPC_MDELEM_MAX_FORWARDS_EMPTY (grpc_static_mdelem_manifested[46])
#define GRPC_MDELEM_MAX_FORWARDS_EMPTY (grpc_static_mdelem_manifested()[46])
/* "proxy-authenticate": "" */
#define GRPC_MDELEM_PROXY_AUTHENTICATE_EMPTY (grpc_static_mdelem_manifested[47])
#define GRPC_MDELEM_PROXY_AUTHENTICATE_EMPTY \
(grpc_static_mdelem_manifested()[47])
/* "proxy-authorization": "" */
#define GRPC_MDELEM_PROXY_AUTHORIZATION_EMPTY \
(grpc_static_mdelem_manifested[48])
(grpc_static_mdelem_manifested()[48])
/* "range": "" */
#define GRPC_MDELEM_RANGE_EMPTY (grpc_static_mdelem_manifested[49])
#define GRPC_MDELEM_RANGE_EMPTY (grpc_static_mdelem_manifested()[49])
/* "referer": "" */
#define GRPC_MDELEM_REFERER_EMPTY (grpc_static_mdelem_manifested[50])
#define GRPC_MDELEM_REFERER_EMPTY (grpc_static_mdelem_manifested()[50])
/* "refresh": "" */
#define GRPC_MDELEM_REFRESH_EMPTY (grpc_static_mdelem_manifested[51])
#define GRPC_MDELEM_REFRESH_EMPTY (grpc_static_mdelem_manifested()[51])
/* "retry-after": "" */
#define GRPC_MDELEM_RETRY_AFTER_EMPTY (grpc_static_mdelem_manifested[52])
#define GRPC_MDELEM_RETRY_AFTER_EMPTY (grpc_static_mdelem_manifested()[52])
/* "server": "" */
#define GRPC_MDELEM_SERVER_EMPTY (grpc_static_mdelem_manifested[53])
#define GRPC_MDELEM_SERVER_EMPTY (grpc_static_mdelem_manifested()[53])
/* "set-cookie": "" */
#define GRPC_MDELEM_SET_COOKIE_EMPTY (grpc_static_mdelem_manifested[54])
#define GRPC_MDELEM_SET_COOKIE_EMPTY (grpc_static_mdelem_manifested()[54])
/* "strict-transport-security": "" */
#define GRPC_MDELEM_STRICT_TRANSPORT_SECURITY_EMPTY \
(grpc_static_mdelem_manifested[55])
(grpc_static_mdelem_manifested()[55])
/* "transfer-encoding": "" */
#define GRPC_MDELEM_TRANSFER_ENCODING_EMPTY (grpc_static_mdelem_manifested[56])
#define GRPC_MDELEM_TRANSFER_ENCODING_EMPTY \
(grpc_static_mdelem_manifested()[56])
/* "user-agent": "" */
#define GRPC_MDELEM_USER_AGENT_EMPTY (grpc_static_mdelem_manifested[57])
#define GRPC_MDELEM_USER_AGENT_EMPTY (grpc_static_mdelem_manifested()[57])
/* "vary": "" */
#define GRPC_MDELEM_VARY_EMPTY (grpc_static_mdelem_manifested[58])
#define GRPC_MDELEM_VARY_EMPTY (grpc_static_mdelem_manifested()[58])
/* "via": "" */
#define GRPC_MDELEM_VIA_EMPTY (grpc_static_mdelem_manifested[59])
#define GRPC_MDELEM_VIA_EMPTY (grpc_static_mdelem_manifested()[59])
/* "www-authenticate": "" */
#define GRPC_MDELEM_WWW_AUTHENTICATE_EMPTY (grpc_static_mdelem_manifested[60])
#define GRPC_MDELEM_WWW_AUTHENTICATE_EMPTY (grpc_static_mdelem_manifested()[60])
/* "grpc-status": "0" */
#define GRPC_MDELEM_GRPC_STATUS_0 (grpc_static_mdelem_manifested[61])
#define GRPC_MDELEM_GRPC_STATUS_0 (grpc_static_mdelem_manifested()[61])
/* "grpc-status": "1" */
#define GRPC_MDELEM_GRPC_STATUS_1 (grpc_static_mdelem_manifested[62])
#define GRPC_MDELEM_GRPC_STATUS_1 (grpc_static_mdelem_manifested()[62])
/* "grpc-status": "2" */
#define GRPC_MDELEM_GRPC_STATUS_2 (grpc_static_mdelem_manifested[63])
#define GRPC_MDELEM_GRPC_STATUS_2 (grpc_static_mdelem_manifested()[63])
/* "grpc-encoding": "identity" */
#define GRPC_MDELEM_GRPC_ENCODING_IDENTITY (grpc_static_mdelem_manifested[64])
#define GRPC_MDELEM_GRPC_ENCODING_IDENTITY (grpc_static_mdelem_manifested()[64])
/* "grpc-encoding": "gzip" */
#define GRPC_MDELEM_GRPC_ENCODING_GZIP (grpc_static_mdelem_manifested[65])
#define GRPC_MDELEM_GRPC_ENCODING_GZIP (grpc_static_mdelem_manifested()[65])
/* "grpc-encoding": "deflate" */
#define GRPC_MDELEM_GRPC_ENCODING_DEFLATE (grpc_static_mdelem_manifested[66])
#define GRPC_MDELEM_GRPC_ENCODING_DEFLATE (grpc_static_mdelem_manifested()[66])
/* "te": "trailers" */
#define GRPC_MDELEM_TE_TRAILERS (grpc_static_mdelem_manifested[67])
#define GRPC_MDELEM_TE_TRAILERS (grpc_static_mdelem_manifested()[67])
/* "content-type": "application/grpc" */
#define GRPC_MDELEM_CONTENT_TYPE_APPLICATION_SLASH_GRPC \
(grpc_static_mdelem_manifested[68])
(grpc_static_mdelem_manifested()[68])
/* ":scheme": "grpc" */
#define GRPC_MDELEM_SCHEME_GRPC (grpc_static_mdelem_manifested[69])
#define GRPC_MDELEM_SCHEME_GRPC (grpc_static_mdelem_manifested()[69])
/* ":method": "PUT" */
#define GRPC_MDELEM_METHOD_PUT (grpc_static_mdelem_manifested[70])
#define GRPC_MDELEM_METHOD_PUT (grpc_static_mdelem_manifested()[70])
/* "accept-encoding": "" */
#define GRPC_MDELEM_ACCEPT_ENCODING_EMPTY (grpc_static_mdelem_manifested[71])
#define GRPC_MDELEM_ACCEPT_ENCODING_EMPTY (grpc_static_mdelem_manifested()[71])
/* "content-encoding": "identity" */
#define GRPC_MDELEM_CONTENT_ENCODING_IDENTITY \
(grpc_static_mdelem_manifested[72])
(grpc_static_mdelem_manifested()[72])
/* "content-encoding": "gzip" */
#define GRPC_MDELEM_CONTENT_ENCODING_GZIP (grpc_static_mdelem_manifested[73])
#define GRPC_MDELEM_CONTENT_ENCODING_GZIP (grpc_static_mdelem_manifested()[73])
/* "lb-cost-bin": "" */
#define GRPC_MDELEM_LB_COST_BIN_EMPTY (grpc_static_mdelem_manifested[74])
#define GRPC_MDELEM_LB_COST_BIN_EMPTY (grpc_static_mdelem_manifested()[74])
/* "grpc-accept-encoding": "identity" */
#define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_IDENTITY \
(grpc_static_mdelem_manifested[75])
(grpc_static_mdelem_manifested()[75])
/* "grpc-accept-encoding": "deflate" */
#define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_DEFLATE \
(grpc_static_mdelem_manifested[76])
(grpc_static_mdelem_manifested()[76])
/* "grpc-accept-encoding": "identity,deflate" */
#define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_IDENTITY_COMMA_DEFLATE \
(grpc_static_mdelem_manifested[77])
(grpc_static_mdelem_manifested()[77])
/* "grpc-accept-encoding": "gzip" */
#define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_GZIP \
(grpc_static_mdelem_manifested[78])
(grpc_static_mdelem_manifested()[78])
/* "grpc-accept-encoding": "identity,gzip" */
#define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_IDENTITY_COMMA_GZIP \
(grpc_static_mdelem_manifested[79])
(grpc_static_mdelem_manifested()[79])
/* "grpc-accept-encoding": "deflate,gzip" */
#define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_DEFLATE_COMMA_GZIP \
(grpc_static_mdelem_manifested[80])
(grpc_static_mdelem_manifested()[80])
/* "grpc-accept-encoding": "identity,deflate,gzip" */
#define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_IDENTITY_COMMA_DEFLATE_COMMA_GZIP \
(grpc_static_mdelem_manifested[81])
(grpc_static_mdelem_manifested()[81])
/* "accept-encoding": "identity" */
#define GRPC_MDELEM_ACCEPT_ENCODING_IDENTITY (grpc_static_mdelem_manifested[82])
#define GRPC_MDELEM_ACCEPT_ENCODING_IDENTITY \
(grpc_static_mdelem_manifested()[82])
/* "accept-encoding": "gzip" */
#define GRPC_MDELEM_ACCEPT_ENCODING_GZIP (grpc_static_mdelem_manifested[83])
#define GRPC_MDELEM_ACCEPT_ENCODING_GZIP (grpc_static_mdelem_manifested()[83])
/* "accept-encoding": "identity,gzip" */
#define GRPC_MDELEM_ACCEPT_ENCODING_IDENTITY_COMMA_GZIP \
(grpc_static_mdelem_manifested[84])
(grpc_static_mdelem_manifested()[84])
grpc_mdelem grpc_static_mdelem_for_static_strings(intptr_t a, intptr_t b);
typedef enum {
@ -496,6 +540,7 @@ typedef enum {
GRPC_BATCH_HOST,
GRPC_BATCH_GRPC_PREVIOUS_RPC_ATTEMPTS,
GRPC_BATCH_GRPC_RETRY_PUSHBACK_MS,
GRPC_BATCH_X_ENDPOINT_LOAD_METRICS_BIN,
GRPC_BATCH_CALLOUTS_COUNT
} grpc_metadata_batch_callouts_index;
@ -525,6 +570,7 @@ typedef union {
struct grpc_linked_mdelem* host;
struct grpc_linked_mdelem* grpc_previous_rpc_attempts;
struct grpc_linked_mdelem* grpc_retry_pushback_ms;
struct grpc_linked_mdelem* x_endpoint_load_metrics_bin;
} named;
} grpc_metadata_batch_callouts;
@ -539,15 +585,15 @@ typedef union {
: GRPC_BATCH_CALLOUTS_COUNT)
extern const uint8_t grpc_static_accept_encoding_metadata[8];
#define GRPC_MDELEM_ACCEPT_ENCODING_FOR_ALGORITHMS(algs) \
(GRPC_MAKE_MDELEM( \
&grpc_static_mdelem_table[grpc_static_accept_encoding_metadata[(algs)]] \
.data(), \
GRPC_MDELEM_STORAGE_STATIC))
#define GRPC_MDELEM_ACCEPT_ENCODING_FOR_ALGORITHMS(algs) \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table() \
[grpc_static_accept_encoding_metadata[(algs)]] \
.data(), \
GRPC_MDELEM_STORAGE_STATIC))
extern const uint8_t grpc_static_accept_stream_encoding_metadata[4];
#define GRPC_MDELEM_ACCEPT_STREAM_ENCODING_FOR_ALGORITHMS(algs) \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table() \
[grpc_static_accept_stream_encoding_metadata[(algs)]] \
.data(), \
GRPC_MDELEM_STORAGE_STATIC))

@ -38,7 +38,7 @@ std::shared_ptr<grpc::Channel> CreateCustomChannelImpl(
const std::shared_ptr<grpc::ChannelCredentials>& creds,
const grpc::ChannelArguments& args) {
grpc::GrpcLibraryCodegen
init_lib; // We need to call init in case of a bad creds.
init_lib; // We need to call init in case of bad creds.
return creds ? creds->CreateChannelImpl(target, args)
: grpc::CreateChannelInternal(
"",
@ -69,6 +69,8 @@ std::shared_ptr<grpc::Channel> CreateCustomChannelWithInterceptors(
std::vector<
std::unique_ptr<grpc::experimental::ClientInterceptorFactoryInterface>>
interceptor_creators) {
grpc::GrpcLibraryCodegen
init_lib; // We need to call init in case of bad creds.
return creds ? creds->CreateChannelWithInterceptors(
target, args, std::move(interceptor_creators))
: grpc::CreateChannelInternal(

@ -22,6 +22,7 @@
#include <grpcpp/server_context.h>
#include "opencensus/tags/tag_key.h"
#include "opencensus/trace/span.h"
#include "src/cpp/ext/filters/census/channel_filter.h"
#include "src/cpp/ext/filters/census/client_filter.h"
@ -33,27 +34,27 @@ namespace grpc {
// These measure definitions should be kept in sync across opencensus
// implementations--see
// https://github.com/census-instrumentation/opencensus-java/blob/master/contrib/grpc_metrics/src/main/java/io/opencensus/contrib/grpc/metrics/RpcMeasureConstants.java.
::opencensus::stats::TagKey ClientMethodTagKey() {
::opencensus::tags::TagKey ClientMethodTagKey() {
static const auto method_tag_key =
::opencensus::stats::TagKey::Register("grpc_client_method");
::opencensus::tags::TagKey::Register("grpc_client_method");
return method_tag_key;
}
::opencensus::stats::TagKey ClientStatusTagKey() {
::opencensus::tags::TagKey ClientStatusTagKey() {
static const auto status_tag_key =
::opencensus::stats::TagKey::Register("grpc_client_status");
::opencensus::tags::TagKey::Register("grpc_client_status");
return status_tag_key;
}
::opencensus::stats::TagKey ServerMethodTagKey() {
::opencensus::tags::TagKey ServerMethodTagKey() {
static const auto method_tag_key =
::opencensus::stats::TagKey::Register("grpc_server_method");
::opencensus::tags::TagKey::Register("grpc_server_method");
return method_tag_key;
}
::opencensus::stats::TagKey ServerStatusTagKey() {
::opencensus::tags::TagKey ServerStatusTagKey() {
static const auto status_tag_key =
::opencensus::stats::TagKey::Register("grpc_server_status");
::opencensus::tags::TagKey::Register("grpc_server_status");
return status_tag_key;
}

@ -24,6 +24,7 @@
#include "absl/strings/string_view.h"
#include "include/grpcpp/opencensus.h"
#include "opencensus/stats/stats.h"
#include "opencensus/tags/tag_key.h"
namespace grpc_impl {
class ServerContext;
@ -32,10 +33,10 @@ class ServerContext;
namespace grpc {
// The tag keys set when recording RPC stats.
::opencensus::stats::TagKey ClientMethodTagKey();
::opencensus::stats::TagKey ClientStatusTagKey();
::opencensus::stats::TagKey ServerMethodTagKey();
::opencensus::stats::TagKey ServerStatusTagKey();
::opencensus::tags::TagKey ClientMethodTagKey();
::opencensus::tags::TagKey ClientStatusTagKey();
::opencensus::tags::TagKey ServerMethodTagKey();
::opencensus::tags::TagKey ServerStatusTagKey();
// Names of measures used by the plugin--users can create views on these
// measures but should not record data for them.

@ -29,6 +29,7 @@
#include "src/cpp/server/load_reporter/load_reporter.h"
#include "opencensus/stats/internal/set_aggregation_window.h"
#include "opencensus/tags/tag_key.h"
namespace grpc {
namespace load_reporter {
@ -38,12 +39,12 @@ CpuStatsProvider::CpuStatsSample CpuStatsProviderDefaultImpl::GetCpuStats() {
}
CensusViewProvider::CensusViewProvider()
: tag_key_token_(::opencensus::stats::TagKey::Register(kTagKeyToken)),
tag_key_host_(::opencensus::stats::TagKey::Register(kTagKeyHost)),
tag_key_user_id_(::opencensus::stats::TagKey::Register(kTagKeyUserId)),
tag_key_status_(::opencensus::stats::TagKey::Register(kTagKeyStatus)),
: tag_key_token_(::opencensus::tags::TagKey::Register(kTagKeyToken)),
tag_key_host_(::opencensus::tags::TagKey::Register(kTagKeyHost)),
tag_key_user_id_(::opencensus::tags::TagKey::Register(kTagKeyUserId)),
tag_key_status_(::opencensus::tags::TagKey::Register(kTagKeyStatus)),
tag_key_metric_name_(
::opencensus::stats::TagKey::Register(kTagKeyMetricName)) {
::opencensus::tags::TagKey::Register(kTagKeyMetricName)) {
// One view related to starting a call.
auto vd_start_count =
::opencensus::stats::ViewDescriptor()

@ -34,6 +34,7 @@
#include "src/proto/grpc/lb/v1/load_reporter.grpc.pb.h"
#include "opencensus/stats/stats.h"
#include "opencensus/tags/tag_key.h"
namespace grpc {
namespace load_reporter {
@ -75,11 +76,11 @@ class CensusViewProvider {
private:
ViewDescriptorMap view_descriptor_map_;
// Tag keys.
::opencensus::stats::TagKey tag_key_token_;
::opencensus::stats::TagKey tag_key_host_;
::opencensus::stats::TagKey tag_key_user_id_;
::opencensus::stats::TagKey tag_key_status_;
::opencensus::stats::TagKey tag_key_metric_name_;
::opencensus::tags::TagKey tag_key_token_;
::opencensus::tags::TagKey tag_key_host_;
::opencensus::tags::TagKey tag_key_user_id_;
::opencensus::tags::TagKey tag_key_status_;
::opencensus::tags::TagKey tag_key_metric_name_;
};
// The default implementation fetches the real stats from Census.

@ -18,30 +18,24 @@ licenses(["notice"]) # Apache v2
package(default_visibility = ["//visibility:public"])
load("//bazel:grpc_build_system.bzl", "grpc_objc_library", "grpc_generate_objc_one_off_targets")
load("//bazel:grpc_build_system.bzl", "grpc_objc_library", "grpc_objc_use_cronet_config")
exports_files(["LICENSE"])
grpc_generate_objc_one_off_targets()
grpc_objc_library(
name = "rx_library_headers",
hdrs = glob([
"RxLibrary/*.h",
]),
includes = ["."],
)
grpc_objc_use_cronet_config()
grpc_objc_library(
name = "rx_library",
srcs = glob([
"RxLibrary/*.m",
"RxLibrary/transformations/*.m",
]),
hdrs = glob([
"RxLibrary/*.h",
"RxLibrary/transformations/*.h",
]),
includes = ["."],
deps = [
":rx_library_headers",
":rx_library_private",
],
deps = [":rx_library_private"],
)
grpc_objc_library(
@ -56,196 +50,84 @@ grpc_objc_library(
)
grpc_objc_library(
name = "grpc_objc_interface_legacy",
hdrs = [
"GRPCClient/GRPCCall+ChannelArg.h",
"GRPCClient/GRPCCall+ChannelCredentials.h",
"GRPCClient/GRPCCall+Cronet.h",
"GRPCClient/GRPCCall+OAuth2.h",
"GRPCClient/GRPCCall+Tests.h",
"GRPCClient/GRPCCallLegacy.h",
"GRPCClient/GRPCTypes.h",
],
deps = [
"rx_library_headers",
],
)
grpc_objc_library(
name = "grpc_objc_interface",
hdrs = [
"GRPCClient/GRPCCall.h",
"GRPCClient/GRPCCall+Interceptor.h",
"GRPCClient/GRPCCallOptions.h",
"GRPCClient/GRPCInterceptor.h",
"GRPCClient/GRPCTransport.h",
"GRPCClient/GRPCDispatchable.h",
"GRPCClient/internal/GRPCCallOptions+Internal.h",
"GRPCClient/version.h",
],
srcs = [
"GRPCClient/GRPCCall.m",
"GRPCClient/GRPCCall+Interceptor.m",
"GRPCClient/GRPCCallOptions.m",
"GRPCClient/GRPCInterceptor.m",
"GRPCClient/GRPCTransport.m",
"GRPCClient/private/GRPCTransport+Private.m",
],
includes = ["."],
textual_hdrs = [
"GRPCClient/private/GRPCTransport+Private.h",
],
deps = [
":grpc_objc_interface_legacy",
],
)
grpc_objc_library(
name = "grpc_objc_client_core",
hdrs = [
"GRPCClient/GRPCCall+ChannelCredentials.h",
"GRPCClient/GRPCCall+Cronet.h",
"GRPCClient/GRPCCall+OAuth2.h",
"GRPCClient/GRPCCall+Tests.h",
"GRPCClient/GRPCCall+ChannelArg.h",
],
textual_hdrs = glob(["GRPCClient/private/GRPCCore/*.h"]),
srcs = [
"GRPCClient/GRPCCall+ChannelArg.m",
"GRPCClient/GRPCCall+ChannelCredentials.m",
"GRPCClient/GRPCCall+Cronet.m",
"GRPCClient/GRPCCall+OAuth2.m",
"GRPCClient/GRPCCall+Tests.m",
"GRPCClient/GRPCCallLegacy.m",
] + glob(["GRPCClient/private/GRPCCore/*.m"]),
data = [":gRPCCertificates"],
name = "grpc_objc_client",
srcs = glob(
[
"GRPCClient/*.m",
"GRPCClient/private/*.m",
],
exclude = ["GRPCClient/GRPCCall+GID.m"],
),
hdrs = glob(
[
"GRPCClient/*.h",
"GRPCClient/internal/*.h",
],
exclude = ["GRPCClient/GRPCCall+GID.h"],
),
data = ["//:gRPCCertificates"],
includes = ["."],
textual_hdrs = glob([
"GRPCClient/private/*.h",
]),
deps = [
":grpc_objc_interface",
":grpc_objc_interface_legacy",
":rx_library",
"//:grpc_objc",
],
)
alias(
name = "grpc_objc_client",
actual = "grpc_objc_client_core",
)
grpc_objc_library(
name = "proto_objc_rpc_legacy_header",
hdrs = [
"ProtoRPC/ProtoRPCLegacy.h",
],
includes = ["."],
)
grpc_objc_library(
name = "proto_objc_rpc_v2",
srcs = [
"ProtoRPC/ProtoMethod.m",
"ProtoRPC/ProtoRPC.m",
"ProtoRPC/ProtoService.m",
],
hdrs = [
"ProtoRPC/ProtoMethod.h",
"ProtoRPC/ProtoRPC.h",
"ProtoRPC/ProtoService.h",
],
includes = ["."],
defines = ["GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=0"],
deps = [
":grpc_objc_interface",
":proto_objc_rpc_legacy_header",
"@com_google_protobuf//:protobuf_objc",
],
)
grpc_objc_library(
name = "proto_objc_rpc",
srcs = [
"ProtoRPC/ProtoRPCLegacy.m",
"ProtoRPC/ProtoServiceLegacy.m",
],
hdrs = [
"ProtoRPC/ProtoMethod.h",
"ProtoRPC/ProtoRPCLegacy.h",
"ProtoRPC/ProtoService.h",
],
srcs = glob(
["ProtoRPC/*.m"],
),
hdrs = glob(
["ProtoRPC/*.h"],
),
# Different from Cocoapods, do not import as if @com_google_protobuf//:protobuf_objc is a framework,
# use the real paths of @com_google_protobuf//:protobuf_objc instead
defines = ["GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=0"],
deps = [
":grpc_objc_client",
":rx_library",
":proto_objc_rpc_v2",
":proto_objc_rpc_legacy_header",
":grpc_objc_client_core",
"@com_google_protobuf//:protobuf_objc",
],
)
load("@build_bazel_rules_apple//apple:resources.bzl", "apple_resource_bundle")
apple_resource_bundle(
# The choice of name is signicant here, since it determines the bundle name.
name = "gRPCCertificates",
resources = ["//:etc/roots.pem"],
)
# Internal target combining grpc_objc_client_core and proto_objc_rpc for testing
grpc_objc_library(
name = "grpc_objc_client_core_internal_testing",
hdrs = [
"GRPCClient/GRPCCall+ChannelCredentials.h",
"GRPCClient/GRPCCall+Cronet.h",
"GRPCClient/GRPCCall+OAuth2.h",
"GRPCClient/GRPCCall+Tests.h",
"GRPCClient/GRPCCall+ChannelArg.h",
"GRPCClient/internal_testing/GRPCCall+InternalTests.h",
],
textual_hdrs = glob(["GRPCClient/private/GRPCCore/*.h"]),
srcs = [
"GRPCClient/GRPCCall+ChannelArg.m",
"GRPCClient/GRPCCall+ChannelCredentials.m",
"GRPCClient/GRPCCall+Cronet.m",
"GRPCClient/GRPCCall+OAuth2.m",
"GRPCClient/GRPCCall+Tests.m",
"GRPCClient/GRPCCallLegacy.m",
"GRPCClient/internal_testing/GRPCCall+InternalTests.m",
] + glob(["GRPCClient/private/GRPCCore/*.m"]),
data = [":gRPCCertificates"],
name = "grpc_objc_client_internal_testing",
srcs = glob(
[
"GRPCClient/*.m",
"GRPCClient/private/*.m",
"GRPCClient/internal_testing/*.m",
"ProtoRPC/*.m",
],
exclude = ["GRPCClient/GRPCCall+GID.m"],
),
hdrs = glob(
[
"GRPCClient/*.h",
"GRPCClient/internal/*.h",
"GRPCClient/internal_testing/*.h",
"ProtoRPC/*.h",
],
exclude = ["GRPCClient/GRPCCall+GID.h"],
),
includes = ["."],
data = ["//:gRPCCertificates"],
defines = [
"GRPC_TEST_OBJC=1",
"GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=0",
],
textual_hdrs = glob(
[
"GRPCClient/private/*.h",
],
),
deps = [
":grpc_objc_interface",
":grpc_objc_interface_legacy",
":rx_library",
"//:grpc_objc",
],
)
grpc_objc_library(
name = "proto_objc_rpc_internal_testing",
srcs = [
"ProtoRPC/ProtoRPCLegacy.m",
"ProtoRPC/ProtoServiceLegacy.m",
],
hdrs = [
"ProtoRPC/ProtoMethod.h",
"ProtoRPC/ProtoRPC.h",
"ProtoRPC/ProtoRPCLegacy.h",
"ProtoRPC/ProtoService.h",
],
deps = [
":rx_library",
":proto_objc_rpc_v2",
":proto_objc_rpc_legacy_header",
":grpc_objc_client_core_internal_testing",
"@com_google_protobuf//:protobuf_objc",
],
)
alias(
name = "grpc_objc_client_internal_testing",
actual = "proto_objc_rpc_internal_testing",
)

@ -15,7 +15,7 @@
* limitations under the License.
*
*/
#import "GRPCCallLegacy.h"
#import "GRPCCall.h"
#include <AvailabilityMacros.h>

@ -18,8 +18,8 @@
#import "GRPCCall+ChannelArg.h"
#import "private/GRPCCore/GRPCChannelPool.h"
#import "private/GRPCCore/GRPCHost.h"
#import "private/GRPCChannelPool.h"
#import "private/GRPCHost.h"
#import <grpc/impl/codegen/compression_types.h>

@ -16,7 +16,7 @@
*
*/
#import "GRPCCallLegacy.h"
#import "GRPCCall.h"
// Deprecated interface. Please use GRPCCallOptions instead.
@interface GRPCCall (ChannelCredentials)

@ -18,7 +18,7 @@
#import "GRPCCall+ChannelCredentials.h"
#import "private/GRPCCore/GRPCHost.h"
#import "private/GRPCHost.h"
@implementation GRPCCall (ChannelCredentials)

@ -15,16 +15,12 @@
* limitations under the License.
*
*/
#ifdef GRPC_COMPILE_WITH_CRONET
#import <Cronet/Cronet.h>
#import "GRPCCallLegacy.h"
#import "GRPCTypes.h"
#import "GRPCCall.h"
typedef struct stream_engine stream_engine;
// Transport id for Cronet transport
extern const GRPCTransportId gGRPCCoreCronetId;
// Deprecated class. Please use the gGRPCCoreCronetId with GRPCCallOptions.transport instead.
// Deprecated interface. Please use GRPCCallOptions instead.
@interface GRPCCall (Cronet)
+ (void)useCronetWithEngine:(stream_engine*)engine;
@ -32,3 +28,4 @@ extern const GRPCTransportId gGRPCCoreCronetId;
+ (BOOL)isUsingCronet;
@end
#endif

@ -18,8 +18,7 @@
#import "GRPCCall+Cronet.h"
const GRPCTransportId gGRPCCoreCronetId = "io.grpc.transport.core.cronet";
#ifdef GRPC_COMPILE_WITH_CRONET
static BOOL useCronet = NO;
static stream_engine *globalCronetEngine;
@ -39,3 +38,4 @@ static stream_engine *globalCronetEngine;
}
@end
#endif

@ -17,7 +17,7 @@
*/
#import "GRPCCall+OAuth2.h"
#import "GRPCCallLegacy.h"
#import "GRPCCall.h"
#import <Google/SignIn.h>

@ -16,9 +16,9 @@
*
*/
#import "GRPCCallLegacy.h"
#import "GRPCCall.h"
@protocol GRPCAuthorizationProtocol;
#import "GRPCCallOptions.h"
// Deprecated interface. Please use GRPCCallOptions instead.
@interface GRPCCall (OAuth2)

@ -16,7 +16,7 @@
*
*/
#import "GRPCCallLegacy.h"
#import "GRPCCall.h"
// Deprecated interface. Please use GRPCCallOptions instead.
@interface GRPCCall (Tests)

@ -18,7 +18,7 @@
#import "GRPCCall+Tests.h"
#import "private/GRPCCore/GRPCHost.h"
#import "private/GRPCHost.h"
#import "GRPCCallOptions.h"

@ -33,19 +33,134 @@
*/
#import <Foundation/Foundation.h>
#import <RxLibrary/GRXWriter.h>
#import "GRPCCallOptions.h"
#import "GRPCDispatchable.h"
#import "GRPCTypes.h"
#include <AvailabilityMacros.h>
// The legacy header is included for backwards compatibility. Some V1 API users are still using
// GRPCCall by importing GRPCCall.h header so we need this import.
#import "GRPCCallLegacy.h"
#include "GRPCCallOptions.h"
NS_ASSUME_NONNULL_BEGIN
#pragma mark gRPC errors
/** Domain of NSError objects produced by gRPC. */
extern NSString *const kGRPCErrorDomain;
/**
* gRPC error codes.
* Note that a few of these are never produced by the gRPC libraries, but are of general utility for
* server applications to produce.
*/
typedef NS_ENUM(NSUInteger, GRPCErrorCode) {
/** The operation was cancelled (typically by the caller). */
GRPCErrorCodeCancelled = 1,
/**
* Unknown error. Errors raised by APIs that do not return enough error information may be
* converted to this error.
*/
GRPCErrorCodeUnknown = 2,
/**
* The client specified an invalid argument. Note that this differs from FAILED_PRECONDITION.
* INVALID_ARGUMENT indicates arguments that are problematic regardless of the state of the
* server (e.g., a malformed file name).
*/
GRPCErrorCodeInvalidArgument = 3,
/**
* Deadline expired before operation could complete. For operations that change the state of the
* server, this error may be returned even if the operation has completed successfully. For
* example, a successful response from the server could have been delayed long enough for the
* deadline to expire.
*/
GRPCErrorCodeDeadlineExceeded = 4,
/** Some requested entity (e.g., file or directory) was not found. */
GRPCErrorCodeNotFound = 5,
/** Some entity that we attempted to create (e.g., file or directory) already exists. */
GRPCErrorCodeAlreadyExists = 6,
/**
* The caller does not have permission to execute the specified operation. PERMISSION_DENIED isn't
* used for rejections caused by exhausting some resource (RESOURCE_EXHAUSTED is used instead for
* those errors). PERMISSION_DENIED doesn't indicate a failure to identify the caller
* (UNAUTHENTICATED is used instead for those errors).
*/
GRPCErrorCodePermissionDenied = 7,
/**
* The request does not have valid authentication credentials for the operation (e.g. the caller's
* identity can't be verified).
*/
GRPCErrorCodeUnauthenticated = 16,
/** Some resource has been exhausted, perhaps a per-user quota. */
GRPCErrorCodeResourceExhausted = 8,
/**
* The RPC was rejected because the server is not in a state required for the procedure's
* execution. For example, a directory to be deleted may be non-empty, etc.
* The client should not retry until the server state has been explicitly fixed (e.g. by
* performing another RPC). The details depend on the service being called, and should be found in
* the NSError's userInfo.
*/
GRPCErrorCodeFailedPrecondition = 9,
/**
* The RPC was aborted, typically due to a concurrency issue like sequencer check failures,
* transaction aborts, etc. The client should retry at a higher-level (e.g., restarting a read-
* modify-write sequence).
*/
GRPCErrorCodeAborted = 10,
/**
* The RPC was attempted past the valid range. E.g., enumerating past the end of a list.
* Unlike INVALID_ARGUMENT, this error indicates a problem that may be fixed if the system state
* changes. For example, an RPC to get elements of a list will generate INVALID_ARGUMENT if asked
* to return the element at a negative index, but it will generate OUT_OF_RANGE if asked to return
* the element at an index past the current size of the list.
*/
GRPCErrorCodeOutOfRange = 11,
/** The procedure is not implemented or not supported/enabled in this server. */
GRPCErrorCodeUnimplemented = 12,
/**
* Internal error. Means some invariant expected by the server application or the gRPC library has
* been broken.
*/
GRPCErrorCodeInternal = 13,
/**
* The server is currently unavailable. This is most likely a transient condition and may be
* corrected by retrying with a backoff. Note that it is not always safe to retry
* non-idempotent operations.
*/
GRPCErrorCodeUnavailable = 14,
/** Unrecoverable data loss or corruption. */
GRPCErrorCodeDataLoss = 15,
};
/**
* Keys used in |NSError|'s |userInfo| dictionary to store the response headers and trailers sent by
* the server.
*/
extern NSString *const kGRPCHeadersKey;
extern NSString *const kGRPCTrailersKey;
/** An object can implement this protocol to receive responses from server from a call. */
@protocol GRPCResponseHandler<NSObject, GRPCDispatchable>
@protocol GRPCResponseHandler<NSObject>
@required
/**
* All the responses must be issued to a user-provided dispatch queue. This property specifies the
* dispatch queue to be used for issuing the notifications.
*/
@property(atomic, readonly) dispatch_queue_t dispatchQueue;
@optional
@ -187,3 +302,114 @@ NS_ASSUME_NONNULL_BEGIN
@end
NS_ASSUME_NONNULL_END
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wnullability-completeness"
/**
* This interface is deprecated. Please use \a GRPCcall2.
*
* Represents a single gRPC remote call.
*/
@interface GRPCCall : GRXWriter
- (instancetype)init NS_UNAVAILABLE;
/**
* The container of the request headers of an RPC conforms to this protocol, which is a subset of
* NSMutableDictionary's interface. It will become a NSMutableDictionary later on.
* The keys of this container are the header names, which per the HTTP standard are case-
* insensitive. They are stored in lowercase (which is how HTTP/2 mandates them on the wire), and
* can only consist of ASCII characters.
* A header value is a NSString object (with only ASCII characters), unless the header name has the
* suffix "-bin", in which case the value has to be a NSData object.
*/
/**
* These HTTP headers will be passed to the server as part of this call. Each HTTP header is a
* name-value pair with string names and either string or binary values.
*
* The passed dictionary has to use NSString keys, corresponding to the header names. The value
* associated to each can be a NSString object or a NSData object. E.g.:
*
* call.requestHeaders = @{@"authorization": @"Bearer ..."};
*
* call.requestHeaders[@"my-header-bin"] = someData;
*
* After the call is started, trying to modify this property is an error.
*
* The property is initialized to an empty NSMutableDictionary.
*/
@property(atomic, readonly) NSMutableDictionary *requestHeaders;
/**
* This dictionary is populated with the HTTP headers received from the server. This happens before
* any response message is received from the server. It has the same structure as the request
* headers dictionary: Keys are NSString header names; names ending with the suffix "-bin" have a
* NSData value; the others have a NSString value.
*
* The value of this property is nil until all response headers are received, and will change before
* any of -writeValue: or -writesFinishedWithError: are sent to the writeable.
*/
@property(atomic, readonly) NSDictionary *responseHeaders;
/**
* Same as responseHeaders, but populated with the HTTP trailers received from the server before the
* call finishes.
*
* The value of this property is nil until all response trailers are received, and will change
* before -writesFinishedWithError: is sent to the writeable.
*/
@property(atomic, readonly) NSDictionary *responseTrailers;
/**
* The request writer has to write NSData objects into the provided Writeable. The server will
* receive each of those separately and in order as distinct messages.
* A gRPC call might not complete until the request writer finishes. On the other hand, the request
* finishing doesn't necessarily make the call to finish, as the server might continue sending
* messages to the response side of the call indefinitely (depending on the semantics of the
* specific remote method called).
* To finish a call right away, invoke cancel.
* host parameter should not contain the scheme (http:// or https://), only the name or IP addr
* and the port number, for example @"localhost:5050".
*/
- (instancetype)initWithHost:(NSString *)host
path:(NSString *)path
requestsWriter:(GRXWriter *)requestWriter;
/**
* Finishes the request side of this call, notifies the server that the RPC should be cancelled, and
* finishes the response side of the call with an error of code CANCELED.
*/
- (void)cancel;
/**
* The following methods are deprecated.
*/
+ (void)setCallSafety:(GRPCCallSafety)callSafety host:(NSString *)host path:(NSString *)path;
@property(atomic, copy, readwrite) NSString *serverName;
@property NSTimeInterval timeout;
- (void)setResponseDispatchQueue:(dispatch_queue_t)queue;
@end
#pragma mark Backwards compatibiity
/** This protocol is kept for backwards compatibility with existing code. */
DEPRECATED_MSG_ATTRIBUTE("Use NSDictionary or NSMutableDictionary instead.")
@protocol GRPCRequestHeaders<NSObject>
@property(nonatomic, readonly) NSUInteger count;
- (id)objectForKeyedSubscript:(id)key;
- (void)setObject:(id)obj forKeyedSubscript:(id)key;
- (void)removeAllObjects;
- (void)removeObjectForKey:(id)key;
@end
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated"
/** This is only needed for backwards-compatibility. */
@interface NSMutableDictionary (GRPCRequestHeaders)<GRPCRequestHeaders>
@end
#pragma clang diagnostic pop
#pragma clang diagnostic pop

@ -17,86 +17,56 @@
*/
#import "GRPCCall.h"
#import "GRPCCall+Interceptor.h"
#import "GRPCCall+OAuth2.h"
#import "GRPCCallOptions.h"
#import "GRPCInterceptor.h"
#import "private/GRPCTransport+Private.h"
#import <RxLibrary/GRXBufferedPipe.h>
#import <RxLibrary/GRXConcurrentWriteable.h>
#import <RxLibrary/GRXImmediateSingleWriter.h>
#import <RxLibrary/GRXWriter+Immediate.h>
#include <grpc/grpc.h>
#include <grpc/support/time.h>
#import "private/GRPCCall+V2API.h"
#import "private/GRPCCallInternal.h"
#import "private/GRPCChannelPool.h"
#import "private/GRPCCompletionQueue.h"
#import "private/GRPCHost.h"
#import "private/GRPCRequestHeaders.h"
#import "private/GRPCWrappedCall.h"
#import "private/NSData+GRPC.h"
#import "private/NSDictionary+GRPC.h"
#import "private/NSError+GRPC.h"
// At most 6 ops can be in an op batch for a client: SEND_INITIAL_METADATA,
// SEND_MESSAGE, SEND_CLOSE_FROM_CLIENT, RECV_INITIAL_METADATA, RECV_MESSAGE,
// and RECV_STATUS_ON_CLIENT.
NSInteger kMaxClientBatch = 6;
NSString *const kGRPCHeadersKey = @"io.grpc.HeadersKey";
NSString *const kGRPCTrailersKey = @"io.grpc.TrailersKey";
static NSMutableDictionary *callFlags;
NSString *const kGRPCErrorDomain = @"io.grpc";
/**
* The response dispatcher creates its own serial dispatch queue and target the queue to the
* dispatch queue of a user provided response handler. It removes the requirement of having to use
* serial dispatch queue in the user provided response handler.
*/
@interface GRPCResponseDispatcher : NSObject<GRPCResponseHandler>
- (nullable instancetype)initWithResponseHandler:(id<GRPCResponseHandler>)responseHandler;
@end
static NSString *const kAuthorizationHeader = @"authorization";
static NSString *const kBearerPrefix = @"Bearer ";
@implementation GRPCResponseDispatcher {
id<GRPCResponseHandler> _responseHandler;
dispatch_queue_t _dispatchQueue;
}
const char *kCFStreamVarName = "grpc_cfstream";
- (instancetype)initWithResponseHandler:(id<GRPCResponseHandler>)responseHandler {
if ((self = [super init])) {
_responseHandler = responseHandler;
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000 || __MAC_OS_X_VERSION_MAX_ALLOWED >= 101300
if (@available(iOS 8.0, macOS 10.10, *)) {
_dispatchQueue = dispatch_queue_create(
NULL,
dispatch_queue_attr_make_with_qos_class(DISPATCH_QUEUE_SERIAL, QOS_CLASS_DEFAULT, 0));
} else {
#else
{
#endif
_dispatchQueue = dispatch_queue_create(NULL, DISPATCH_QUEUE_SERIAL);
}
dispatch_set_target_queue(_dispatchQueue, _responseHandler.dispatchQueue);
}
@interface GRPCCall ()<GRXWriteable>
// Make them read-write.
@property(atomic, strong) NSDictionary *responseHeaders;
@property(atomic, strong) NSDictionary *responseTrailers;
return self;
}
- (dispatch_queue_t)dispatchQueue {
return _dispatchQueue;
}
- (void)didReceiveInitialMetadata:(nullable NSDictionary *)initialMetadata {
if ([_responseHandler respondsToSelector:@selector(didReceiveInitialMetadata:)]) {
[_responseHandler didReceiveInitialMetadata:initialMetadata];
}
}
- (void)didReceiveData:(id)data {
// For backwards compatibility with didReceiveRawMessage, if the user provided a response handler
// that handles didReceiveRawMesssage, we issue to that method instead
if ([_responseHandler respondsToSelector:@selector(didReceiveRawMessage:)]) {
[_responseHandler didReceiveRawMessage:data];
} else if ([_responseHandler respondsToSelector:@selector(didReceiveData:)]) {
[_responseHandler didReceiveData:data];
}
}
- (void)didCloseWithTrailingMetadata:(nullable NSDictionary *)trailingMetadata
error:(nullable NSError *)error {
if ([_responseHandler respondsToSelector:@selector(didCloseWithTrailingMetadata:error:)]) {
[_responseHandler didCloseWithTrailingMetadata:trailingMetadata error:error];
}
}
- (void)receiveNextMessages:(NSUInteger)numberOfMessages;
- (void)didWriteData {
if ([_responseHandler respondsToSelector:@selector(didWriteData)]) {
[_responseHandler didWriteData];
}
}
- (instancetype)initWithHost:(NSString *)host
path:(NSString *)path
callSafety:(GRPCCallSafety)safety
requestsWriter:(GRXWriter *)requestsWriter
callOptions:(GRPCCallOptions *)callOptions
writeDone:(void (^)(void))writeDone;
@end
@ -170,39 +140,54 @@ NSString *const kGRPCErrorDomain = @"io.grpc";
}
_responseHandler = responseHandler;
GRPCResponseDispatcher *dispatcher =
[[GRPCResponseDispatcher alloc] initWithResponseHandler:_responseHandler];
NSMutableArray<id<GRPCInterceptorFactory>> *interceptorFactories;
if (_actualCallOptions.interceptorFactories != nil) {
interceptorFactories =
[NSMutableArray arrayWithArray:_actualCallOptions.interceptorFactories];
} else {
interceptorFactories = [NSMutableArray array];
}
// Initialize the interceptor chain
// First initialize the internal call
GRPCCall2Internal *internalCall = [[GRPCCall2Internal alloc] init];
id<GRPCInterceptorInterface> nextInterceptor = internalCall;
GRPCInterceptorManager *nextManager = nil;
// Then initialize the global interceptor, if applicable
id<GRPCInterceptorFactory> globalInterceptorFactory = [GRPCCall2 globalInterceptorFactory];
if (globalInterceptorFactory != nil) {
[interceptorFactories addObject:globalInterceptorFactory];
if (globalInterceptorFactory) {
GRPCInterceptorManager *manager =
[[GRPCInterceptorManager alloc] initWithNextInterceptor:nextInterceptor];
GRPCInterceptor *interceptor =
[globalInterceptorFactory createInterceptorWithManager:manager];
if (interceptor != nil) {
[internalCall setResponseHandler:interceptor];
nextInterceptor = interceptor;
nextManager = manager;
}
}
// continuously create interceptor until one is successfully created
while (_firstInterceptor == nil) {
if (interceptorFactories.count == 0) {
_firstInterceptor = [[GRPCTransportManager alloc] initWithTransportId:_callOptions.transport
previousInterceptor:dispatcher];
break;
// Finally initialize the interceptors in the chain
NSArray *interceptorFactories = _actualCallOptions.interceptorFactories;
for (int i = (int)interceptorFactories.count - 1; i >= 0; i--) {
GRPCInterceptorManager *manager =
[[GRPCInterceptorManager alloc] initWithNextInterceptor:nextInterceptor];
GRPCInterceptor *interceptor = [interceptorFactories[i] createInterceptorWithManager:manager];
NSAssert(interceptor != nil, @"Failed to create interceptor from factory: %@",
interceptorFactories[i]);
if (interceptor == nil) {
NSLog(@"Failed to create interceptor from factory: %@", interceptorFactories[i]);
continue;
}
if (nextManager == nil) {
[internalCall setResponseHandler:interceptor];
} else {
_firstInterceptor =
[[GRPCInterceptorManager alloc] initWithFactories:interceptorFactories
previousInterceptor:dispatcher
transportId:_callOptions.transport];
if (_firstInterceptor == nil) {
[interceptorFactories removeObjectAtIndex:0];
}
[nextManager setPreviousInterceptor:interceptor];
}
nextInterceptor = interceptor;
nextManager = manager;
}
NSAssert(_firstInterceptor != nil, @"Failed to create interceptor or transport.");
if (_firstInterceptor == nil) {
NSLog(@"Failed to create interceptor or transport.");
if (nextManager == nil) {
[internalCall setResponseHandler:_responseHandler];
} else {
[nextManager setPreviousInterceptor:_responseHandler];
}
_firstInterceptor = nextInterceptor;
}
return self;
@ -215,42 +200,696 @@ NSString *const kGRPCErrorDomain = @"io.grpc";
}
- (void)start {
id<GRPCInterceptorInterface> copiedFirstInterceptor = _firstInterceptor;
GRPCRequestOptions *requestOptions = _requestOptions;
GRPCCallOptions *callOptions = _actualCallOptions;
dispatch_async(copiedFirstInterceptor.dispatchQueue, ^{
[copiedFirstInterceptor startWithRequestOptions:requestOptions callOptions:callOptions];
});
id<GRPCInterceptorInterface> copiedFirstInterceptor;
@synchronized(self) {
copiedFirstInterceptor = _firstInterceptor;
}
GRPCRequestOptions *requestOptions = [_requestOptions copy];
GRPCCallOptions *callOptions = [_actualCallOptions copy];
if ([copiedFirstInterceptor respondsToSelector:@selector(startWithRequestOptions:callOptions:)]) {
dispatch_async(copiedFirstInterceptor.requestDispatchQueue, ^{
[copiedFirstInterceptor startWithRequestOptions:requestOptions callOptions:callOptions];
});
}
}
- (void)cancel {
id<GRPCInterceptorInterface> copiedFirstInterceptor = _firstInterceptor;
if (copiedFirstInterceptor != nil) {
dispatch_async(copiedFirstInterceptor.dispatchQueue, ^{
id<GRPCInterceptorInterface> copiedFirstInterceptor;
@synchronized(self) {
copiedFirstInterceptor = _firstInterceptor;
}
if ([copiedFirstInterceptor respondsToSelector:@selector(cancel)]) {
dispatch_async(copiedFirstInterceptor.requestDispatchQueue, ^{
[copiedFirstInterceptor cancel];
});
}
}
- (void)writeData:(id)data {
id<GRPCInterceptorInterface> copiedFirstInterceptor = _firstInterceptor;
dispatch_async(copiedFirstInterceptor.dispatchQueue, ^{
[copiedFirstInterceptor writeData:data];
});
id<GRPCInterceptorInterface> copiedFirstInterceptor;
@synchronized(self) {
copiedFirstInterceptor = _firstInterceptor;
}
if ([copiedFirstInterceptor respondsToSelector:@selector(writeData:)]) {
dispatch_async(copiedFirstInterceptor.requestDispatchQueue, ^{
[copiedFirstInterceptor writeData:data];
});
}
}
- (void)finish {
id<GRPCInterceptorInterface> copiedFirstInterceptor = _firstInterceptor;
dispatch_async(copiedFirstInterceptor.dispatchQueue, ^{
[copiedFirstInterceptor finish];
id<GRPCInterceptorInterface> copiedFirstInterceptor;
@synchronized(self) {
copiedFirstInterceptor = _firstInterceptor;
}
if ([copiedFirstInterceptor respondsToSelector:@selector(finish)]) {
dispatch_async(copiedFirstInterceptor.requestDispatchQueue, ^{
[copiedFirstInterceptor finish];
});
}
}
- (void)receiveNextMessages:(NSUInteger)numberOfMessages {
id<GRPCInterceptorInterface> copiedFirstInterceptor;
@synchronized(self) {
copiedFirstInterceptor = _firstInterceptor;
}
if ([copiedFirstInterceptor respondsToSelector:@selector(receiveNextMessages:)]) {
dispatch_async(copiedFirstInterceptor.requestDispatchQueue, ^{
[copiedFirstInterceptor receiveNextMessages:numberOfMessages];
});
}
}
@end
// The following methods of a C gRPC call object aren't reentrant, and thus
// calls to them must be serialized:
// - start_batch
// - destroy
//
// start_batch with a SEND_MESSAGE argument can only be called after the
// OP_COMPLETE event for any previous write is received. This is achieved by
// pausing the requests writer immediately every time it writes a value, and
// resuming it again when OP_COMPLETE is received.
//
// Similarly, start_batch with a RECV_MESSAGE argument can only be called after
// the OP_COMPLETE event for any previous read is received.This is easier to
// enforce, as we're writing the received messages into the writeable:
// start_batch is enqueued once upon receiving the OP_COMPLETE event for the
// RECV_METADATA batch, and then once after receiving each OP_COMPLETE event for
// each RECV_MESSAGE batch.
@implementation GRPCCall {
dispatch_queue_t _callQueue;
NSString *_host;
NSString *_path;
GRPCCallSafety _callSafety;
GRPCCallOptions *_callOptions;
GRPCWrappedCall *_wrappedCall;
// The C gRPC library has less guarantees on the ordering of events than we
// do. Particularly, in the face of errors, there's no ordering guarantee at
// all. This wrapper over our actual writeable ensures thread-safety and
// correct ordering.
GRXConcurrentWriteable *_responseWriteable;
// The network thread wants the requestWriter to resume (when the server is ready for more input),
// or to stop (on errors), concurrently with user threads that want to start it, pause it or stop
// it. Because a writer isn't thread-safe, we'll synchronize those operations on it.
// We don't use a dispatch queue for that purpose, because the writer can call writeValue: or
// writesFinishedWithError: on this GRPCCall as part of those operations. We want to be able to
// pause the writer immediately on writeValue:, so we need our locking to be recursive.
GRXWriter *_requestWriter;
// To create a retain cycle when a call is started, up until it finishes. See
// |startWithWriteable:| and |finishWithError:|. This saves users from having to retain a
// reference to the call object if all they're interested in is the handler being executed when
// the response arrives.
GRPCCall *_retainSelf;
GRPCRequestHeaders *_requestHeaders;
// In the case that the call is a unary call (i.e. the writer to GRPCCall is of type
// GRXImmediateSingleWriter), GRPCCall will delay sending ops (not send them to C core
// immediately) and buffer them into a batch _unaryOpBatch. The batch is sent to C core when
// the SendClose op is added.
BOOL _unaryCall;
NSMutableArray *_unaryOpBatch;
// The dispatch queue to be used for enqueuing responses to user. Defaulted to the main dispatch
// queue
dispatch_queue_t _responseQueue;
// The OAuth2 token fetched from a token provider.
NSString *_fetchedOauth2AccessToken;
// The callback to be called when a write message op is done.
void (^_writeDone)(void);
// Indicate a read request to core is pending.
BOOL _pendingCoreRead;
// Indicate pending read message request from user.
NSUInteger _pendingReceiveNextMessages;
}
@synthesize state = _state;
+ (void)initialize {
// Guarantees the code in {} block is invoked only once. See ref at:
// https://developer.apple.com/documentation/objectivec/nsobject/1418639-initialize?language=objc
if (self == [GRPCCall self]) {
grpc_init();
callFlags = [NSMutableDictionary dictionary];
}
}
+ (void)setCallSafety:(GRPCCallSafety)callSafety host:(NSString *)host path:(NSString *)path {
if (host.length == 0 || path.length == 0) {
return;
}
NSString *hostAndPath = [NSString stringWithFormat:@"%@/%@", host, path];
@synchronized(callFlags) {
switch (callSafety) {
case GRPCCallSafetyDefault:
callFlags[hostAndPath] = @0;
break;
case GRPCCallSafetyIdempotentRequest:
callFlags[hostAndPath] = @GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST;
break;
case GRPCCallSafetyCacheableRequest:
callFlags[hostAndPath] = @GRPC_INITIAL_METADATA_CACHEABLE_REQUEST;
break;
default:
break;
}
}
}
+ (uint32_t)callFlagsForHost:(NSString *)host path:(NSString *)path {
NSString *hostAndPath = [NSString stringWithFormat:@"%@/%@", host, path];
@synchronized(callFlags) {
return [callFlags[hostAndPath] intValue];
}
}
// Designated initializer
- (instancetype)initWithHost:(NSString *)host
path:(NSString *)path
requestsWriter:(GRXWriter *)requestWriter {
return [self initWithHost:host
path:path
callSafety:GRPCCallSafetyDefault
requestsWriter:requestWriter
callOptions:nil];
}
- (instancetype)initWithHost:(NSString *)host
path:(NSString *)path
callSafety:(GRPCCallSafety)safety
requestsWriter:(GRXWriter *)requestsWriter
callOptions:(GRPCCallOptions *)callOptions {
return [self initWithHost:host
path:path
callSafety:safety
requestsWriter:requestsWriter
callOptions:callOptions
writeDone:nil];
}
- (instancetype)initWithHost:(NSString *)host
path:(NSString *)path
callSafety:(GRPCCallSafety)safety
requestsWriter:(GRXWriter *)requestsWriter
callOptions:(GRPCCallOptions *)callOptions
writeDone:(void (^)(void))writeDone {
// Purposely using pointer rather than length (host.length == 0) for backwards compatibility.
NSAssert(host != nil && path != nil, @"Neither host nor path can be nil.");
NSAssert(safety <= GRPCCallSafetyCacheableRequest, @"Invalid call safety value.");
NSAssert(requestsWriter.state == GRXWriterStateNotStarted,
@"The requests writer can't be already started.");
if (!host || !path) {
return nil;
}
if (safety > GRPCCallSafetyCacheableRequest) {
return nil;
}
if (requestsWriter.state != GRXWriterStateNotStarted) {
return nil;
}
if ((self = [super init])) {
_host = [host copy];
_path = [path copy];
_callSafety = safety;
_callOptions = [callOptions copy];
// Serial queue to invoke the non-reentrant methods of the grpc_call object.
_callQueue = dispatch_queue_create("io.grpc.call", DISPATCH_QUEUE_SERIAL);
_requestWriter = requestsWriter;
_requestHeaders = [[GRPCRequestHeaders alloc] initWithCall:self];
_writeDone = writeDone;
if ([requestsWriter isKindOfClass:[GRXImmediateSingleWriter class]]) {
_unaryCall = YES;
_unaryOpBatch = [NSMutableArray arrayWithCapacity:kMaxClientBatch];
}
_responseQueue = dispatch_get_main_queue();
// do not start a read until initial metadata is received
_pendingReceiveNextMessages = 0;
_pendingCoreRead = YES;
}
return self;
}
- (void)setResponseDispatchQueue:(dispatch_queue_t)queue {
@synchronized(self) {
if (_state != GRXWriterStateNotStarted) {
return;
}
_responseQueue = queue;
}
}
#pragma mark Finish
// This function should support being called within a @synchronized(self) block in another function
// Should not manipulate _requestWriter for deadlock prevention.
- (void)finishWithError:(NSError *)errorOrNil {
@synchronized(self) {
if (_state == GRXWriterStateFinished) {
return;
}
_state = GRXWriterStateFinished;
if (errorOrNil) {
[_responseWriteable cancelWithError:errorOrNil];
} else {
[_responseWriteable enqueueSuccessfulCompletion];
}
// If the call isn't retained anywhere else, it can be deallocated now.
_retainSelf = nil;
}
}
- (void)cancel {
@synchronized(self) {
if (_state == GRXWriterStateFinished) {
return;
}
[self finishWithError:[NSError
errorWithDomain:kGRPCErrorDomain
code:GRPCErrorCodeCancelled
userInfo:@{NSLocalizedDescriptionKey : @"Canceled by app"}]];
[_wrappedCall cancel];
}
_requestWriter.state = GRXWriterStateFinished;
}
- (void)dealloc {
__block GRPCWrappedCall *wrappedCall = _wrappedCall;
dispatch_async(_callQueue, ^{
wrappedCall = nil;
});
}
#pragma mark Read messages
// Only called from the call queue.
// The handler will be called from the network queue.
- (void)startReadWithHandler:(void (^)(grpc_byte_buffer *))handler {
// TODO(jcanizales): Add error handlers for async failures
[_wrappedCall startBatchWithOperations:@[ [[GRPCOpRecvMessage alloc] initWithHandler:handler] ]];
}
// Called initially from the network queue once response headers are received,
// then "recursively" from the responseWriteable queue after each response from the
// server has been written.
// If the call is currently paused, this is a noop. Restarting the call will invoke this
// method.
// TODO(jcanizales): Rename to readResponseIfNotPaused.
- (void)maybeStartNextRead {
@synchronized(self) {
if (_state != GRXWriterStateStarted) {
return;
}
if (_callOptions.flowControlEnabled && (_pendingCoreRead || _pendingReceiveNextMessages == 0)) {
return;
}
_pendingCoreRead = YES;
_pendingReceiveNextMessages--;
}
dispatch_async(_callQueue, ^{
__weak GRPCCall *weakSelf = self;
[self startReadWithHandler:^(grpc_byte_buffer *message) {
if (message == NULL) {
// No more messages from the server
return;
}
__strong GRPCCall *strongSelf = weakSelf;
if (strongSelf == nil) {
grpc_byte_buffer_destroy(message);
return;
}
NSData *data = [NSData grpc_dataWithByteBuffer:message];
grpc_byte_buffer_destroy(message);
if (!data) {
// The app doesn't have enough memory to hold the server response. We
// don't want to throw, because the app shouldn't crash for a behavior
// that's on the hands of any server to have. Instead we finish and ask
// the server to cancel.
@synchronized(strongSelf) {
strongSelf->_pendingCoreRead = NO;
[strongSelf
finishWithError:[NSError errorWithDomain:kGRPCErrorDomain
code:GRPCErrorCodeResourceExhausted
userInfo:@{
NSLocalizedDescriptionKey :
@"Client does not have enough memory to "
@"hold the server response."
}]];
[strongSelf->_wrappedCall cancel];
}
strongSelf->_requestWriter.state = GRXWriterStateFinished;
} else {
@synchronized(strongSelf) {
[strongSelf->_responseWriteable enqueueValue:data
completionHandler:^{
__strong GRPCCall *strongSelf = weakSelf;
if (strongSelf) {
@synchronized(strongSelf) {
strongSelf->_pendingCoreRead = NO;
[strongSelf maybeStartNextRead];
}
}
}];
}
}
}];
});
}
#pragma mark Send headers
- (void)sendHeaders {
// TODO (mxyan): Remove after deprecated methods are removed
uint32_t callSafetyFlags = 0;
switch (_callSafety) {
case GRPCCallSafetyDefault:
callSafetyFlags = 0;
break;
case GRPCCallSafetyIdempotentRequest:
callSafetyFlags = GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST;
break;
case GRPCCallSafetyCacheableRequest:
callSafetyFlags = GRPC_INITIAL_METADATA_CACHEABLE_REQUEST;
break;
}
NSMutableDictionary *headers = [_requestHeaders mutableCopy];
NSString *fetchedOauth2AccessToken;
@synchronized(self) {
fetchedOauth2AccessToken = _fetchedOauth2AccessToken;
}
if (fetchedOauth2AccessToken != nil) {
headers[@"authorization"] = [kBearerPrefix stringByAppendingString:fetchedOauth2AccessToken];
} else if (_callOptions.oauth2AccessToken != nil) {
headers[@"authorization"] =
[kBearerPrefix stringByAppendingString:_callOptions.oauth2AccessToken];
}
// TODO(jcanizales): Add error handlers for async failures
GRPCOpSendMetadata *op = [[GRPCOpSendMetadata alloc]
initWithMetadata:headers
flags:callSafetyFlags
handler:nil]; // No clean-up needed after SEND_INITIAL_METADATA
dispatch_async(_callQueue, ^{
if (!self->_unaryCall) {
[self->_wrappedCall startBatchWithOperations:@[ op ]];
} else {
[self->_unaryOpBatch addObject:op];
}
});
}
- (void)receiveNextMessages:(NSUInteger)numberOfMessages {
id<GRPCInterceptorInterface> copiedFirstInterceptor = _firstInterceptor;
dispatch_async(copiedFirstInterceptor.dispatchQueue, ^{
[copiedFirstInterceptor receiveNextMessages:numberOfMessages];
if (numberOfMessages == 0) {
return;
}
@synchronized(self) {
_pendingReceiveNextMessages += numberOfMessages;
if (_state != GRXWriterStateStarted || !_callOptions.flowControlEnabled) {
return;
}
[self maybeStartNextRead];
}
}
#pragma mark GRXWriteable implementation
// Only called from the call queue. The error handler will be called from the
// network queue if the write didn't succeed.
// If the call is a unary call, parameter \a errorHandler will be ignored and
// the error handler of GRPCOpSendClose will be executed in case of error.
- (void)writeMessage:(NSData *)message withErrorHandler:(void (^)(void))errorHandler {
__weak GRPCCall *weakSelf = self;
void (^resumingHandler)(void) = ^{
// Resume the request writer.
GRPCCall *strongSelf = weakSelf;
if (strongSelf) {
strongSelf->_requestWriter.state = GRXWriterStateStarted;
if (strongSelf->_writeDone) {
strongSelf->_writeDone();
}
}
};
GRPCOpSendMessage *op =
[[GRPCOpSendMessage alloc] initWithMessage:message handler:resumingHandler];
if (!_unaryCall) {
[_wrappedCall startBatchWithOperations:@[ op ] errorHandler:errorHandler];
} else {
// Ignored errorHandler since it is the same as the one for GRPCOpSendClose.
// TODO (mxyan): unify the error handlers of all Ops into a single closure.
[_unaryOpBatch addObject:op];
}
}
- (void)writeValue:(id)value {
NSAssert([value isKindOfClass:[NSData class]], @"value must be of type NSData");
@synchronized(self) {
if (_state == GRXWriterStateFinished) {
return;
}
}
// Pause the input and only resume it when the C layer notifies us that writes
// can proceed.
_requestWriter.state = GRXWriterStatePaused;
dispatch_async(_callQueue, ^{
// Write error is not processed here. It is handled by op batch of GRPC_OP_RECV_STATUS_ON_CLIENT
[self writeMessage:value withErrorHandler:nil];
});
}
// Only called from the call queue. The error handler will be called from the
// network queue if the requests stream couldn't be closed successfully.
- (void)finishRequestWithErrorHandler:(void (^)(void))errorHandler {
if (!_unaryCall) {
[_wrappedCall startBatchWithOperations:@[ [[GRPCOpSendClose alloc] init] ]
errorHandler:errorHandler];
} else {
[_unaryOpBatch addObject:[[GRPCOpSendClose alloc] init]];
[_wrappedCall startBatchWithOperations:_unaryOpBatch errorHandler:errorHandler];
}
}
- (void)writesFinishedWithError:(NSError *)errorOrNil {
if (errorOrNil) {
[self cancel];
} else {
dispatch_async(_callQueue, ^{
// EOS error is not processed here. It is handled by op batch of GRPC_OP_RECV_STATUS_ON_CLIENT
[self finishRequestWithErrorHandler:nil];
});
}
}
#pragma mark Invoke
// Both handlers will eventually be called, from the network queue. Writes can start immediately
// after this.
// The first one (headersHandler), when the response headers are received.
// The second one (completionHandler), whenever the RPC finishes for any reason.
- (void)invokeCallWithHeadersHandler:(void (^)(NSDictionary *))headersHandler
completionHandler:(void (^)(NSError *, NSDictionary *))completionHandler {
dispatch_async(_callQueue, ^{
// TODO(jcanizales): Add error handlers for async failures
[self->_wrappedCall
startBatchWithOperations:@[ [[GRPCOpRecvMetadata alloc] initWithHandler:headersHandler] ]];
[self->_wrappedCall
startBatchWithOperations:@[ [[GRPCOpRecvStatus alloc] initWithHandler:completionHandler] ]];
});
}
- (void)invokeCall {
__weak GRPCCall *weakSelf = self;
[self invokeCallWithHeadersHandler:^(NSDictionary *headers) {
// Response headers received.
__strong GRPCCall *strongSelf = weakSelf;
if (strongSelf) {
@synchronized(strongSelf) {
// it is ok to set nil because headers are only received once
strongSelf.responseHeaders = nil;
// copy the header so that the GRPCOpRecvMetadata object may be dealloc'ed
NSDictionary *copiedHeaders =
[[NSDictionary alloc] initWithDictionary:headers copyItems:YES];
strongSelf.responseHeaders = copiedHeaders;
strongSelf->_pendingCoreRead = NO;
[strongSelf maybeStartNextRead];
}
}
}
completionHandler:^(NSError *error, NSDictionary *trailers) {
__strong GRPCCall *strongSelf = weakSelf;
if (strongSelf) {
strongSelf.responseTrailers = trailers;
if (error) {
NSMutableDictionary *userInfo = [NSMutableDictionary dictionary];
if (error.userInfo) {
[userInfo addEntriesFromDictionary:error.userInfo];
}
userInfo[kGRPCTrailersKey] = strongSelf.responseTrailers;
// Since gRPC core does not guarantee the headers block being called before this block,
// responseHeaders might be nil.
userInfo[kGRPCHeadersKey] = strongSelf.responseHeaders;
error = [NSError errorWithDomain:error.domain code:error.code userInfo:userInfo];
}
[strongSelf finishWithError:error];
strongSelf->_requestWriter.state = GRXWriterStateFinished;
}
}];
}
#pragma mark GRXWriter implementation
// Lock acquired inside startWithWriteable:
- (void)startCallWithWriteable:(id<GRXWriteable>)writeable {
@synchronized(self) {
if (_state == GRXWriterStateFinished) {
return;
}
_responseWriteable =
[[GRXConcurrentWriteable alloc] initWithWriteable:writeable dispatchQueue:_responseQueue];
GRPCPooledChannel *channel =
[[GRPCChannelPool sharedInstance] channelWithHost:_host callOptions:_callOptions];
_wrappedCall = [channel wrappedCallWithPath:_path
completionQueue:[GRPCCompletionQueue completionQueue]
callOptions:_callOptions];
if (_wrappedCall == nil) {
[self finishWithError:[NSError errorWithDomain:kGRPCErrorDomain
code:GRPCErrorCodeUnavailable
userInfo:@{
NSLocalizedDescriptionKey :
@"Failed to create call or channel."
}]];
return;
}
[self sendHeaders];
[self invokeCall];
}
// Now that the RPC has been initiated, request writes can start.
[_requestWriter startWithWriteable:self];
}
- (void)startWithWriteable:(id<GRXWriteable>)writeable {
id<GRPCAuthorizationProtocol> tokenProvider = nil;
@synchronized(self) {
_state = GRXWriterStateStarted;
// Create a retain cycle so that this instance lives until the RPC finishes (or is cancelled).
// This makes RPCs in which the call isn't externally retained possible (as long as it is
// started before being autoreleased). Care is taken not to retain self strongly in any of the
// blocks used in this implementation, so that the life of the instance is determined by this
// retain cycle.
_retainSelf = self;
if (_callOptions == nil) {
GRPCMutableCallOptions *callOptions = [[GRPCHost callOptionsForHost:_host] mutableCopy];
if (_serverName.length != 0) {
callOptions.serverAuthority = _serverName;
}
if (_timeout > 0) {
callOptions.timeout = _timeout;
}
uint32_t callFlags = [GRPCCall callFlagsForHost:_host path:_path];
if (callFlags != 0) {
if (callFlags == GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST) {
_callSafety = GRPCCallSafetyIdempotentRequest;
} else if (callFlags == GRPC_INITIAL_METADATA_CACHEABLE_REQUEST) {
_callSafety = GRPCCallSafetyCacheableRequest;
}
}
id<GRPCAuthorizationProtocol> tokenProvider = self.tokenProvider;
if (tokenProvider != nil) {
callOptions.authTokenProvider = tokenProvider;
}
_callOptions = callOptions;
}
NSAssert(_callOptions.authTokenProvider == nil || _callOptions.oauth2AccessToken == nil,
@"authTokenProvider and oauth2AccessToken cannot be set at the same time");
tokenProvider = _callOptions.authTokenProvider;
}
if (tokenProvider != nil) {
__weak typeof(self) weakSelf = self;
[tokenProvider getTokenWithHandler:^(NSString *token) {
__strong typeof(self) strongSelf = weakSelf;
if (strongSelf) {
BOOL startCall = NO;
@synchronized(strongSelf) {
if (strongSelf->_state != GRXWriterStateFinished) {
startCall = YES;
if (token) {
strongSelf->_fetchedOauth2AccessToken = [token copy];
}
}
}
if (startCall) {
[strongSelf startCallWithWriteable:writeable];
}
}
}];
} else {
[self startCallWithWriteable:writeable];
}
}
- (void)setState:(GRXWriterState)newState {
@synchronized(self) {
// Manual transitions are only allowed from the started or paused states.
if (_state == GRXWriterStateNotStarted || _state == GRXWriterStateFinished) {
return;
}
switch (newState) {
case GRXWriterStateFinished:
_state = newState;
// Per GRXWriter's contract, setting the state to Finished manually
// means one doesn't wish the writeable to be messaged anymore.
[_responseWriteable cancelSilently];
_responseWriteable = nil;
return;
case GRXWriterStatePaused:
_state = newState;
return;
case GRXWriterStateStarted:
if (_state == GRXWriterStatePaused) {
_state = newState;
[self maybeStartNextRead];
}
return;
case GRXWriterStateNotStarted:
return;
}
}
}
@end

@ -1,136 +0,0 @@
/*
*
* Copyright 2019 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
/**
* This is the legacy interface of this gRPC library. This API is deprecated and users should use
* the API in GRPCCall.h. This API exists solely for the purpose of backwards compatibility.
*/
#import <RxLibrary/GRXWriter.h>
#import "GRPCTypes.h"
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wnullability-completeness"
/**
* This interface is deprecated. Please use \a GRPCCall2.
*
* Represents a single gRPC remote call.
*/
@interface GRPCCall : GRXWriter
- (instancetype)init NS_UNAVAILABLE;
/**
* The container of the request headers of an RPC conforms to this protocol, which is a subset of
* NSMutableDictionary's interface. It will become a NSMutableDictionary later on.
* The keys of this container are the header names, which per the HTTP standard are case-
* insensitive. They are stored in lowercase (which is how HTTP/2 mandates them on the wire), and
* can only consist of ASCII characters.
* A header value is a NSString object (with only ASCII characters), unless the header name has the
* suffix "-bin", in which case the value has to be a NSData object.
*/
/**
* These HTTP headers will be passed to the server as part of this call. Each HTTP header is a
* name-value pair with string names and either string or binary values.
*
* The passed dictionary has to use NSString keys, corresponding to the header names. The value
* associated to each can be a NSString object or a NSData object. E.g.:
*
* call.requestHeaders = @{@"authorization": @"Bearer ..."};
*
* call.requestHeaders[@"my-header-bin"] = someData;
*
* After the call is started, trying to modify this property is an error.
*
* The property is initialized to an empty NSMutableDictionary.
*/
@property(atomic, readonly) NSMutableDictionary *requestHeaders;
/**
* This dictionary is populated with the HTTP headers received from the server. This happens before
* any response message is received from the server. It has the same structure as the request
* headers dictionary: Keys are NSString header names; names ending with the suffix "-bin" have a
* NSData value; the others have a NSString value.
*
* The value of this property is nil until all response headers are received, and will change before
* any of -writeValue: or -writesFinishedWithError: are sent to the writeable.
*/
@property(atomic, readonly) NSDictionary *responseHeaders;
/**
* Same as responseHeaders, but populated with the HTTP trailers received from the server before the
* call finishes.
*
* The value of this property is nil until all response trailers are received, and will change
* before -writesFinishedWithError: is sent to the writeable.
*/
@property(atomic, readonly) NSDictionary *responseTrailers;
/**
* The request writer has to write NSData objects into the provided Writeable. The server will
* receive each of those separately and in order as distinct messages.
* A gRPC call might not complete until the request writer finishes. On the other hand, the request
* finishing doesn't necessarily make the call to finish, as the server might continue sending
* messages to the response side of the call indefinitely (depending on the semantics of the
* specific remote method called).
* To finish a call right away, invoke cancel.
* host parameter should not contain the scheme (http:// or https://), only the name or IP addr
* and the port number, for example @"localhost:5050".
*/
- (instancetype)initWithHost:(NSString *)host
path:(NSString *)path
requestsWriter:(GRXWriter *)requestWriter;
/**
* Finishes the request side of this call, notifies the server that the RPC should be cancelled, and
* finishes the response side of the call with an error of code CANCELED.
*/
- (void)cancel;
/**
* The following methods are deprecated.
*/
+ (void)setCallSafety:(GRPCCallSafety)callSafety host:(NSString *)host path:(NSString *)path;
@property(atomic, copy, readwrite) NSString *serverName;
@property NSTimeInterval timeout;
- (void)setResponseDispatchQueue:(dispatch_queue_t)queue;
@end
#pragma mark Backwards compatibiity
/** This protocol is kept for backwards compatibility with existing code. */
DEPRECATED_MSG_ATTRIBUTE("Use NSDictionary or NSMutableDictionary instead.")
@protocol GRPCRequestHeaders<NSObject>
@property(nonatomic, readonly) NSUInteger count;
- (id)objectForKeyedSubscript:(id)key;
- (void)setObject:(id)obj forKeyedSubscript:(id)key;
- (void)removeAllObjects;
- (void)removeObjectForKey:(id)key;
@end
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated"
/** This is only needed for backwards-compatibility. */
@interface NSMutableDictionary (GRPCRequestHeaders)<GRPCRequestHeaders>
@end
#pragma clang diagnostic pop
#pragma clang diagnostic pop

@ -1,677 +0,0 @@
/*
*
* Copyright 2019 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#import "GRPCCallLegacy.h"
#import "GRPCCall+OAuth2.h"
#import "GRPCCallOptions.h"
#import "GRPCTypes.h"
#import "private/GRPCCore/GRPCChannelPool.h"
#import "private/GRPCCore/GRPCCompletionQueue.h"
#import "private/GRPCCore/GRPCHost.h"
#import "private/GRPCCore/GRPCWrappedCall.h"
#import "private/GRPCCore/NSData+GRPC.h"
#import <RxLibrary/GRXBufferedPipe.h>
#import <RxLibrary/GRXConcurrentWriteable.h>
#import <RxLibrary/GRXImmediateSingleWriter.h>
#import <RxLibrary/GRXWriter+Immediate.h>
#include <grpc/grpc.h>
const char *kCFStreamVarName = "grpc_cfstream";
static NSMutableDictionary *callFlags;
// At most 6 ops can be in an op batch for a client: SEND_INITIAL_METADATA,
// SEND_MESSAGE, SEND_CLOSE_FROM_CLIENT, RECV_INITIAL_METADATA, RECV_MESSAGE,
// and RECV_STATUS_ON_CLIENT.
NSInteger kMaxClientBatch = 6;
static NSString *const kAuthorizationHeader = @"authorization";
static NSString *const kBearerPrefix = @"Bearer ";
@interface GRPCCall ()<GRXWriteable>
// Make them read-write.
@property(atomic, strong) NSDictionary *responseHeaders;
@property(atomic, strong) NSDictionary *responseTrailers;
- (void)receiveNextMessages:(NSUInteger)numberOfMessages;
@end
// The following methods of a C gRPC call object aren't reentrant, and thus
// calls to them must be serialized:
// - start_batch
// - destroy
//
// start_batch with a SEND_MESSAGE argument can only be called after the
// OP_COMPLETE event for any previous write is received. This is achieved by
// pausing the requests writer immediately every time it writes a value, and
// resuming it again when OP_COMPLETE is received.
//
// Similarly, start_batch with a RECV_MESSAGE argument can only be called after
// the OP_COMPLETE event for any previous read is received.This is easier to
// enforce, as we're writing the received messages into the writeable:
// start_batch is enqueued once upon receiving the OP_COMPLETE event for the
// RECV_METADATA batch, and then once after receiving each OP_COMPLETE event for
// each RECV_MESSAGE batch.
@implementation GRPCCall {
dispatch_queue_t _callQueue;
NSString *_host;
NSString *_path;
GRPCCallSafety _callSafety;
GRPCCallOptions *_callOptions;
GRPCWrappedCall *_wrappedCall;
// The C gRPC library has less guarantees on the ordering of events than we
// do. Particularly, in the face of errors, there's no ordering guarantee at
// all. This wrapper over our actual writeable ensures thread-safety and
// correct ordering.
GRXConcurrentWriteable *_responseWriteable;
// The network thread wants the requestWriter to resume (when the server is ready for more input),
// or to stop (on errors), concurrently with user threads that want to start it, pause it or stop
// it. Because a writer isn't thread-safe, we'll synchronize those operations on it.
// We don't use a dispatch queue for that purpose, because the writer can call writeValue: or
// writesFinishedWithError: on this GRPCCall as part of those operations. We want to be able to
// pause the writer immediately on writeValue:, so we need our locking to be recursive.
GRXWriter *_requestWriter;
// To create a retain cycle when a call is started, up until it finishes. See
// |startWithWriteable:| and |finishWithError:|. This saves users from having to retain a
// reference to the call object if all they're interested in is the handler being executed when
// the response arrives.
GRPCCall *_retainSelf;
GRPCRequestHeaders *_requestHeaders;
// In the case that the call is a unary call (i.e. the writer to GRPCCall is of type
// GRXImmediateSingleWriter), GRPCCall will delay sending ops (not send them to C core
// immediately) and buffer them into a batch _unaryOpBatch. The batch is sent to C core when
// the SendClose op is added.
BOOL _unaryCall;
NSMutableArray *_unaryOpBatch;
// The dispatch queue to be used for enqueuing responses to user. Defaulted to the main dispatch
// queue
dispatch_queue_t _responseQueue;
// The OAuth2 token fetched from a token provider.
NSString *_fetchedOauth2AccessToken;
// The callback to be called when a write message op is done.
void (^_writeDone)(void);
// Indicate a read request to core is pending.
BOOL _pendingCoreRead;
// Indicate pending read message request from user.
NSUInteger _pendingReceiveNextMessages;
}
@synthesize state = _state;
+ (void)initialize {
// Guarantees the code in {} block is invoked only once. See ref at:
// https://developer.apple.com/documentation/objectivec/nsobject/1418639-initialize?language=objc
if (self == [GRPCCall self]) {
grpc_init();
callFlags = [NSMutableDictionary dictionary];
}
}
+ (void)setCallSafety:(GRPCCallSafety)callSafety host:(NSString *)host path:(NSString *)path {
if (host.length == 0 || path.length == 0) {
return;
}
NSString *hostAndPath = [NSString stringWithFormat:@"%@/%@", host, path];
@synchronized(callFlags) {
switch (callSafety) {
case GRPCCallSafetyDefault:
callFlags[hostAndPath] = @0;
break;
case GRPCCallSafetyIdempotentRequest:
callFlags[hostAndPath] = @GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST;
break;
case GRPCCallSafetyCacheableRequest:
callFlags[hostAndPath] = @GRPC_INITIAL_METADATA_CACHEABLE_REQUEST;
break;
default:
break;
}
}
}
+ (uint32_t)callFlagsForHost:(NSString *)host path:(NSString *)path {
NSString *hostAndPath = [NSString stringWithFormat:@"%@/%@", host, path];
@synchronized(callFlags) {
return [callFlags[hostAndPath] intValue];
}
}
- (instancetype)initWithHost:(NSString *)host
path:(NSString *)path
requestsWriter:(GRXWriter *)requestWriter {
return [self initWithHost:host
path:path
callSafety:GRPCCallSafetyDefault
requestsWriter:requestWriter
callOptions:nil
writeDone:nil];
}
- (instancetype)initWithHost:(NSString *)host
path:(NSString *)path
callSafety:(GRPCCallSafety)safety
requestsWriter:(GRXWriter *)requestsWriter
callOptions:(GRPCCallOptions *)callOptions
writeDone:(void (^)(void))writeDone {
// Purposely using pointer rather than length (host.length == 0) for backwards compatibility.
NSAssert(host != nil && path != nil, @"Neither host nor path can be nil.");
NSAssert(safety <= GRPCCallSafetyCacheableRequest, @"Invalid call safety value.");
NSAssert(requestsWriter.state == GRXWriterStateNotStarted,
@"The requests writer can't be already started.");
if (!host || !path) {
return nil;
}
if (safety > GRPCCallSafetyCacheableRequest) {
return nil;
}
if (requestsWriter.state != GRXWriterStateNotStarted) {
return nil;
}
if ((self = [super init])) {
_host = [host copy];
_path = [path copy];
_callSafety = safety;
_callOptions = [callOptions copy];
// Serial queue to invoke the non-reentrant methods of the grpc_call object.
_callQueue = dispatch_queue_create("io.grpc.call", DISPATCH_QUEUE_SERIAL);
_requestWriter = requestsWriter;
_requestHeaders = [[GRPCRequestHeaders alloc] initWithCall:self];
_writeDone = writeDone;
if ([requestsWriter isKindOfClass:[GRXImmediateSingleWriter class]]) {
_unaryCall = YES;
_unaryOpBatch = [NSMutableArray arrayWithCapacity:kMaxClientBatch];
}
_responseQueue = dispatch_get_main_queue();
// do not start a read until initial metadata is received
_pendingReceiveNextMessages = 0;
_pendingCoreRead = YES;
}
return self;
}
- (void)setResponseDispatchQueue:(dispatch_queue_t)queue {
@synchronized(self) {
if (_state != GRXWriterStateNotStarted) {
return;
}
_responseQueue = queue;
}
}
#pragma mark Finish
// This function should support being called within a @synchronized(self) block in another function
// Should not manipulate _requestWriter for deadlock prevention.
- (void)finishWithError:(NSError *)errorOrNil {
@synchronized(self) {
if (_state == GRXWriterStateFinished) {
return;
}
_state = GRXWriterStateFinished;
if (errorOrNil) {
[_responseWriteable cancelWithError:errorOrNil];
} else {
[_responseWriteable enqueueSuccessfulCompletion];
}
// If the call isn't retained anywhere else, it can be deallocated now.
_retainSelf = nil;
}
}
- (void)cancel {
@synchronized(self) {
if (_state == GRXWriterStateFinished) {
return;
}
[self finishWithError:[NSError
errorWithDomain:kGRPCErrorDomain
code:GRPCErrorCodeCancelled
userInfo:@{NSLocalizedDescriptionKey : @"Canceled by app"}]];
[_wrappedCall cancel];
}
_requestWriter.state = GRXWriterStateFinished;
}
- (void)dealloc {
__block GRPCWrappedCall *wrappedCall = _wrappedCall;
dispatch_async(_callQueue, ^{
wrappedCall = nil;
});
}
#pragma mark Read messages
// Only called from the call queue.
// The handler will be called from the network queue.
- (void)startReadWithHandler:(void (^)(grpc_byte_buffer *))handler {
// TODO(jcanizales): Add error handlers for async failures
[_wrappedCall startBatchWithOperations:@[ [[GRPCOpRecvMessage alloc] initWithHandler:handler] ]];
}
// Called initially from the network queue once response headers are received,
// then "recursively" from the responseWriteable queue after each response from the
// server has been written.
// If the call is currently paused, this is a noop. Restarting the call will invoke this
// method.
// TODO(jcanizales): Rename to readResponseIfNotPaused.
- (void)maybeStartNextRead {
@synchronized(self) {
if (_state != GRXWriterStateStarted) {
return;
}
if (_callOptions.flowControlEnabled && (_pendingCoreRead || _pendingReceiveNextMessages == 0)) {
return;
}
_pendingCoreRead = YES;
_pendingReceiveNextMessages--;
}
dispatch_async(_callQueue, ^{
__weak GRPCCall *weakSelf = self;
[self startReadWithHandler:^(grpc_byte_buffer *message) {
if (message == NULL) {
// No more messages from the server
return;
}
__strong GRPCCall *strongSelf = weakSelf;
if (strongSelf == nil) {
grpc_byte_buffer_destroy(message);
return;
}
NSData *data = [NSData grpc_dataWithByteBuffer:message];
grpc_byte_buffer_destroy(message);
if (!data) {
// The app doesn't have enough memory to hold the server response. We
// don't want to throw, because the app shouldn't crash for a behavior
// that's on the hands of any server to have. Instead we finish and ask
// the server to cancel.
@synchronized(strongSelf) {
strongSelf->_pendingCoreRead = NO;
[strongSelf
finishWithError:[NSError errorWithDomain:kGRPCErrorDomain
code:GRPCErrorCodeResourceExhausted
userInfo:@{
NSLocalizedDescriptionKey :
@"Client does not have enough memory to "
@"hold the server response."
}]];
[strongSelf->_wrappedCall cancel];
}
strongSelf->_requestWriter.state = GRXWriterStateFinished;
} else {
@synchronized(strongSelf) {
[strongSelf->_responseWriteable enqueueValue:data
completionHandler:^{
__strong GRPCCall *strongSelf = weakSelf;
if (strongSelf) {
@synchronized(strongSelf) {
strongSelf->_pendingCoreRead = NO;
[strongSelf maybeStartNextRead];
}
}
}];
}
}
}];
});
}
#pragma mark Send headers
- (void)sendHeaders {
// TODO (mxyan): Remove after deprecated methods are removed
uint32_t callSafetyFlags = 0;
switch (_callSafety) {
case GRPCCallSafetyDefault:
callSafetyFlags = 0;
break;
case GRPCCallSafetyIdempotentRequest:
callSafetyFlags = GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST;
break;
case GRPCCallSafetyCacheableRequest:
callSafetyFlags = GRPC_INITIAL_METADATA_CACHEABLE_REQUEST;
break;
}
NSMutableDictionary *headers = [_requestHeaders mutableCopy];
NSString *fetchedOauth2AccessToken;
@synchronized(self) {
fetchedOauth2AccessToken = _fetchedOauth2AccessToken;
}
if (fetchedOauth2AccessToken != nil) {
headers[@"authorization"] = [kBearerPrefix stringByAppendingString:fetchedOauth2AccessToken];
} else if (_callOptions.oauth2AccessToken != nil) {
headers[@"authorization"] =
[kBearerPrefix stringByAppendingString:_callOptions.oauth2AccessToken];
}
// TODO(jcanizales): Add error handlers for async failures
GRPCOpSendMetadata *op = [[GRPCOpSendMetadata alloc]
initWithMetadata:headers
flags:callSafetyFlags
handler:nil]; // No clean-up needed after SEND_INITIAL_METADATA
dispatch_async(_callQueue, ^{
if (!self->_unaryCall) {
[self->_wrappedCall startBatchWithOperations:@[ op ]];
} else {
[self->_unaryOpBatch addObject:op];
}
});
}
- (void)receiveNextMessages:(NSUInteger)numberOfMessages {
if (numberOfMessages == 0) {
return;
}
@synchronized(self) {
_pendingReceiveNextMessages += numberOfMessages;
if (_state != GRXWriterStateStarted || !_callOptions.flowControlEnabled) {
return;
}
[self maybeStartNextRead];
}
}
#pragma mark GRXWriteable implementation
// Only called from the call queue. The error handler will be called from the
// network queue if the write didn't succeed.
// If the call is a unary call, parameter \a errorHandler will be ignored and
// the error handler of GRPCOpSendClose will be executed in case of error.
- (void)writeMessage:(NSData *)message withErrorHandler:(void (^)(void))errorHandler {
__weak GRPCCall *weakSelf = self;
void (^resumingHandler)(void) = ^{
// Resume the request writer.
GRPCCall *strongSelf = weakSelf;
if (strongSelf) {
strongSelf->_requestWriter.state = GRXWriterStateStarted;
if (strongSelf->_writeDone) {
strongSelf->_writeDone();
}
}
};
GRPCOpSendMessage *op =
[[GRPCOpSendMessage alloc] initWithMessage:message handler:resumingHandler];
if (!_unaryCall) {
[_wrappedCall startBatchWithOperations:@[ op ] errorHandler:errorHandler];
} else {
// Ignored errorHandler since it is the same as the one for GRPCOpSendClose.
// TODO (mxyan): unify the error handlers of all Ops into a single closure.
[_unaryOpBatch addObject:op];
}
}
- (void)writeValue:(id)value {
NSAssert([value isKindOfClass:[NSData class]], @"value must be of type NSData");
@synchronized(self) {
if (_state == GRXWriterStateFinished) {
return;
}
}
// Pause the input and only resume it when the C layer notifies us that writes
// can proceed.
_requestWriter.state = GRXWriterStatePaused;
dispatch_async(_callQueue, ^{
// Write error is not processed here. It is handled by op batch of GRPC_OP_RECV_STATUS_ON_CLIENT
[self writeMessage:value withErrorHandler:nil];
});
}
// Only called from the call queue. The error handler will be called from the
// network queue if the requests stream couldn't be closed successfully.
- (void)finishRequestWithErrorHandler:(void (^)(void))errorHandler {
if (!_unaryCall) {
[_wrappedCall startBatchWithOperations:@[ [[GRPCOpSendClose alloc] init] ]
errorHandler:errorHandler];
} else {
[_unaryOpBatch addObject:[[GRPCOpSendClose alloc] init]];
[_wrappedCall startBatchWithOperations:_unaryOpBatch errorHandler:errorHandler];
}
}
- (void)writesFinishedWithError:(NSError *)errorOrNil {
if (errorOrNil) {
[self cancel];
} else {
dispatch_async(_callQueue, ^{
// EOS error is not processed here. It is handled by op batch of GRPC_OP_RECV_STATUS_ON_CLIENT
[self finishRequestWithErrorHandler:nil];
});
}
}
#pragma mark Invoke
// Both handlers will eventually be called, from the network queue. Writes can start immediately
// after this.
// The first one (headersHandler), when the response headers are received.
// The second one (completionHandler), whenever the RPC finishes for any reason.
- (void)invokeCallWithHeadersHandler:(void (^)(NSDictionary *))headersHandler
completionHandler:(void (^)(NSError *, NSDictionary *))completionHandler {
dispatch_async(_callQueue, ^{
// TODO(jcanizales): Add error handlers for async failures
[self->_wrappedCall
startBatchWithOperations:@[ [[GRPCOpRecvMetadata alloc] initWithHandler:headersHandler] ]];
[self->_wrappedCall
startBatchWithOperations:@[ [[GRPCOpRecvStatus alloc] initWithHandler:completionHandler] ]];
});
}
- (void)invokeCall {
__weak GRPCCall *weakSelf = self;
[self invokeCallWithHeadersHandler:^(NSDictionary *headers) {
// Response headers received.
__strong GRPCCall *strongSelf = weakSelf;
if (strongSelf) {
@synchronized(strongSelf) {
// it is ok to set nil because headers are only received once
strongSelf.responseHeaders = nil;
// copy the header so that the GRPCOpRecvMetadata object may be dealloc'ed
NSDictionary *copiedHeaders =
[[NSDictionary alloc] initWithDictionary:headers copyItems:YES];
strongSelf.responseHeaders = copiedHeaders;
strongSelf->_pendingCoreRead = NO;
[strongSelf maybeStartNextRead];
}
}
}
completionHandler:^(NSError *error, NSDictionary *trailers) {
__strong GRPCCall *strongSelf = weakSelf;
if (strongSelf) {
strongSelf.responseTrailers = trailers;
if (error) {
NSMutableDictionary *userInfo = [NSMutableDictionary dictionary];
if (error.userInfo) {
[userInfo addEntriesFromDictionary:error.userInfo];
}
userInfo[kGRPCTrailersKey] = strongSelf.responseTrailers;
// Since gRPC core does not guarantee the headers block being called before this block,
// responseHeaders might be nil.
userInfo[kGRPCHeadersKey] = strongSelf.responseHeaders;
error = [NSError errorWithDomain:error.domain code:error.code userInfo:userInfo];
}
[strongSelf finishWithError:error];
strongSelf->_requestWriter.state = GRXWriterStateFinished;
}
}];
}
#pragma mark GRXWriter implementation
// Lock acquired inside startWithWriteable:
- (void)startCallWithWriteable:(id<GRXWriteable>)writeable {
@synchronized(self) {
if (_state == GRXWriterStateFinished) {
return;
}
_responseWriteable =
[[GRXConcurrentWriteable alloc] initWithWriteable:writeable dispatchQueue:_responseQueue];
GRPCPooledChannel *channel =
[[GRPCChannelPool sharedInstance] channelWithHost:_host callOptions:_callOptions];
_wrappedCall = [channel wrappedCallWithPath:_path
completionQueue:[GRPCCompletionQueue completionQueue]
callOptions:_callOptions];
if (_wrappedCall == nil) {
[self finishWithError:[NSError errorWithDomain:kGRPCErrorDomain
code:GRPCErrorCodeUnavailable
userInfo:@{
NSLocalizedDescriptionKey :
@"Failed to create call or channel."
}]];
return;
}
[self sendHeaders];
[self invokeCall];
}
// Now that the RPC has been initiated, request writes can start.
[_requestWriter startWithWriteable:self];
}
- (void)startWithWriteable:(id<GRXWriteable>)writeable {
id<GRPCAuthorizationProtocol> tokenProvider = nil;
@synchronized(self) {
_state = GRXWriterStateStarted;
// Create a retain cycle so that this instance lives until the RPC finishes (or is cancelled).
// This makes RPCs in which the call isn't externally retained possible (as long as it is
// started before being autoreleased). Care is taken not to retain self strongly in any of the
// blocks used in this implementation, so that the life of the instance is determined by this
// retain cycle.
_retainSelf = self;
// If _callOptions is nil, people must be using the deprecated v1 interface. In this case,
// generate the call options from the corresponding GRPCHost configs and apply other options
// that are not covered by GRPCHost.
if (_callOptions == nil) {
GRPCMutableCallOptions *callOptions = [[GRPCHost callOptionsForHost:_host] mutableCopy];
if (_serverName.length != 0) {
callOptions.serverAuthority = _serverName;
}
if (_timeout > 0) {
callOptions.timeout = _timeout;
}
uint32_t callFlags = [GRPCCall callFlagsForHost:_host path:_path];
if (callFlags != 0) {
if (callFlags == GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST) {
_callSafety = GRPCCallSafetyIdempotentRequest;
} else if (callFlags == GRPC_INITIAL_METADATA_CACHEABLE_REQUEST) {
_callSafety = GRPCCallSafetyCacheableRequest;
}
}
id<GRPCAuthorizationProtocol> tokenProvider = self.tokenProvider;
if (tokenProvider != nil) {
callOptions.authTokenProvider = tokenProvider;
}
_callOptions = callOptions;
}
NSAssert(_callOptions.authTokenProvider == nil || _callOptions.oauth2AccessToken == nil,
@"authTokenProvider and oauth2AccessToken cannot be set at the same time");
tokenProvider = _callOptions.authTokenProvider;
}
if (tokenProvider != nil) {
__weak typeof(self) weakSelf = self;
[tokenProvider getTokenWithHandler:^(NSString *token) {
__strong typeof(self) strongSelf = weakSelf;
if (strongSelf) {
BOOL startCall = NO;
@synchronized(strongSelf) {
if (strongSelf->_state != GRXWriterStateFinished) {
startCall = YES;
if (token) {
strongSelf->_fetchedOauth2AccessToken = [token copy];
}
}
}
if (startCall) {
[strongSelf startCallWithWriteable:writeable];
}
}
}];
} else {
[self startCallWithWriteable:writeable];
}
}
- (void)setState:(GRXWriterState)newState {
@synchronized(self) {
// Manual transitions are only allowed from the started or paused states.
if (_state == GRXWriterStateNotStarted || _state == GRXWriterStateFinished) {
return;
}
switch (newState) {
case GRXWriterStateFinished:
_state = newState;
// Per GRXWriter's contract, setting the state to Finished manually
// means one doesn't wish the writeable to be messaged anymore.
[_responseWriteable cancelSilently];
_responseWriteable = nil;
return;
case GRXWriterStatePaused:
_state = newState;
return;
case GRXWriterStateStarted:
if (_state == GRXWriterStatePaused) {
_state = newState;
[self maybeStartNextRead];
}
return;
case GRXWriterStateNotStarted:
return;
}
}
}
@end

@ -18,11 +18,57 @@
#import <Foundation/Foundation.h>
#import "GRPCTypes.h"
NS_ASSUME_NONNULL_BEGIN
@protocol GRPCInterceptorFactory;
/**
* Safety remark of a gRPC method as defined in RFC 2616 Section 9.1
*/
typedef NS_ENUM(NSUInteger, GRPCCallSafety) {
/** Signal that there is no guarantees on how the call affects the server state. */
GRPCCallSafetyDefault = 0,
/** Signal that the call is idempotent. gRPC is free to use PUT verb. */
GRPCCallSafetyIdempotentRequest = 1,
/**
* Signal that the call is cacheable and will not affect server state. gRPC is free to use GET
* verb.
*/
GRPCCallSafetyCacheableRequest = 2,
};
// Compression algorithm to be used by a gRPC call
typedef NS_ENUM(NSUInteger, GRPCCompressionAlgorithm) {
GRPCCompressNone = 0,
GRPCCompressDeflate,
GRPCCompressGzip,
GRPCStreamCompressGzip,
};
// GRPCCompressAlgorithm is deprecated; use GRPCCompressionAlgorithm
typedef GRPCCompressionAlgorithm GRPCCompressAlgorithm;
/** The transport to be used by a gRPC call */
typedef NS_ENUM(NSUInteger, GRPCTransportType) {
GRPCTransportTypeDefault = 0,
/** gRPC internal HTTP/2 stack with BoringSSL */
GRPCTransportTypeChttp2BoringSSL = 0,
/** Cronet stack */
GRPCTransportTypeCronet,
/** Insecure channel. FOR TEST ONLY! */
GRPCTransportTypeInsecure,
};
/**
* Implement this protocol to provide a token to gRPC when a call is initiated.
*/
@protocol GRPCAuthorizationProtocol
/**
* This method is called when gRPC is about to start the call. When OAuth token is acquired,
* \a handler is expected to be called with \a token being the new token to be used for this call.
*/
- (void)getTokenWithHandler:(void (^)(NSString *_Nullable token))handler;
@end
@interface GRPCCallOptions : NSObject<NSCopying, NSMutableCopying>
@ -58,7 +104,7 @@ NS_ASSUME_NONNULL_BEGIN
* this array. This parameter should not be modified by any interceptor and will
* not take effect if done so.
*/
@property(copy, readonly) NSArray<id<GRPCInterceptorFactory>> *interceptorFactories;
@property(copy, readonly) NSArray *interceptorFactories;
// OAuth2 parameters. Users of gRPC may specify one of the following two parameters.
@ -146,23 +192,10 @@ NS_ASSUME_NONNULL_BEGIN
@property(copy, readonly, nullable) NSString *PEMCertificateChain;
/**
* Deprecated: this option is deprecated. Please use the property \a transport
* instead.
*
* Select the transport type to be used for this call.
*/
@property(readonly) GRPCTransportType transportType;
/**
* The transport to be used for this call. Users may choose a native transport
* identifier defined in \a GRPCTransport or provided by a non-native transport
* implementation. If the option is left to be NULL, gRPC will use its default
* transport.
*
* This is currently an experimental option.
*/
@property(readonly) GRPCTransportId transport;
/**
* Override the hostname during the TLS hostname validation process.
*/
@ -234,7 +267,7 @@ NS_ASSUME_NONNULL_BEGIN
* this array. This parameter should not be modified by any interceptor and will
* not take effect if done so.
*/
@property(copy, readwrite) NSArray<id<GRPCInterceptorFactory>> *interceptorFactories;
@property(copy, readwrite) NSArray *interceptorFactories;
// OAuth2 parameters. Users of gRPC may specify one of the following two parameters.
@ -324,23 +357,10 @@ NS_ASSUME_NONNULL_BEGIN
@property(copy, readwrite, nullable) NSString *PEMCertificateChain;
/**
* Deprecated: this option is deprecated. Please use the property \a transport
* instead.
*
* Select the transport type to be used for this call.
*/
@property(readwrite) GRPCTransportType transportType;
/**
* The transport to be used for this call. Users may choose a native transport
* identifier defined in \a GRPCTransport or provided by a non-native ttransport
* implementation. If the option is left to be NULL, gRPC will use its default
* transport.
*
* An interceptor must not change the value of this option.
*/
@property(readwrite) GRPCTransportId transport;
/**
* Override the hostname during the TLS hostname validation process.
*/

@ -17,14 +17,13 @@
*/
#import "GRPCCallOptions.h"
#import "GRPCTransport.h"
#import "internal/GRPCCallOptions+Internal.h"
// The default values for the call options.
static NSString *const kDefaultServerAuthority = nil;
static const NSTimeInterval kDefaultTimeout = 0;
static const BOOL kDefaultFlowControlEnabled = NO;
static NSArray<id<GRPCInterceptorFactory>> *const kDefaultInterceptorFactories = nil;
static NSArray *const kDefaultInterceptorFactories = nil;
static NSDictionary *const kDefaultInitialMetadata = nil;
static NSString *const kDefaultUserAgentPrefix = nil;
static const NSUInteger kDefaultResponseSizeLimit = 0;
@ -42,7 +41,6 @@ static NSString *const kDefaultPEMCertificateChain = nil;
static NSString *const kDefaultOauth2AccessToken = nil;
static const id<GRPCAuthorizationProtocol> kDefaultAuthTokenProvider = nil;
static const GRPCTransportType kDefaultTransportType = GRPCTransportTypeChttp2BoringSSL;
static const GRPCTransportId kDefaultTransport = NULL;
static NSString *const kDefaultHostNameOverride = nil;
static const id kDefaultLogContext = nil;
static NSString *const kDefaultChannelPoolDomain = nil;
@ -64,7 +62,7 @@ static BOOL areObjectsEqual(id obj1, id obj2) {
NSString *_serverAuthority;
NSTimeInterval _timeout;
BOOL _flowControlEnabled;
NSArray<id<GRPCInterceptorFactory>> *_interceptorFactories;
NSArray *_interceptorFactories;
NSString *_oauth2AccessToken;
id<GRPCAuthorizationProtocol> _authTokenProvider;
NSDictionary *_initialMetadata;
@ -82,7 +80,6 @@ static BOOL areObjectsEqual(id obj1, id obj2) {
NSString *_PEMPrivateKey;
NSString *_PEMCertificateChain;
GRPCTransportType _transportType;
GRPCTransportId _transport;
NSString *_hostNameOverride;
id<NSObject> _logContext;
NSString *_channelPoolDomain;
@ -110,7 +107,6 @@ static BOOL areObjectsEqual(id obj1, id obj2) {
@synthesize PEMPrivateKey = _PEMPrivateKey;
@synthesize PEMCertificateChain = _PEMCertificateChain;
@synthesize transportType = _transportType;
@synthesize transport = _transport;
@synthesize hostNameOverride = _hostNameOverride;
@synthesize logContext = _logContext;
@synthesize channelPoolDomain = _channelPoolDomain;
@ -138,7 +134,6 @@ static BOOL areObjectsEqual(id obj1, id obj2) {
PEMPrivateKey:kDefaultPEMPrivateKey
PEMCertificateChain:kDefaultPEMCertificateChain
transportType:kDefaultTransportType
transport:kDefaultTransport
hostNameOverride:kDefaultHostNameOverride
logContext:kDefaultLogContext
channelPoolDomain:kDefaultChannelPoolDomain
@ -148,7 +143,7 @@ static BOOL areObjectsEqual(id obj1, id obj2) {
- (instancetype)initWithServerAuthority:(NSString *)serverAuthority
timeout:(NSTimeInterval)timeout
flowControlEnabled:(BOOL)flowControlEnabled
interceptorFactories:(NSArray<id<GRPCInterceptorFactory>> *)interceptorFactories
interceptorFactories:(NSArray *)interceptorFactories
oauth2AccessToken:(NSString *)oauth2AccessToken
authTokenProvider:(id<GRPCAuthorizationProtocol>)authTokenProvider
initialMetadata:(NSDictionary *)initialMetadata
@ -166,7 +161,6 @@ static BOOL areObjectsEqual(id obj1, id obj2) {
PEMPrivateKey:(NSString *)PEMPrivateKey
PEMCertificateChain:(NSString *)PEMCertificateChain
transportType:(GRPCTransportType)transportType
transport:(GRPCTransportId)transport
hostNameOverride:(NSString *)hostNameOverride
logContext:(id)logContext
channelPoolDomain:(NSString *)channelPoolDomain
@ -199,7 +193,6 @@ static BOOL areObjectsEqual(id obj1, id obj2) {
_PEMPrivateKey = [PEMPrivateKey copy];
_PEMCertificateChain = [PEMCertificateChain copy];
_transportType = transportType;
_transport = transport;
_hostNameOverride = [hostNameOverride copy];
_logContext = logContext;
_channelPoolDomain = [channelPoolDomain copy];
@ -231,7 +224,6 @@ static BOOL areObjectsEqual(id obj1, id obj2) {
PEMPrivateKey:_PEMPrivateKey
PEMCertificateChain:_PEMCertificateChain
transportType:_transportType
transport:_transport
hostNameOverride:_hostNameOverride
logContext:_logContext
channelPoolDomain:_channelPoolDomain
@ -264,7 +256,6 @@ static BOOL areObjectsEqual(id obj1, id obj2) {
PEMPrivateKey:[_PEMPrivateKey copy]
PEMCertificateChain:[_PEMCertificateChain copy]
transportType:_transportType
transport:_transport
hostNameOverride:[_hostNameOverride copy]
logContext:_logContext
channelPoolDomain:[_channelPoolDomain copy]
@ -289,7 +280,6 @@ static BOOL areObjectsEqual(id obj1, id obj2) {
if (!areObjectsEqual(callOptions.PEMCertificateChain, _PEMCertificateChain)) return NO;
if (!areObjectsEqual(callOptions.hostNameOverride, _hostNameOverride)) return NO;
if (!(callOptions.transportType == _transportType)) return NO;
if (!(TransportIdIsEqual(callOptions.transport, _transport))) return NO;
if (!areObjectsEqual(callOptions.logContext, _logContext)) return NO;
if (!areObjectsEqual(callOptions.channelPoolDomain, _channelPoolDomain)) return NO;
if (!(callOptions.channelID == _channelID)) return NO;
@ -314,7 +304,6 @@ static BOOL areObjectsEqual(id obj1, id obj2) {
result ^= _PEMCertificateChain.hash;
result ^= _hostNameOverride.hash;
result ^= _transportType;
result ^= TransportIdHash(_transport);
result ^= _logContext.hash;
result ^= _channelPoolDomain.hash;
result ^= _channelID;
@ -347,7 +336,6 @@ static BOOL areObjectsEqual(id obj1, id obj2) {
@dynamic PEMPrivateKey;
@dynamic PEMCertificateChain;
@dynamic transportType;
@dynamic transport;
@dynamic hostNameOverride;
@dynamic logContext;
@dynamic channelPoolDomain;
@ -375,7 +363,6 @@ static BOOL areObjectsEqual(id obj1, id obj2) {
PEMPrivateKey:kDefaultPEMPrivateKey
PEMCertificateChain:kDefaultPEMCertificateChain
transportType:kDefaultTransportType
transport:kDefaultTransport
hostNameOverride:kDefaultHostNameOverride
logContext:kDefaultLogContext
channelPoolDomain:kDefaultChannelPoolDomain
@ -405,7 +392,6 @@ static BOOL areObjectsEqual(id obj1, id obj2) {
PEMPrivateKey:_PEMPrivateKey
PEMCertificateChain:_PEMCertificateChain
transportType:_transportType
transport:_transport
hostNameOverride:_hostNameOverride
logContext:_logContext
channelPoolDomain:_channelPoolDomain
@ -436,7 +422,6 @@ static BOOL areObjectsEqual(id obj1, id obj2) {
PEMPrivateKey:_PEMPrivateKey
PEMCertificateChain:_PEMCertificateChain
transportType:_transportType
transport:_transport
hostNameOverride:_hostNameOverride
logContext:_logContext
channelPoolDomain:_channelPoolDomain
@ -460,7 +445,7 @@ static BOOL areObjectsEqual(id obj1, id obj2) {
_flowControlEnabled = flowControlEnabled;
}
- (void)setInterceptorFactories:(NSArray<id<GRPCInterceptorFactory>> *)interceptorFactories {
- (void)setInterceptorFactories:(NSArray *)interceptorFactories {
_interceptorFactories = interceptorFactories;
}
@ -553,10 +538,6 @@ static BOOL areObjectsEqual(id obj1, id obj2) {
_transportType = transportType;
}
- (void)setTransport:(GRPCTransportId)transport {
_transport = transport;
}
- (void)setHostNameOverride:(NSString *)hostNameOverride {
_hostNameOverride = [hostNameOverride copy];
}

@ -1,30 +0,0 @@
/*
*
* Copyright 2019 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
/**
* An object that processes its methods with a dispatch queue.
*/
@protocol GRPCDispatchable
/**
* The dispatch queue where the object's methods should be run on.
*/
@property(atomic, readonly) dispatch_queue_t dispatchQueue;
@end

@ -106,20 +106,22 @@
*/
#import "GRPCCall.h"
#import "GRPCDispatchable.h"
NS_ASSUME_NONNULL_BEGIN
@class GRPCInterceptorManager;
@class GRPCInterceptor;
@class GRPCRequestOptions;
@class GRPCCallOptions;
@protocol GRPCResponseHandler;
/**
* The GRPCInterceptorInterface defines the request events that can occur to an interceptr.
*/
@protocol GRPCInterceptorInterface<NSObject, GRPCDispatchable>
@protocol GRPCInterceptorInterface<NSObject>
/**
* The queue on which all methods of this interceptor should be dispatched on. The queue must be a
* serial queue.
*/
@property(readonly) dispatch_queue_t requestDispatchQueue;
/**
* To start the call. This method will only be called once for each instance.
@ -169,20 +171,19 @@ NS_ASSUME_NONNULL_BEGIN
* invoke shutDown method of its corresponding manager so that references to other interceptors can
* be released.
*/
@interface GRPCInterceptorManager : NSObject<GRPCInterceptorInterface, GRPCResponseHandler>
@interface GRPCInterceptorManager : NSObject
- (instancetype)init NS_UNAVAILABLE;
+ (instancetype) new NS_UNAVAILABLE;
- (nullable instancetype)initWithFactories:(nullable NSArray<id<GRPCInterceptorFactory>> *)factories
previousInterceptor:(nullable id<GRPCResponseHandler>)previousInterceptor
transportId:(GRPCTransportId)transportId;
- (nullable instancetype)initWithNextInterceptor:(id<GRPCInterceptorInterface>)nextInterceptor
NS_DESIGNATED_INITIALIZER;
/**
* Notify the manager that the interceptor has shut down and the manager should release references
* to other interceptors and stop forwarding requests/responses.
*/
/** Set the previous interceptor in the chain. Can only be set once. */
- (void)setPreviousInterceptor:(id<GRPCResponseHandler>)previousInterceptor;
/** Indicate shutdown of the interceptor; release the reference to other interceptors */
- (void)shutDown;
// Methods to forward GRPCInterceptorInterface calls to the next interceptor
@ -234,6 +235,7 @@ NS_ASSUME_NONNULL_BEGIN
@interface GRPCInterceptor : NSObject<GRPCInterceptorInterface, GRPCResponseHandler>
- (instancetype)init NS_UNAVAILABLE;
+ (instancetype) new NS_UNAVAILABLE;
/**
@ -241,7 +243,9 @@ NS_ASSUME_NONNULL_BEGIN
* that this interceptor's methods are dispatched onto.
*/
- (nullable instancetype)initWithInterceptorManager:(GRPCInterceptorManager *)interceptorManager
dispatchQueue:(dispatch_queue_t)dispatchQueue;
requestDispatchQueue:(dispatch_queue_t)requestDispatchQueue
responseDispatchQueue:(dispatch_queue_t)responseDispatchQueue
NS_DESIGNATED_INITIALIZER;
// Default implementation of GRPCInterceptorInterface

@ -19,253 +19,117 @@
#import <Foundation/Foundation.h>
#import "GRPCInterceptor.h"
#import "private/GRPCTransport+Private.h"
@interface GRPCInterceptorManager ()<GRPCInterceptorInterface, GRPCResponseHandler>
@end
@implementation GRPCInterceptorManager {
id<GRPCInterceptorInterface> _nextInterceptor;
id<GRPCResponseHandler> _previousInterceptor;
GRPCInterceptor *_thisInterceptor;
dispatch_queue_t _dispatchQueue;
NSArray<id<GRPCInterceptorFactory>> *_factories;
GRPCTransportId _transportId;
BOOL _shutDown;
}
- (instancetype)initWithFactories:(NSArray<id<GRPCInterceptorFactory>> *)factories
previousInterceptor:(id<GRPCResponseHandler>)previousInterceptor
transportId:(nonnull GRPCTransportId)transportId {
- (instancetype)initWithNextInterceptor:(id<GRPCInterceptorInterface>)nextInterceptor {
if ((self = [super init])) {
if (factories.count == 0) {
[NSException raise:NSInternalInconsistencyException
format:@"Interceptor manager must have factories"];
}
_thisInterceptor = [factories[0] createInterceptorWithManager:self];
if (_thisInterceptor == nil) {
return nil;
}
_previousInterceptor = previousInterceptor;
_factories = factories;
// Generate interceptor
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000 || __MAC_OS_X_VERSION_MAX_ALLOWED >= 101300
if (@available(iOS 8.0, macOS 10.10, *)) {
_dispatchQueue = dispatch_queue_create(
NULL,
dispatch_queue_attr_make_with_qos_class(DISPATCH_QUEUE_SERIAL, QOS_CLASS_DEFAULT, 0));
} else {
#else
{
#endif
_dispatchQueue = dispatch_queue_create(NULL, DISPATCH_QUEUE_SERIAL);
}
dispatch_set_target_queue(_dispatchQueue, _thisInterceptor.dispatchQueue);
_transportId = transportId;
_nextInterceptor = nextInterceptor;
}
return self;
}
- (void)shutDown {
dispatch_async(_dispatchQueue, ^{
self->_nextInterceptor = nil;
self->_previousInterceptor = nil;
self->_thisInterceptor = nil;
self->_shutDown = YES;
});
- (void)setPreviousInterceptor:(id<GRPCResponseHandler>)previousInterceptor {
_previousInterceptor = previousInterceptor;
}
- (void)createNextInterceptor {
NSAssert(_nextInterceptor == nil, @"Starting the next interceptor more than once");
NSAssert(_factories.count > 0, @"Interceptor manager of transport cannot start next interceptor");
if (_nextInterceptor != nil) {
NSLog(@"Starting the next interceptor more than once");
return;
}
NSMutableArray<id<GRPCInterceptorFactory>> *interceptorFactories = [NSMutableArray
arrayWithArray:[_factories subarrayWithRange:NSMakeRange(1, _factories.count - 1)]];
while (_nextInterceptor == nil) {
if (interceptorFactories.count == 0) {
_nextInterceptor =
[[GRPCTransportManager alloc] initWithTransportId:_transportId previousInterceptor:self];
break;
} else {
_nextInterceptor = [[GRPCInterceptorManager alloc] initWithFactories:interceptorFactories
previousInterceptor:self
transportId:_transportId];
if (_nextInterceptor == nil) {
[interceptorFactories removeObjectAtIndex:0];
}
}
}
NSAssert(_nextInterceptor != nil, @"Failed to create interceptor or transport.");
if (_nextInterceptor == nil) {
NSLog(@"Failed to create interceptor or transport.");
}
- (void)shutDown {
_nextInterceptor = nil;
_previousInterceptor = nil;
}
- (void)startNextInterceptorWithRequest:(GRPCRequestOptions *)requestOptions
callOptions:(GRPCCallOptions *)callOptions {
if (_nextInterceptor == nil && !_shutDown) {
[self createNextInterceptor];
}
if (_nextInterceptor == nil) {
return;
if (_nextInterceptor != nil) {
id<GRPCInterceptorInterface> copiedNextInterceptor = _nextInterceptor;
dispatch_async(copiedNextInterceptor.requestDispatchQueue, ^{
[copiedNextInterceptor startWithRequestOptions:requestOptions callOptions:callOptions];
});
}
id<GRPCInterceptorInterface> copiedNextInterceptor = _nextInterceptor;
dispatch_async(copiedNextInterceptor.dispatchQueue, ^{
[copiedNextInterceptor startWithRequestOptions:requestOptions callOptions:callOptions];
});
}
- (void)writeNextInterceptorWithData:(id)data {
if (_nextInterceptor == nil && !_shutDown) {
[self createNextInterceptor];
}
if (_nextInterceptor == nil) {
return;
if (_nextInterceptor != nil) {
id<GRPCInterceptorInterface> copiedNextInterceptor = _nextInterceptor;
dispatch_async(copiedNextInterceptor.requestDispatchQueue, ^{
[copiedNextInterceptor writeData:data];
});
}
id<GRPCInterceptorInterface> copiedNextInterceptor = _nextInterceptor;
dispatch_async(copiedNextInterceptor.dispatchQueue, ^{
[copiedNextInterceptor writeData:data];
});
}
- (void)finishNextInterceptor {
if (_nextInterceptor == nil && !_shutDown) {
[self createNextInterceptor];
}
if (_nextInterceptor == nil) {
return;
if (_nextInterceptor != nil) {
id<GRPCInterceptorInterface> copiedNextInterceptor = _nextInterceptor;
dispatch_async(copiedNextInterceptor.requestDispatchQueue, ^{
[copiedNextInterceptor finish];
});
}
id<GRPCInterceptorInterface> copiedNextInterceptor = _nextInterceptor;
dispatch_async(copiedNextInterceptor.dispatchQueue, ^{
[copiedNextInterceptor finish];
});
}
- (void)cancelNextInterceptor {
if (_nextInterceptor == nil && !_shutDown) {
[self createNextInterceptor];
}
if (_nextInterceptor == nil) {
return;
if (_nextInterceptor != nil) {
id<GRPCInterceptorInterface> copiedNextInterceptor = _nextInterceptor;
dispatch_async(copiedNextInterceptor.requestDispatchQueue, ^{
[copiedNextInterceptor cancel];
});
}
id<GRPCInterceptorInterface> copiedNextInterceptor = _nextInterceptor;
dispatch_async(copiedNextInterceptor.dispatchQueue, ^{
[copiedNextInterceptor cancel];
});
}
/** Notify the next interceptor in the chain to receive more messages */
- (void)receiveNextInterceptorMessages:(NSUInteger)numberOfMessages {
if (_nextInterceptor == nil && !_shutDown) {
[self createNextInterceptor];
}
if (_nextInterceptor == nil) {
return;
if (_nextInterceptor != nil) {
id<GRPCInterceptorInterface> copiedNextInterceptor = _nextInterceptor;
dispatch_async(copiedNextInterceptor.requestDispatchQueue, ^{
[copiedNextInterceptor receiveNextMessages:numberOfMessages];
});
}
id<GRPCInterceptorInterface> copiedNextInterceptor = _nextInterceptor;
dispatch_async(copiedNextInterceptor.dispatchQueue, ^{
[copiedNextInterceptor receiveNextMessages:numberOfMessages];
});
}
// Methods to forward GRPCResponseHandler callbacks to the previous object
/** Forward initial metadata to the previous interceptor in the chain */
- (void)forwardPreviousInterceptorWithInitialMetadata:(NSDictionary *)initialMetadata {
if (_previousInterceptor == nil) {
return;
- (void)forwardPreviousInterceptorWithInitialMetadata:(nullable NSDictionary *)initialMetadata {
if ([_previousInterceptor respondsToSelector:@selector(didReceiveInitialMetadata:)]) {
id<GRPCResponseHandler> copiedPreviousInterceptor = _previousInterceptor;
dispatch_async(copiedPreviousInterceptor.dispatchQueue, ^{
[copiedPreviousInterceptor didReceiveInitialMetadata:initialMetadata];
});
}
id<GRPCResponseHandler> copiedPreviousInterceptor = _previousInterceptor;
dispatch_async(copiedPreviousInterceptor.dispatchQueue, ^{
[copiedPreviousInterceptor didReceiveInitialMetadata:initialMetadata];
});
}
/** Forward a received message to the previous interceptor in the chain */
- (void)forwardPreviousInterceptorWithData:(id)data {
if (_previousInterceptor == nil) {
return;
if ([_previousInterceptor respondsToSelector:@selector(didReceiveData:)]) {
id<GRPCResponseHandler> copiedPreviousInterceptor = _previousInterceptor;
dispatch_async(copiedPreviousInterceptor.dispatchQueue, ^{
[copiedPreviousInterceptor didReceiveData:data];
});
}
id<GRPCResponseHandler> copiedPreviousInterceptor = _previousInterceptor;
dispatch_async(copiedPreviousInterceptor.dispatchQueue, ^{
[copiedPreviousInterceptor didReceiveData:data];
});
}
/** Forward call close and trailing metadata to the previous interceptor in the chain */
- (void)forwardPreviousInterceptorCloseWithTrailingMetadata:(NSDictionary *)trailingMetadata
error:(NSError *)error {
if (_previousInterceptor == nil) {
return;
- (void)forwardPreviousInterceptorCloseWithTrailingMetadata:
(nullable NSDictionary *)trailingMetadata
error:(nullable NSError *)error {
if ([_previousInterceptor respondsToSelector:@selector(didCloseWithTrailingMetadata:error:)]) {
id<GRPCResponseHandler> copiedPreviousInterceptor = _previousInterceptor;
dispatch_async(copiedPreviousInterceptor.dispatchQueue, ^{
[copiedPreviousInterceptor didCloseWithTrailingMetadata:trailingMetadata error:error];
});
}
id<GRPCResponseHandler> copiedPreviousInterceptor = _previousInterceptor;
dispatch_async(copiedPreviousInterceptor.dispatchQueue, ^{
[copiedPreviousInterceptor didCloseWithTrailingMetadata:trailingMetadata error:error];
});
}
/** Forward write completion to the previous interceptor in the chain */
- (void)forwardPreviousInterceptorDidWriteData {
if (_previousInterceptor == nil) {
return;
}
id<GRPCResponseHandler> copiedPreviousInterceptor = _previousInterceptor;
dispatch_async(copiedPreviousInterceptor.dispatchQueue, ^{
[copiedPreviousInterceptor didWriteData];
});
}
- (dispatch_queue_t)dispatchQueue {
return _dispatchQueue;
}
- (void)startWithRequestOptions:(GRPCRequestOptions *)requestOptions
callOptions:(GRPCCallOptions *)callOptions {
[_thisInterceptor startWithRequestOptions:requestOptions callOptions:callOptions];
}
- (void)writeData:(id)data {
[_thisInterceptor writeData:data];
}
- (void)finish {
[_thisInterceptor finish];
}
- (void)cancel {
[_thisInterceptor cancel];
}
- (void)receiveNextMessages:(NSUInteger)numberOfMessages {
[_thisInterceptor receiveNextMessages:numberOfMessages];
}
- (void)didReceiveInitialMetadata:(nullable NSDictionary *)initialMetadata {
if ([_thisInterceptor respondsToSelector:@selector(didReceiveInitialMetadata:)]) {
[_thisInterceptor didReceiveInitialMetadata:initialMetadata];
}
}
- (void)didReceiveData:(id)data {
if ([_thisInterceptor respondsToSelector:@selector(didReceiveData:)]) {
[_thisInterceptor didReceiveData:data];
}
}
- (void)didCloseWithTrailingMetadata:(nullable NSDictionary *)trailingMetadata
error:(nullable NSError *)error {
if ([_thisInterceptor respondsToSelector:@selector(didCloseWithTrailingMetadata:error:)]) {
[_thisInterceptor didCloseWithTrailingMetadata:trailingMetadata error:error];
}
}
- (void)didWriteData {
if ([_thisInterceptor respondsToSelector:@selector(didWriteData)]) {
[_thisInterceptor didWriteData];
if ([_previousInterceptor respondsToSelector:@selector(didWriteData)]) {
id<GRPCResponseHandler> copiedPreviousInterceptor = _previousInterceptor;
dispatch_async(copiedPreviousInterceptor.dispatchQueue, ^{
[copiedPreviousInterceptor didWriteData];
});
}
}
@ -273,21 +137,28 @@
@implementation GRPCInterceptor {
GRPCInterceptorManager *_manager;
dispatch_queue_t _dispatchQueue;
dispatch_queue_t _requestDispatchQueue;
dispatch_queue_t _responseDispatchQueue;
}
- (instancetype)initWithInterceptorManager:(GRPCInterceptorManager *)interceptorManager
dispatchQueue:(dispatch_queue_t)dispatchQueue {
requestDispatchQueue:(dispatch_queue_t)requestDispatchQueue
responseDispatchQueue:(dispatch_queue_t)responseDispatchQueue {
if ((self = [super init])) {
_manager = interceptorManager;
_dispatchQueue = dispatchQueue;
_requestDispatchQueue = requestDispatchQueue;
_responseDispatchQueue = responseDispatchQueue;
}
return self;
}
- (dispatch_queue_t)requestDispatchQueue {
return _requestDispatchQueue;
}
- (dispatch_queue_t)dispatchQueue {
return _dispatchQueue;
return _responseDispatchQueue;
}
- (void)startWithRequestOptions:(GRPCRequestOptions *)requestOptions

@ -1,82 +0,0 @@
/*
*
* Copyright 2019 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
// The interface for a transport implementation
#import "GRPCInterceptor.h"
NS_ASSUME_NONNULL_BEGIN
#pragma mark Transport ID
/**
* The default transport implementations available in gRPC. These implementations will be provided
* by gRPC by default unless explicitly excluded.
*/
extern const struct GRPCDefaultTransportImplList {
const GRPCTransportId core_secure;
const GRPCTransportId core_insecure;
} GRPCDefaultTransportImplList;
/** Returns whether two transport id's are identical. */
BOOL TransportIdIsEqual(GRPCTransportId lhs, GRPCTransportId rhs);
/** Returns the hash value of a transport id. */
NSUInteger TransportIdHash(GRPCTransportId);
#pragma mark Transport and factory
@protocol GRPCInterceptorInterface;
@protocol GRPCResponseHandler;
@class GRPCTransportManager;
@class GRPCRequestOptions;
@class GRPCCallOptions;
@class GRPCTransport;
/** The factory method to create a transport. */
@protocol GRPCTransportFactory<NSObject>
- (GRPCTransport *)createTransportWithManager:(GRPCTransportManager *)transportManager;
@end
/** The registry of transport implementations. */
@interface GRPCTransportRegistry : NSObject
+ (instancetype)sharedInstance;
/**
* Register a transport implementation with the registry. All transport implementations to be used
* in a process must register with the registry on process start-up in its +load: class method.
* Parameter \a transportId is the identifier of the implementation, and \a factory is the factory
* object to create the corresponding transport instance.
*/
- (void)registerTransportWithId:(GRPCTransportId)transportId
factory:(id<GRPCTransportFactory>)factory;
@end
/**
* Base class for transport implementations. All transport implementation should inherit from this
* class.
*/
@interface GRPCTransport : NSObject<GRPCInterceptorInterface>
@end
NS_ASSUME_NONNULL_END

@ -1,142 +0,0 @@
/*
*
* Copyright 2019 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#import "GRPCTransport.h"
static const GRPCTransportId gGRPCCoreSecureId = "io.grpc.transport.core.secure";
static const GRPCTransportId gGRPCCoreInsecureId = "io.grpc.transport.core.insecure";
const struct GRPCDefaultTransportImplList GRPCDefaultTransportImplList = {
.core_secure = gGRPCCoreSecureId, .core_insecure = gGRPCCoreInsecureId};
static const GRPCTransportId gDefaultTransportId = gGRPCCoreSecureId;
static GRPCTransportRegistry *gTransportRegistry = nil;
static dispatch_once_t initTransportRegistry;
BOOL TransportIdIsEqual(GRPCTransportId lhs, GRPCTransportId rhs) {
// Directly comparing pointers works because we require users to use the id provided by each
// implementation, not coming up with their own string.
return lhs == rhs;
}
NSUInteger TransportIdHash(GRPCTransportId transportId) {
if (transportId == NULL) {
transportId = gDefaultTransportId;
}
return [NSString stringWithCString:transportId encoding:NSUTF8StringEncoding].hash;
}
@implementation GRPCTransportRegistry {
NSMutableDictionary<NSString *, id<GRPCTransportFactory>> *_registry;
id<GRPCTransportFactory> _defaultFactory;
}
+ (instancetype)sharedInstance {
dispatch_once(&initTransportRegistry, ^{
gTransportRegistry = [[GRPCTransportRegistry alloc] init];
NSAssert(gTransportRegistry != nil, @"Unable to initialize transport registry.");
if (gTransportRegistry == nil) {
NSLog(@"Unable to initialize transport registry.");
[NSException raise:NSGenericException format:@"Unable to initialize transport registry."];
}
});
return gTransportRegistry;
}
- (instancetype)init {
if ((self = [super init])) {
_registry = [NSMutableDictionary dictionary];
}
return self;
}
- (void)registerTransportWithId:(GRPCTransportId)transportId
factory:(id<GRPCTransportFactory>)factory {
NSString *nsTransportId = [NSString stringWithCString:transportId encoding:NSUTF8StringEncoding];
NSAssert(_registry[nsTransportId] == nil, @"The transport %@ has already been registered.",
nsTransportId);
if (_registry[nsTransportId] != nil) {
NSLog(@"The transport %@ has already been registered.", nsTransportId);
return;
}
_registry[nsTransportId] = factory;
// if the default transport is registered, mark it.
if (0 == strcmp(transportId, gDefaultTransportId)) {
_defaultFactory = factory;
}
}
- (id<GRPCTransportFactory>)getTransportFactoryWithId:(GRPCTransportId)transportId {
if (transportId == NULL) {
if (_defaultFactory == nil) {
[NSException raise:NSInvalidArgumentException
format:@"Unable to get default transport factory"];
return nil;
}
return _defaultFactory;
}
NSString *nsTransportId = [NSString stringWithCString:transportId encoding:NSUTF8StringEncoding];
id<GRPCTransportFactory> transportFactory = _registry[nsTransportId];
if (transportFactory == nil) {
// User named a transport id that was not registered with the registry.
[NSException raise:NSInvalidArgumentException
format:@"Unable to get transport factory with id %s", transportId];
return nil;
}
return transportFactory;
}
@end
@implementation GRPCTransport
- (dispatch_queue_t)dispatchQueue {
[NSException raise:NSGenericException
format:@"Implementations should override the dispatch queue"];
return nil;
}
- (void)startWithRequestOptions:(nonnull GRPCRequestOptions *)requestOptions
callOptions:(nonnull GRPCCallOptions *)callOptions {
[NSException raise:NSGenericException
format:@"Implementations should override the methods of GRPCTransport"];
}
- (void)writeData:(nonnull id)data {
[NSException raise:NSGenericException
format:@"Implementations should override the methods of GRPCTransport"];
}
- (void)cancel {
[NSException raise:NSGenericException
format:@"Implementations should override the methods of GRPCTransport"];
}
- (void)finish {
[NSException raise:NSGenericException
format:@"Implementations should override the methods of GRPCTransport"];
}
- (void)receiveNextMessages:(NSUInteger)numberOfMessages {
[NSException raise:NSGenericException
format:@"Implementations should override the methods of GRPCTransport"];
}
@end

@ -1,187 +0,0 @@
/*
*
* Copyright 2019 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
/**
* gRPC error codes.
* Note that a few of these are never produced by the gRPC libraries, but are of
* general utility for server applications to produce.
*/
typedef NS_ENUM(NSUInteger, GRPCErrorCode) {
/** The operation was cancelled (typically by the caller). */
GRPCErrorCodeCancelled = 1,
/**
* Unknown error. Errors raised by APIs that do not return enough error
* information may be converted to this error.
*/
GRPCErrorCodeUnknown = 2,
/**
* The client specified an invalid argument. Note that this differs from
* FAILED_PRECONDITION. INVALID_ARGUMENT indicates arguments that are
* problematic regardless of the state of the server (e.g., a malformed file
* name).
*/
GRPCErrorCodeInvalidArgument = 3,
/**
* Deadline expired before operation could complete. For operations that
* change the state of the server, this error may be returned even if the
* operation has completed successfully. For example, a successful response
* from the server could have been delayed long enough for the deadline to
* expire.
*/
GRPCErrorCodeDeadlineExceeded = 4,
/** Some requested entity (e.g., file or directory) was not found. */
GRPCErrorCodeNotFound = 5,
/** Some entity that we attempted to create (e.g., file or directory) already
exists. */
GRPCErrorCodeAlreadyExists = 6,
/**
* The caller does not have permission to execute the specified operation.
* PERMISSION_DENIED isn't used for rejections caused by exhausting some
* resource (RESOURCE_EXHAUSTED is used instead for those errors).
* PERMISSION_DENIED doesn't indicate a failure to identify the caller
* (UNAUTHENTICATED is used instead for those errors).
*/
GRPCErrorCodePermissionDenied = 7,
/**
* The request does not have valid authentication credentials for the
* operation (e.g. the caller's identity can't be verified).
*/
GRPCErrorCodeUnauthenticated = 16,
/** Some resource has been exhausted, perhaps a per-user quota. */
GRPCErrorCodeResourceExhausted = 8,
/**
* The RPC was rejected because the server is not in a state required for the
* procedure's execution. For example, a directory to be deleted may be
* non-empty, etc. The client should not retry until the server state has been
* explicitly fixed (e.g. by performing another RPC). The details depend on
* the service being called, and should be found in the NSError's userInfo.
*/
GRPCErrorCodeFailedPrecondition = 9,
/**
* The RPC was aborted, typically due to a concurrency issue like sequencer
* check failures, transaction aborts, etc. The client should retry at a
* higher-level (e.g., restarting a read- modify-write sequence).
*/
GRPCErrorCodeAborted = 10,
/**
* The RPC was attempted past the valid range. E.g., enumerating past the end
* of a list. Unlike INVALID_ARGUMENT, this error indicates a problem that may
* be fixed if the system state changes. For example, an RPC to get elements
* of a list will generate INVALID_ARGUMENT if asked to return the element at
* a negative index, but it will generate OUT_OF_RANGE if asked to return the
* element at an index past the current size of the list.
*/
GRPCErrorCodeOutOfRange = 11,
/** The procedure is not implemented or not supported/enabled in this server.
*/
GRPCErrorCodeUnimplemented = 12,
/**
* Internal error. Means some invariant expected by the server application or
* the gRPC library has been broken.
*/
GRPCErrorCodeInternal = 13,
/**
* The server is currently unavailable. This is most likely a transient
* condition and may be corrected by retrying with a backoff. Note that it is
* not always safe to retry non-idempotent operations.
*/
GRPCErrorCodeUnavailable = 14,
/** Unrecoverable data loss or corruption. */
GRPCErrorCodeDataLoss = 15,
};
/**
* Safety remark of a gRPC method as defined in RFC 2616 Section 9.1
*/
typedef NS_ENUM(NSUInteger, GRPCCallSafety) {
/**
* Signal that there is no guarantees on how the call affects the server
* state.
*/
GRPCCallSafetyDefault = 0,
/** Signal that the call is idempotent. gRPC is free to use PUT verb. */
GRPCCallSafetyIdempotentRequest = 1,
/**
* Signal that the call is cacheable and will not affect server state. gRPC is
* free to use GET verb.
*/
GRPCCallSafetyCacheableRequest = 2,
};
// Compression algorithm to be used by a gRPC call
typedef NS_ENUM(NSUInteger, GRPCCompressionAlgorithm) {
GRPCCompressNone = 0,
GRPCCompressDeflate,
GRPCCompressGzip,
GRPCStreamCompressGzip,
};
// GRPCCompressAlgorithm is deprecated; use GRPCCompressionAlgorithm
typedef GRPCCompressionAlgorithm GRPCCompressAlgorithm;
/** The transport to be used by a gRPC call */
typedef NS_ENUM(NSUInteger, GRPCTransportType) {
GRPCTransportTypeDefault = 0,
/** gRPC internal HTTP/2 stack with BoringSSL */
GRPCTransportTypeChttp2BoringSSL = 0,
/** Cronet stack */
GRPCTransportTypeCronet,
/** Insecure channel. FOR TEST ONLY! */
GRPCTransportTypeInsecure,
};
/** Domain of NSError objects produced by gRPC. */
extern NSString* _Nonnull const kGRPCErrorDomain;
/**
* Keys used in |NSError|'s |userInfo| dictionary to store the response headers
* and trailers sent by the server.
*/
extern NSString* _Nonnull const kGRPCHeadersKey;
extern NSString* _Nonnull const kGRPCTrailersKey;
/** The id of a transport implementation. */
typedef char* _Nonnull GRPCTransportId;
/**
* Implement this protocol to provide a token to gRPC when a call is initiated.
*/
@protocol GRPCAuthorizationProtocol
/**
* This method is called when gRPC is about to start the call. When OAuth token is acquired,
* \a handler is expected to be called with \a token being the new token to be used for this call.
*/
- (void)getTokenWithHandler:(void (^_Nonnull)(NSString* _Nullable token))handler;
@end

@ -20,7 +20,7 @@
#import "GRPCCall+InternalTests.h"
#import "../private/GRPCCore/GRPCOpBatchLog.h"
#import "../private/GRPCOpBatchLog.h"
@implementation GRPCCall (InternalTests)

@ -18,6 +18,12 @@
@interface GRPCCall (V2API)
- (instancetype)initWithHost:(NSString *)host
path:(NSString *)path
callSafety:(GRPCCallSafety)safety
requestsWriter:(GRXWriter *)requestsWriter
callOptions:(GRPCCallOptions *)callOptions;
- (instancetype)initWithHost:(NSString *)host
path:(NSString *)path
callSafety:(GRPCCallSafety)safety

@ -16,22 +16,20 @@
*
*/
#import <GRPCClient/GRPCTransport.h>
#import <GRPCClient/GRPCInterceptor.h>
NS_ASSUME_NONNULL_BEGIN
@protocol GRPCResponseHandler;
@class GRPCCallOptions;
@protocol GRPCChannelFactory;
@interface GRPCCall2Internal : NSObject<GRPCInterceptorInterface>
@interface GRPCCall2Internal : GRPCTransport
- (instancetype)init;
- (instancetype)initWithTransportManager:(GRPCTransportManager *)transportManager;
- (void)setResponseHandler:(id<GRPCResponseHandler>)responseHandler;
- (void)startWithRequestOptions:(GRPCRequestOptions *)requestOptions
callOptions:(GRPCCallOptions *)callOptions;
callOptions:(nullable GRPCCallOptions *)callOptions;
- (void)writeData:(id)data;
- (void)writeData:(NSData *)data;
- (void)finish;

@ -19,10 +19,8 @@
#import "GRPCCallInternal.h"
#import <GRPCClient/GRPCCall.h>
#import <GRPCClient/GRPCInterceptor.h>
#import <RxLibrary/GRXBufferedPipe.h>
#import "../GRPCTransport+Private.h"
#import "GRPCCall+V2API.h"
@implementation GRPCCall2Internal {
@ -30,8 +28,8 @@
GRPCRequestOptions *_requestOptions;
/** Options for the call. */
GRPCCallOptions *_callOptions;
/** The interceptor manager to process responses. */
GRPCTransportManager *_transportManager;
/** The handler of responses. */
id<GRPCResponseHandler> _handler;
/**
* Make use of legacy GRPCCall to make calls. Nullified when call is finished.
@ -53,28 +51,40 @@
NSUInteger _pendingReceiveNextMessages;
}
- (instancetype)initWithTransportManager:(GRPCTransportManager *)transportManager {
dispatch_queue_t dispatchQueue;
- (instancetype)init {
if ((self = [super init])) {
// Set queue QoS only when iOS version is 8.0 or above and Xcode version is 9.0 or above
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000 || __MAC_OS_X_VERSION_MAX_ALLOWED >= 101300
if (@available(iOS 8.0, macOS 10.10, *)) {
dispatchQueue = dispatch_queue_create(
NULL, dispatch_queue_attr_make_with_qos_class(DISPATCH_QUEUE_SERIAL, QOS_CLASS_DEFAULT, 0));
} else {
if (@available(iOS 8.0, macOS 10.10, *)) {
_dispatchQueue = dispatch_queue_create(
NULL,
dispatch_queue_attr_make_with_qos_class(DISPATCH_QUEUE_SERIAL, QOS_CLASS_DEFAULT, 0));
} else {
#else
{
{
#endif
dispatchQueue = dispatch_queue_create(NULL, DISPATCH_QUEUE_SERIAL);
}
if ((self = [super init])) {
_dispatchQueue = dispatch_queue_create(NULL, DISPATCH_QUEUE_SERIAL);
}
_pipe = [GRXBufferedPipe pipe];
_transportManager = transportManager;
_dispatchQueue = dispatchQueue;
}
return self;
}
- (dispatch_queue_t)dispatchQueue {
- (void)setResponseHandler:(id<GRPCResponseHandler>)responseHandler {
@synchronized(self) {
NSAssert(!_started, @"Call already started.");
if (_started) {
return;
}
_handler = responseHandler;
_initialMetadataPublished = NO;
_started = NO;
_canceled = NO;
_finished = NO;
}
}
- (dispatch_queue_t)requestDispatchQueue {
return _dispatchQueue;
}
@ -92,15 +102,26 @@
return;
}
GRPCCall *copiedCall = nil;
@synchronized(self) {
NSAssert(_handler != nil, @"Response handler required.");
if (_handler == nil) {
NSLog(@"Invalid response handler.");
return;
}
_requestOptions = requestOptions;
if (callOptions == nil) {
_callOptions = [[GRPCCallOptions alloc] init];
} else {
_callOptions = [callOptions copy];
}
}
[self start];
}
- (void)start {
GRPCCall *copiedCall = nil;
@synchronized(self) {
NSAssert(!_started, @"Call already started.");
NSAssert(!_canceled, @"Call already canceled.");
if (_started) {
@ -119,7 +140,7 @@
callOptions:_callOptions
writeDone:^{
@synchronized(self) {
if (self->_transportManager) {
if (self->_handler) {
[self issueDidWriteData];
}
}
@ -137,7 +158,7 @@
void (^valueHandler)(id value) = ^(id value) {
@synchronized(self) {
if (self->_transportManager) {
if (self->_handler) {
if (!self->_initialMetadataPublished) {
self->_initialMetadataPublished = YES;
[self issueInitialMetadata:self->_call.responseHeaders];
@ -150,7 +171,7 @@
};
void (^completionHandler)(NSError *errorOrNil) = ^(NSError *errorOrNil) {
@synchronized(self) {
if (self->_transportManager) {
if (self->_handler) {
if (!self->_initialMetadataPublished) {
self->_initialMetadataPublished = YES;
[self issueInitialMetadata:self->_call.responseHeaders];
@ -186,19 +207,20 @@
_call = nil;
_pipe = nil;
if (_transportManager != nil) {
[_transportManager
forwardPreviousInterceptorCloseWithTrailingMetadata:nil
error:
[NSError
errorWithDomain:kGRPCErrorDomain
code:
GRPCErrorCodeCancelled
userInfo:@{
NSLocalizedDescriptionKey :
@"Canceled by app"
}]];
[_transportManager shutDown];
if ([_handler respondsToSelector:@selector(didCloseWithTrailingMetadata:error:)]) {
id<GRPCResponseHandler> copiedHandler = _handler;
_handler = nil;
dispatch_async(copiedHandler.dispatchQueue, ^{
[copiedHandler didCloseWithTrailingMetadata:nil
error:[NSError errorWithDomain:kGRPCErrorDomain
code:GRPCErrorCodeCancelled
userInfo:@{
NSLocalizedDescriptionKey :
@"Canceled by app"
}]];
});
} else {
_handler = nil;
}
}
[copiedCall cancel];
@ -249,25 +271,59 @@
}
- (void)issueInitialMetadata:(NSDictionary *)initialMetadata {
if (initialMetadata != nil) {
[_transportManager forwardPreviousInterceptorWithInitialMetadata:initialMetadata];
@synchronized(self) {
if (initialMetadata != nil &&
[_handler respondsToSelector:@selector(didReceiveInitialMetadata:)]) {
id<GRPCResponseHandler> copiedHandler = _handler;
dispatch_async(_handler.dispatchQueue, ^{
[copiedHandler didReceiveInitialMetadata:initialMetadata];
});
}
}
}
- (void)issueMessage:(id)message {
if (message != nil) {
[_transportManager forwardPreviousInterceptorWithData:message];
@synchronized(self) {
if (message != nil) {
if ([_handler respondsToSelector:@selector(didReceiveData:)]) {
id<GRPCResponseHandler> copiedHandler = _handler;
dispatch_async(_handler.dispatchQueue, ^{
[copiedHandler didReceiveData:message];
});
} else if ([_handler respondsToSelector:@selector(didReceiveRawMessage:)]) {
id<GRPCResponseHandler> copiedHandler = _handler;
dispatch_async(_handler.dispatchQueue, ^{
[copiedHandler didReceiveRawMessage:message];
});
}
}
}
}
- (void)issueClosedWithTrailingMetadata:(NSDictionary *)trailingMetadata error:(NSError *)error {
[_transportManager forwardPreviousInterceptorCloseWithTrailingMetadata:trailingMetadata
error:error];
[_transportManager shutDown];
@synchronized(self) {
if ([_handler respondsToSelector:@selector(didCloseWithTrailingMetadata:error:)]) {
id<GRPCResponseHandler> copiedHandler = _handler;
// Clean up _handler so that no more responses are reported to the handler.
_handler = nil;
dispatch_async(copiedHandler.dispatchQueue, ^{
[copiedHandler didCloseWithTrailingMetadata:trailingMetadata error:error];
});
} else {
_handler = nil;
}
}
}
- (void)issueDidWriteData {
[_transportManager forwardPreviousInterceptorDidWriteData];
@synchronized(self) {
if (_callOptions.flowControlEnabled && [_handler respondsToSelector:@selector(didWriteData)]) {
id<GRPCResponseHandler> copiedHandler = _handler;
dispatch_async(copiedHandler.dispatchQueue, ^{
[copiedHandler didWriteData];
});
}
}
}
- (void)receiveNextMessages:(NSUInteger)numberOfMessages {

@ -20,19 +20,18 @@
#include <grpc/support/log.h>
#import "../../internal/GRPCCallOptions+Internal.h"
#import "../GRPCTransport+Private.h"
#import "../internal/GRPCCallOptions+Internal.h"
#import "ChannelArgsUtil.h"
#import "GRPCChannelFactory.h"
#import "GRPCChannelPool.h"
#import "GRPCCompletionQueue.h"
#import "GRPCCoreFactory.h"
#import "GRPCCronetChannelFactory.h"
#import "GRPCInsecureChannelFactory.h"
#import "GRPCSecureChannelFactory.h"
#import "version.h"
#import <GRPCClient/GRPCCall+Cronet.h>
#import <GRPCClient/GRPCCallOptions.h>
#import <GRPCClient/version.h>
@implementation GRPCChannelConfiguration
@ -51,48 +50,32 @@
}
- (id<GRPCChannelFactory>)channelFactory {
if (_callOptions.transport != NULL) {
id<GRPCTransportFactory> transportFactory =
[[GRPCTransportRegistry sharedInstance] getTransportFactoryWithId:_callOptions.transport];
if (!
[transportFactory respondsToSelector:@selector(createCoreChannelFactoryWithCallOptions:)]) {
// impossible because we are using GRPCCore now
[NSException raise:NSInternalInconsistencyException
format:@"Transport factory type is wrong"];
}
id<GRPCCoreTransportFactory> coreTransportFactory =
(id<GRPCCoreTransportFactory>)transportFactory;
return [coreTransportFactory createCoreChannelFactoryWithCallOptions:_callOptions];
} else {
// To maintain backwards compatibility with tranportType
GRPCTransportType type = _callOptions.transportType;
switch (type) {
case GRPCTransportTypeChttp2BoringSSL:
// TODO (mxyan): Remove when the API is deprecated
{
NSError *error;
id<GRPCChannelFactory> factory = [GRPCSecureChannelFactory
factoryWithPEMRootCertificates:_callOptions.PEMRootCertificates
privateKey:_callOptions.PEMPrivateKey
certChain:_callOptions.PEMCertificateChain
error:&error];
NSAssert(factory != nil, @"Failed to create secure channel factory");
if (factory == nil) {
NSLog(@"Error creating secure channel factory: %@", error);
}
return factory;
GRPCTransportType type = _callOptions.transportType;
switch (type) {
case GRPCTransportTypeChttp2BoringSSL:
// TODO (mxyan): Remove when the API is deprecated
#ifdef GRPC_COMPILE_WITH_CRONET
if (![GRPCCall isUsingCronet]) {
#else
{
#endif
NSError *error;
id<GRPCChannelFactory> factory = [GRPCSecureChannelFactory
factoryWithPEMRootCertificates:_callOptions.PEMRootCertificates
privateKey:_callOptions.PEMPrivateKey
certChain:_callOptions.PEMCertificateChain
error:&error];
NSAssert(factory != nil, @"Failed to create secure channel factory");
if (factory == nil) {
NSLog(@"Error creating secure channel factory: %@", error);
}
case GRPCTransportTypeCronet: {
id<GRPCCoreTransportFactory> transportFactory = (id<GRPCCoreTransportFactory>)[
[GRPCTransportRegistry sharedInstance] getTransportFactoryWithId:gGRPCCoreCronetId];
return [transportFactory createCoreChannelFactoryWithCallOptions:_callOptions];
return factory;
}
case GRPCTransportTypeInsecure:
return [GRPCInsecureChannelFactory sharedInstance];
default:
NSLog(@"Unrecognized transport type");
return nil;
}
// fallthrough
case GRPCTransportTypeCronet:
return [GRPCCronetChannelFactory sharedInstance];
case GRPCTransportTypeInsecure:
return [GRPCInsecureChannelFactory sharedInstance];
}
}
@ -215,7 +198,6 @@
} else {
channelArgs = channelConfiguration.channelArgs;
}
id<GRPCChannelFactory> factory = channelConfiguration.channelFactory;
_unmanagedChannel = [factory createChannelWithHost:host channelArgs:channelArgs];
NSAssert(_unmanagedChannel != NULL, @"Failed to create channel");

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save