grpc 1.34.0 → 1.35.0.pre1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of grpc might be problematic. Click here for more details.

Files changed (458) hide show
  1. checksums.yaml +4 -4
  2. data/Makefile +808 -2787
  3. data/etc/roots.pem +257 -573
  4. data/include/grpc/compression.h +1 -1
  5. data/include/grpc/grpc.h +14 -0
  6. data/include/grpc/grpc_security.h +61 -3
  7. data/include/grpc/impl/codegen/atm_windows.h +4 -0
  8. data/include/grpc/impl/codegen/byte_buffer.h +1 -1
  9. data/include/grpc/impl/codegen/grpc_types.h +1 -1
  10. data/include/grpc/impl/codegen/log.h +0 -2
  11. data/include/grpc/impl/codegen/sync_windows.h +4 -0
  12. data/include/grpc/slice_buffer.h +3 -3
  13. data/include/grpc/support/sync.h +3 -3
  14. data/include/grpc/support/time.h +7 -7
  15. data/src/core/ext/filters/client_channel/backend_metric.cc +2 -4
  16. data/src/core/ext/filters/client_channel/client_channel.cc +2734 -1498
  17. data/src/core/ext/filters/client_channel/client_channel.h +0 -4
  18. data/src/core/ext/filters/client_channel/client_channel_plugin.cc +1 -1
  19. data/src/core/ext/filters/client_channel/config_selector.h +4 -0
  20. data/src/core/ext/filters/client_channel/dynamic_filters.cc +186 -0
  21. data/src/core/ext/filters/client_channel/dynamic_filters.h +99 -0
  22. data/src/core/ext/filters/client_channel/health/health_check_client.cc +6 -6
  23. data/src/core/ext/filters/client_channel/health/health_check_client.h +2 -2
  24. data/src/core/ext/filters/client_channel/http_connect_handshaker.cc +4 -5
  25. data/src/core/ext/filters/client_channel/http_proxy.cc +21 -20
  26. data/src/core/ext/filters/client_channel/lb_policy.cc +1 -1
  27. data/src/core/ext/filters/client_channel/lb_policy.h +2 -3
  28. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +32 -30
  29. data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc +3 -3
  30. data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h +1 -1
  31. data/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc +162 -20
  32. data/src/core/ext/filters/client_channel/lb_policy/xds/xds.h +0 -8
  33. data/src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_args.h +24 -0
  34. data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_impl.cc +5 -2
  35. data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_manager.cc +1 -1
  36. data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc +1262 -0
  37. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc +7 -14
  38. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h +1 -32
  39. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc +2 -2
  40. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc +454 -16
  41. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h +5 -0
  42. data/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc +6 -9
  43. data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc +2 -2
  44. data/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc +18 -31
  45. data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc +3 -5
  46. data/src/core/ext/filters/client_channel/resolver_factory.h +6 -6
  47. data/src/core/ext/filters/client_channel/resolver_registry.cc +40 -39
  48. data/src/core/ext/filters/client_channel/resolver_registry.h +2 -2
  49. data/src/core/ext/filters/client_channel/resolver_result_parsing.cc +11 -13
  50. data/src/core/ext/filters/client_channel/resolver_result_parsing.h +8 -8
  51. data/src/core/ext/filters/client_channel/retry_throttle.cc +5 -3
  52. data/src/core/ext/filters/client_channel/retry_throttle.h +3 -1
  53. data/src/core/ext/filters/client_channel/service_config_call_data.h +19 -1
  54. data/src/core/ext/filters/client_channel/subchannel.cc +34 -50
  55. data/src/core/ext/filters/client_channel/subchannel.h +12 -18
  56. data/src/core/ext/filters/deadline/deadline_filter.cc +4 -2
  57. data/src/core/ext/filters/http/client_authority_filter.cc +6 -6
  58. data/src/core/ext/filters/http/http_filters_plugin.cc +6 -3
  59. data/src/core/ext/filters/message_size/message_size_filter.cc +1 -1
  60. data/src/core/ext/filters/workarounds/workaround_utils.cc +1 -1
  61. data/src/core/ext/transport/chttp2/client/authority.cc +3 -3
  62. data/src/core/ext/transport/chttp2/client/insecure/channel_create.cc +20 -8
  63. data/src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc +21 -10
  64. data/src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc +26 -14
  65. data/src/core/ext/transport/chttp2/server/chttp2_server.cc +178 -86
  66. data/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc +12 -5
  67. data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +7 -8
  68. data/src/core/ext/transport/chttp2/transport/flow_control.h +1 -1
  69. data/src/core/ext/transport/chttp2/transport/frame_settings.h +2 -1
  70. data/src/core/ext/transport/chttp2/transport/frame_window_update.cc +6 -6
  71. data/src/core/ext/transport/chttp2/transport/writing.cc +1 -1
  72. data/src/core/ext/transport/inproc/inproc_transport.cc +42 -8
  73. data/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.h +1 -0
  74. data/src/core/ext/upb-generated/envoy/annotations/resource.upb.c +1 -1
  75. data/src/core/ext/upb-generated/envoy/annotations/resource.upb.h +7 -0
  76. data/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.c +27 -27
  77. data/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.h +139 -40
  78. data/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.c +13 -13
  79. data/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.h +44 -17
  80. data/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.c +111 -111
  81. data/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.h +424 -241
  82. data/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.c +3 -3
  83. data/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.h +13 -5
  84. data/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.c +22 -22
  85. data/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.h +47 -21
  86. data/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.c +21 -21
  87. data/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.h +88 -39
  88. data/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.c +4 -4
  89. data/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.h +15 -6
  90. data/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.c +44 -44
  91. data/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.h +200 -78
  92. data/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.c +17 -17
  93. data/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.h +72 -35
  94. data/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.c +1 -1
  95. data/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.h +7 -0
  96. data/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.c +7 -7
  97. data/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.h +27 -11
  98. data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.c +30 -30
  99. data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.h +136 -49
  100. data/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.c +39 -39
  101. data/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.h +157 -89
  102. data/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.c +4 -4
  103. data/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.h +17 -9
  104. data/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.c +47 -47
  105. data/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.h +163 -78
  106. data/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.c +1 -1
  107. data/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.h +7 -0
  108. data/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.c +2 -2
  109. data/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.h +9 -2
  110. data/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.c +1 -1
  111. data/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.h +7 -0
  112. data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.c +13 -13
  113. data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.h +59 -36
  114. data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.c +16 -16
  115. data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.h +61 -29
  116. data/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.c +26 -26
  117. data/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.h +101 -66
  118. data/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.c +2 -2
  119. data/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.h +11 -3
  120. data/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.c +28 -28
  121. data/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.h +122 -77
  122. data/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.c +23 -23
  123. data/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.h +106 -54
  124. data/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.c +2 -2
  125. data/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.h +13 -0
  126. data/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.c +16 -16
  127. data/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.h +81 -35
  128. data/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.c +7 -7
  129. data/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.h +38 -22
  130. data/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.c +203 -203
  131. data/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.h +845 -495
  132. data/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.c +5 -5
  133. data/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.h +26 -6
  134. data/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c +3 -3
  135. data/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h +17 -3
  136. data/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c +87 -87
  137. data/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h +343 -204
  138. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.h +1 -0
  139. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.c +20 -20
  140. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.h +85 -46
  141. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.c +7 -7
  142. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.h +33 -11
  143. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.c +32 -32
  144. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.h +118 -67
  145. data/src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.c +1 -1
  146. data/src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.h +7 -0
  147. data/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.c +1 -1
  148. data/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.h +7 -0
  149. data/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.c +29 -29
  150. data/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.h +120 -82
  151. data/src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.c +1 -1
  152. data/src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.h +7 -0
  153. data/src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.c +1 -1
  154. data/src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.h +7 -0
  155. data/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.c +7 -7
  156. data/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.h +31 -16
  157. data/src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.c +1 -1
  158. data/src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.h +7 -0
  159. data/src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.c +1 -1
  160. data/src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.h +7 -0
  161. data/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.c +5 -5
  162. data/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.h +25 -11
  163. data/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.c +1 -1
  164. data/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.h +7 -0
  165. data/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.c +1 -1
  166. data/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.h +7 -0
  167. data/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.c +6 -6
  168. data/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.h +29 -8
  169. data/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.c +2 -2
  170. data/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.h +16 -3
  171. data/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.c +3 -3
  172. data/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.h +19 -0
  173. data/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.c +7 -7
  174. data/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.h +46 -3
  175. data/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.c +8 -8
  176. data/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.h +41 -8
  177. data/src/core/ext/upb-generated/envoy/type/v3/http.upb.h +1 -0
  178. data/src/core/ext/upb-generated/envoy/type/v3/percent.upb.c +3 -3
  179. data/src/core/ext/upb-generated/envoy/type/v3/percent.upb.h +15 -2
  180. data/src/core/ext/upb-generated/envoy/type/v3/range.upb.c +3 -3
  181. data/src/core/ext/upb-generated/envoy/type/v3/range.upb.h +19 -0
  182. data/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.c +1 -1
  183. data/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.h +7 -0
  184. data/src/core/ext/upb-generated/google/api/annotations.upb.h +1 -0
  185. data/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.c +34 -34
  186. data/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.h +149 -72
  187. data/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.c +34 -34
  188. data/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.h +142 -59
  189. data/src/core/ext/upb-generated/google/api/http.upb.c +3 -3
  190. data/src/core/ext/upb-generated/google/api/http.upb.h +25 -6
  191. data/src/core/ext/upb-generated/google/protobuf/any.upb.c +1 -1
  192. data/src/core/ext/upb-generated/google/protobuf/any.upb.h +7 -0
  193. data/src/core/ext/upb-generated/google/protobuf/descriptor.upb.c +90 -90
  194. data/src/core/ext/upb-generated/google/protobuf/descriptor.upb.h +455 -292
  195. data/src/core/ext/upb-generated/google/protobuf/duration.upb.c +1 -1
  196. data/src/core/ext/upb-generated/google/protobuf/duration.upb.h +7 -0
  197. data/src/core/ext/upb-generated/google/protobuf/empty.upb.c +1 -1
  198. data/src/core/ext/upb-generated/google/protobuf/empty.upb.h +7 -0
  199. data/src/core/ext/upb-generated/google/protobuf/struct.upb.c +4 -4
  200. data/src/core/ext/upb-generated/google/protobuf/struct.upb.h +22 -3
  201. data/src/core/ext/upb-generated/google/protobuf/timestamp.upb.c +1 -1
  202. data/src/core/ext/upb-generated/google/protobuf/timestamp.upb.h +7 -0
  203. data/src/core/ext/upb-generated/google/protobuf/wrappers.upb.c +9 -9
  204. data/src/core/ext/upb-generated/google/protobuf/wrappers.upb.h +55 -0
  205. data/src/core/ext/upb-generated/google/rpc/status.upb.c +1 -1
  206. data/src/core/ext/upb-generated/google/rpc/status.upb.h +10 -3
  207. data/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c +4 -4
  208. data/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h +11 -3
  209. data/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c +41 -41
  210. data/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h +149 -76
  211. data/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c +5 -5
  212. data/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h +21 -6
  213. data/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c +2 -2
  214. data/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h +13 -0
  215. data/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c +17 -17
  216. data/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h +82 -25
  217. data/src/core/ext/upb-generated/udpa/annotations/migrate.upb.c +3 -3
  218. data/src/core/ext/upb-generated/udpa/annotations/migrate.upb.h +19 -0
  219. data/src/core/ext/upb-generated/udpa/annotations/security.upb.c +1 -1
  220. data/src/core/ext/upb-generated/udpa/annotations/security.upb.h +7 -0
  221. data/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.h +1 -0
  222. data/src/core/ext/upb-generated/udpa/annotations/status.upb.c +2 -2
  223. data/src/core/ext/upb-generated/udpa/annotations/status.upb.h +9 -2
  224. data/src/core/ext/upb-generated/udpa/annotations/versioning.upb.c +1 -1
  225. data/src/core/ext/upb-generated/udpa/annotations/versioning.upb.h +7 -0
  226. data/src/core/ext/upb-generated/udpa/core/v1/authority.upb.c +1 -1
  227. data/src/core/ext/upb-generated/udpa/core/v1/authority.upb.h +7 -0
  228. data/src/core/ext/upb-generated/udpa/core/v1/collection_entry.upb.c +5 -5
  229. data/src/core/ext/upb-generated/udpa/core/v1/collection_entry.upb.h +21 -7
  230. data/src/core/ext/upb-generated/udpa/core/v1/context_params.upb.c +2 -2
  231. data/src/core/ext/upb-generated/udpa/core/v1/context_params.upb.h +7 -0
  232. data/src/core/ext/upb-generated/udpa/core/v1/resource.upb.c +4 -4
  233. data/src/core/ext/upb-generated/udpa/core/v1/resource.upb.h +17 -8
  234. data/src/core/ext/upb-generated/udpa/core/v1/resource_locator.upb.c +7 -7
  235. data/src/core/ext/upb-generated/udpa/core/v1/resource_locator.upb.h +31 -18
  236. data/src/core/ext/upb-generated/udpa/core/v1/resource_name.upb.c +5 -5
  237. data/src/core/ext/upb-generated/udpa/core/v1/resource_name.upb.h +19 -11
  238. data/src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c +3 -3
  239. data/src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.h +7 -0
  240. data/src/core/ext/upb-generated/validate/validate.upb.c +64 -64
  241. data/src/core/ext/upb-generated/validate/validate.upb.h +296 -157
  242. data/src/core/ext/xds/certificate_provider_store.cc +10 -7
  243. data/src/core/ext/xds/certificate_provider_store.h +12 -7
  244. data/src/core/ext/xds/file_watcher_certificate_provider_factory.cc +25 -0
  245. data/src/core/ext/xds/file_watcher_certificate_provider_factory.h +1 -4
  246. data/src/core/ext/xds/xds_api.cc +220 -31
  247. data/src/core/ext/xds/xds_api.h +41 -10
  248. data/src/core/ext/xds/xds_bootstrap.h +0 -1
  249. data/src/core/ext/xds/xds_certificate_provider.cc +61 -2
  250. data/src/core/ext/xds/xds_certificate_provider.h +40 -2
  251. data/src/core/ext/xds/xds_client.cc +31 -29
  252. data/src/core/ext/xds/xds_client.h +6 -1
  253. data/src/core/ext/xds/xds_client_stats.cc +2 -2
  254. data/src/core/ext/xds/xds_server_config_fetcher.cc +131 -0
  255. data/src/core/lib/channel/channel_args.cc +8 -8
  256. data/src/core/lib/channel/channel_trace.h +1 -1
  257. data/src/core/lib/channel/channelz.cc +13 -14
  258. data/src/core/lib/channel/channelz.h +0 -1
  259. data/src/core/lib/channel/channelz_registry.h +0 -1
  260. data/src/core/lib/channel/handshaker.cc +2 -2
  261. data/src/core/lib/compression/compression_args.cc +3 -2
  262. data/src/core/lib/debug/stats.h +2 -2
  263. data/src/core/lib/debug/stats_data.h +13 -13
  264. data/src/core/lib/gpr/alloc.cc +3 -2
  265. data/src/core/lib/gpr/log.cc +53 -16
  266. data/src/core/lib/gpr/log_linux.cc +3 -1
  267. data/src/core/lib/gpr/log_posix.cc +3 -1
  268. data/src/core/lib/gpr/log_windows.cc +3 -1
  269. data/src/core/lib/gpr/spinlock.h +10 -2
  270. data/src/core/lib/gpr/string.cc +22 -21
  271. data/src/core/lib/gpr/string.h +5 -6
  272. data/src/core/lib/gpr/sync.cc +4 -4
  273. data/src/core/lib/gpr/time.cc +12 -12
  274. data/src/core/lib/gprpp/arena.h +3 -2
  275. data/src/core/lib/gprpp/ref_counted.h +2 -2
  276. data/src/core/lib/gprpp/ref_counted_ptr.h +9 -1
  277. data/src/core/lib/gprpp/thd_posix.cc +6 -1
  278. data/src/core/lib/gprpp/thd_windows.cc +3 -1
  279. data/src/core/lib/http/httpcli.cc +1 -1
  280. data/src/core/lib/http/httpcli.h +2 -3
  281. data/src/core/lib/http/httpcli_security_connector.cc +1 -1
  282. data/src/core/lib/http/parser.cc +1 -2
  283. data/src/core/lib/iomgr/call_combiner.cc +8 -5
  284. data/src/core/lib/iomgr/combiner.cc +2 -1
  285. data/src/core/lib/iomgr/endpoint.h +1 -1
  286. data/src/core/lib/iomgr/error.cc +15 -11
  287. data/src/core/lib/iomgr/error_internal.h +1 -1
  288. data/src/core/lib/iomgr/ev_epoll1_linux.cc +20 -13
  289. data/src/core/lib/iomgr/ev_epollex_linux.cc +17 -13
  290. data/src/core/lib/iomgr/ev_poll_posix.cc +9 -7
  291. data/src/core/lib/iomgr/exec_ctx.h +6 -4
  292. data/src/core/lib/iomgr/executor.cc +2 -1
  293. data/src/core/lib/iomgr/executor.h +1 -1
  294. data/src/core/lib/iomgr/executor/threadpool.h +1 -1
  295. data/src/core/lib/iomgr/iomgr.cc +1 -1
  296. data/src/core/lib/iomgr/load_file.h +1 -1
  297. data/src/core/lib/iomgr/lockfree_event.cc +19 -14
  298. data/src/core/lib/iomgr/lockfree_event.h +2 -2
  299. data/src/core/lib/iomgr/parse_address.cc +52 -46
  300. data/src/core/lib/iomgr/parse_address.h +13 -9
  301. data/src/core/lib/iomgr/poller/eventmanager_libuv.h +1 -1
  302. data/src/core/lib/iomgr/pollset_set_custom.cc +1 -1
  303. data/src/core/lib/iomgr/python_util.h +1 -1
  304. data/src/core/lib/iomgr/resolve_address.cc +4 -4
  305. data/src/core/lib/iomgr/resource_quota.cc +4 -4
  306. data/src/core/lib/iomgr/sockaddr_utils.cc +10 -10
  307. data/src/core/lib/iomgr/sockaddr_utils.h +1 -1
  308. data/src/core/lib/iomgr/socket_factory_posix.cc +3 -2
  309. data/src/core/lib/iomgr/socket_mutator.cc +3 -2
  310. data/src/core/lib/iomgr/tcp_client.cc +3 -3
  311. data/src/core/lib/iomgr/tcp_client_custom.cc +7 -6
  312. data/src/core/lib/iomgr/tcp_custom.cc +22 -17
  313. data/src/core/lib/iomgr/tcp_posix.cc +9 -6
  314. data/src/core/lib/iomgr/tcp_server_custom.cc +28 -22
  315. data/src/core/lib/iomgr/timer_custom.cc +3 -3
  316. data/src/core/lib/iomgr/timer_generic.cc +3 -3
  317. data/src/core/lib/iomgr/timer_manager.cc +2 -2
  318. data/src/core/lib/iomgr/udp_server.cc +1 -2
  319. data/src/core/lib/iomgr/udp_server.h +1 -2
  320. data/src/core/lib/iomgr/unix_sockets_posix.cc +17 -18
  321. data/src/core/lib/json/json.h +10 -0
  322. data/src/core/lib/security/authorization/evaluate_args.cc +5 -10
  323. data/src/core/lib/security/authorization/evaluate_args.h +1 -1
  324. data/src/core/lib/security/context/security_context.cc +4 -3
  325. data/src/core/lib/security/credentials/alts/check_gcp_environment.cc +1 -1
  326. data/src/core/lib/security/credentials/credentials.cc +6 -6
  327. data/src/core/lib/security/credentials/external/aws_external_account_credentials.cc +413 -0
  328. data/src/core/lib/security/credentials/external/aws_external_account_credentials.h +80 -0
  329. data/src/core/lib/security/credentials/external/aws_request_signer.cc +15 -10
  330. data/src/core/lib/security/credentials/external/aws_request_signer.h +1 -2
  331. data/src/core/lib/security/credentials/external/external_account_credentials.cc +217 -31
  332. data/src/core/lib/security/credentials/external/external_account_credentials.h +7 -5
  333. data/src/core/lib/security/credentials/external/file_external_account_credentials.cc +5 -6
  334. data/src/core/lib/security/credentials/external/file_external_account_credentials.h +3 -4
  335. data/src/core/lib/security/credentials/external/url_external_account_credentials.cc +20 -18
  336. data/src/core/lib/security/credentials/external/url_external_account_credentials.h +5 -6
  337. data/src/core/lib/security/credentials/fake/fake_credentials.cc +2 -1
  338. data/src/core/lib/security/credentials/google_default/google_default_credentials.cc +18 -12
  339. data/src/core/lib/security/credentials/insecure/insecure_credentials.cc +18 -5
  340. data/src/core/lib/security/credentials/jwt/json_token.cc +1 -1
  341. data/src/core/lib/security/credentials/jwt/jwt_verifier.cc +3 -3
  342. data/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc +37 -44
  343. data/src/core/lib/security/credentials/oauth2/oauth2_credentials.h +5 -4
  344. data/src/core/lib/security/credentials/plugin/plugin_credentials.cc +1 -1
  345. data/src/core/lib/security/credentials/ssl/ssl_credentials.cc +5 -5
  346. data/src/core/lib/security/credentials/ssl/ssl_credentials.h +1 -1
  347. data/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.cc +1 -6
  348. data/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.h +1 -6
  349. data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc +326 -5
  350. data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h +64 -0
  351. data/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc +1 -1
  352. data/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h +0 -1
  353. data/src/core/lib/security/credentials/tls/tls_credentials.cc +1 -1
  354. data/src/core/lib/security/credentials/tls/tls_utils.cc +91 -0
  355. data/src/core/lib/security/credentials/tls/tls_utils.h +38 -0
  356. data/src/core/lib/security/credentials/xds/xds_credentials.cc +140 -10
  357. data/src/core/lib/security/credentials/xds/xds_credentials.h +27 -9
  358. data/src/core/lib/security/security_connector/alts/alts_security_connector.cc +1 -1
  359. data/src/core/lib/security/security_connector/fake/fake_security_connector.cc +1 -1
  360. data/src/core/lib/security/security_connector/insecure/insecure_security_connector.cc +46 -13
  361. data/src/core/lib/security/security_connector/insecure/insecure_security_connector.h +23 -6
  362. data/src/core/lib/security/security_connector/local/local_security_connector.cc +1 -1
  363. data/src/core/lib/security/security_connector/security_connector.cc +3 -2
  364. data/src/core/lib/security/security_connector/ssl/ssl_security_connector.cc +4 -4
  365. data/src/core/lib/security/security_connector/ssl_utils.cc +2 -2
  366. data/src/core/lib/security/security_connector/ssl_utils.h +12 -19
  367. data/src/core/lib/security/security_connector/tls/tls_security_connector.cc +57 -12
  368. data/src/core/lib/security/security_connector/tls/tls_security_connector.h +2 -3
  369. data/src/core/lib/security/transport/secure_endpoint.cc +2 -2
  370. data/src/core/lib/security/transport/security_handshaker.cc +2 -2
  371. data/src/core/lib/slice/slice_intern.cc +4 -5
  372. data/src/core/lib/slice/slice_internal.h +2 -2
  373. data/src/core/lib/surface/call.cc +32 -24
  374. data/src/core/lib/surface/call_details.cc +8 -8
  375. data/src/core/lib/surface/channel.cc +16 -10
  376. data/src/core/lib/surface/channel.h +3 -2
  377. data/src/core/lib/surface/channel_init.cc +1 -1
  378. data/src/core/lib/surface/completion_queue.cc +23 -18
  379. data/src/core/lib/surface/completion_queue.h +16 -16
  380. data/src/core/lib/surface/init.cc +6 -5
  381. data/src/core/lib/surface/lame_client.cc +20 -46
  382. data/src/core/lib/surface/lame_client.h +4 -0
  383. data/src/core/lib/surface/server.cc +59 -15
  384. data/src/core/lib/surface/server.h +37 -5
  385. data/src/core/lib/surface/version.cc +1 -1
  386. data/src/core/lib/transport/authority_override.cc +6 -4
  387. data/src/core/lib/transport/authority_override.h +5 -2
  388. data/src/core/lib/transport/connectivity_state.h +6 -4
  389. data/src/core/lib/transport/error_utils.h +1 -1
  390. data/src/core/lib/transport/metadata_batch.h +4 -4
  391. data/src/core/lib/transport/static_metadata.cc +1 -1
  392. data/src/core/lib/transport/status_metadata.cc +4 -3
  393. data/src/core/lib/transport/transport.h +7 -7
  394. data/src/core/lib/uri/uri_parser.cc +131 -249
  395. data/src/core/lib/uri/uri_parser.h +57 -21
  396. data/src/core/plugin_registry/grpc_plugin_registry.cc +10 -4
  397. data/src/core/tsi/alts/crypt/gsec.cc +5 -4
  398. data/src/core/tsi/alts/frame_protector/frame_handler.cc +8 -6
  399. data/src/core/tsi/alts/handshaker/alts_handshaker_client.cc +1 -1
  400. data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc +23 -23
  401. data/src/core/tsi/alts/zero_copy_frame_protector/alts_iovec_record_protocol.cc +8 -6
  402. data/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc +4 -4
  403. data/src/core/tsi/fake_transport_security.cc +5 -3
  404. data/src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc +1 -1
  405. data/src/core/tsi/ssl_transport_security.cc +62 -49
  406. data/src/core/tsi/ssl_transport_security.h +6 -6
  407. data/src/core/tsi/transport_security.cc +6 -6
  408. data/src/core/tsi/transport_security_interface.h +1 -1
  409. data/src/ruby/ext/grpc/rb_event_thread.c +2 -0
  410. data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +12 -0
  411. data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +31 -13
  412. data/src/ruby/lib/grpc/version.rb +1 -1
  413. data/src/ruby/pb/src/proto/grpc/testing/messages_pb.rb +28 -0
  414. data/src/ruby/pb/src/proto/grpc/testing/test_services_pb.rb +18 -0
  415. data/src/ruby/spec/pb/codegen/package_option_spec.rb +2 -6
  416. data/third_party/abseil-cpp/absl/container/flat_hash_map.h +606 -0
  417. data/third_party/abseil-cpp/absl/container/internal/raw_hash_map.h +197 -0
  418. data/third_party/abseil-cpp/absl/status/internal/statusor_internal.h +399 -0
  419. data/third_party/abseil-cpp/absl/status/statusor.cc +71 -0
  420. data/third_party/abseil-cpp/absl/status/statusor.h +760 -0
  421. data/third_party/upb/third_party/wyhash/wyhash.h +145 -0
  422. data/third_party/upb/upb/decode.c +248 -167
  423. data/third_party/upb/upb/decode.h +20 -1
  424. data/third_party/upb/upb/decode.int.h +163 -0
  425. data/third_party/upb/upb/decode_fast.c +1040 -0
  426. data/third_party/upb/upb/decode_fast.h +126 -0
  427. data/third_party/upb/upb/def.c +525 -516
  428. data/third_party/upb/upb/def.h +16 -31
  429. data/third_party/upb/upb/def.hpp +37 -123
  430. data/third_party/upb/upb/encode.c +227 -169
  431. data/third_party/upb/upb/encode.h +27 -2
  432. data/third_party/upb/upb/json_decode.c +1443 -0
  433. data/third_party/upb/upb/json_decode.h +23 -0
  434. data/third_party/upb/upb/json_encode.c +713 -0
  435. data/third_party/upb/upb/json_encode.h +36 -0
  436. data/third_party/upb/upb/msg.c +167 -88
  437. data/third_party/upb/upb/msg.h +174 -34
  438. data/third_party/upb/upb/port_def.inc +74 -61
  439. data/third_party/upb/upb/port_undef.inc +3 -7
  440. data/third_party/upb/upb/reflection.c +36 -19
  441. data/third_party/upb/upb/table.c +34 -197
  442. data/third_party/upb/upb/table.int.h +14 -5
  443. data/third_party/upb/upb/text_encode.c +45 -22
  444. data/third_party/upb/upb/text_encode.h +4 -1
  445. data/third_party/upb/upb/upb.c +18 -41
  446. data/third_party/upb/upb/upb.h +36 -7
  447. data/third_party/upb/upb/upb.hpp +4 -4
  448. data/third_party/upb/upb/upb.int.h +29 -0
  449. metadata +60 -46
  450. data/src/core/ext/filters/client_channel/lb_policy/xds/eds.cc +0 -909
  451. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.cc +0 -485
  452. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_fallback.cc +0 -68
  453. data/src/core/ext/filters/client_channel/resolving_lb_policy.cc +0 -355
  454. data/src/core/ext/filters/client_channel/resolving_lb_policy.h +0 -138
  455. data/src/core/ext/xds/google_mesh_ca_certificate_provider_factory.cc +0 -265
  456. data/src/core/ext/xds/google_mesh_ca_certificate_provider_factory.h +0 -104
  457. data/src/core/lib/gprpp/map.h +0 -53
  458. data/third_party/upb/upb/port.c +0 -26
@@ -184,7 +184,7 @@ tsi_result tsi_create_ssl_client_handshaker_factory_with_options(
184
184
  tsi_ssl_client_handshaker_factory** factory);
185
185
 
186
186
  /* Creates a client handshaker.
187
- - self is the factory from which the handshaker will be created.
187
+ - factory is the factory from which the handshaker will be created.
188
188
  - server_name_indication indicates the name of the server the client is
189
189
  trying to connect to which will be relayed to the server using the SNI
190
190
  extension.
@@ -193,8 +193,8 @@ tsi_result tsi_create_ssl_client_handshaker_factory_with_options(
193
193
  - This method returns TSI_OK on success or TSI_INVALID_PARAMETER in the case
194
194
  where a parameter is invalid. */
195
195
  tsi_result tsi_ssl_client_handshaker_factory_create_handshaker(
196
- tsi_ssl_client_handshaker_factory* self, const char* server_name_indication,
197
- tsi_handshaker** handshaker);
196
+ tsi_ssl_client_handshaker_factory* factory,
197
+ const char* server_name_indication, tsi_handshaker** handshaker);
198
198
 
199
199
  /* Decrements reference count of the handshaker factory. Handshaker factory will
200
200
  * be destroyed once no references exist. */
@@ -315,18 +315,18 @@ tsi_result tsi_create_ssl_server_handshaker_factory_with_options(
315
315
  tsi_ssl_server_handshaker_factory** factory);
316
316
 
317
317
  /* Creates a server handshaker.
318
- - self is the factory from which the handshaker will be created.
318
+ - factory is the factory from which the handshaker will be created.
319
319
  - handshaker is the address of the handshaker pointer to be created.
320
320
 
321
321
  - This method returns TSI_OK on success or TSI_INVALID_PARAMETER in the case
322
322
  where a parameter is invalid. */
323
323
  tsi_result tsi_ssl_server_handshaker_factory_create_handshaker(
324
- tsi_ssl_server_handshaker_factory* self, tsi_handshaker** handshaker);
324
+ tsi_ssl_server_handshaker_factory* factory, tsi_handshaker** handshaker);
325
325
 
326
326
  /* Decrements reference count of the handshaker factory. Handshaker factory will
327
327
  * be destroyed once no references exist. */
328
328
  void tsi_ssl_server_handshaker_factory_unref(
329
- tsi_ssl_server_handshaker_factory* self);
329
+ tsi_ssl_server_handshaker_factory* factory);
330
330
 
331
331
  /* Util that checks that an ssl peer matches a specific name.
332
332
  Still TODO(jboeuf):
@@ -194,7 +194,7 @@ tsi_result tsi_handshaker_extract_peer(tsi_handshaker* self, tsi_peer* peer) {
194
194
  }
195
195
 
196
196
  tsi_result tsi_handshaker_create_frame_protector(
197
- tsi_handshaker* self, size_t* max_protected_frame_size,
197
+ tsi_handshaker* self, size_t* max_output_protected_frame_size,
198
198
  tsi_frame_protector** protector) {
199
199
  tsi_result result;
200
200
  if (self == nullptr || self->vtable == nullptr || protector == nullptr) {
@@ -204,8 +204,8 @@ tsi_result tsi_handshaker_create_frame_protector(
204
204
  if (self->handshake_shutdown) return TSI_HANDSHAKE_SHUTDOWN;
205
205
  if (tsi_handshaker_get_result(self) != TSI_OK) return TSI_FAILED_PRECONDITION;
206
206
  if (self->vtable->create_frame_protector == nullptr) return TSI_UNIMPLEMENTED;
207
- result = self->vtable->create_frame_protector(self, max_protected_frame_size,
208
- protector);
207
+ result = self->vtable->create_frame_protector(
208
+ self, max_output_protected_frame_size, protector);
209
209
  if (result == TSI_OK) {
210
210
  self->frame_protector_created = true;
211
211
  }
@@ -252,14 +252,14 @@ tsi_result tsi_handshaker_result_extract_peer(const tsi_handshaker_result* self,
252
252
  }
253
253
 
254
254
  tsi_result tsi_handshaker_result_create_frame_protector(
255
- const tsi_handshaker_result* self, size_t* max_protected_frame_size,
255
+ const tsi_handshaker_result* self, size_t* max_output_protected_frame_size,
256
256
  tsi_frame_protector** protector) {
257
257
  if (self == nullptr || self->vtable == nullptr || protector == nullptr) {
258
258
  return TSI_INVALID_ARGUMENT;
259
259
  }
260
260
  if (self->vtable->create_frame_protector == nullptr) return TSI_UNIMPLEMENTED;
261
- return self->vtable->create_frame_protector(self, max_protected_frame_size,
262
- protector);
261
+ return self->vtable->create_frame_protector(
262
+ self, max_output_protected_frame_size, protector);
263
263
  }
264
264
 
265
265
  tsi_result tsi_handshaker_result_get_unused_bytes(
@@ -247,7 +247,7 @@ tsi_result tsi_handshaker_result_create_frame_protector(
247
247
  consequence, the caller must not free the bytes. */
248
248
  tsi_result tsi_handshaker_result_get_unused_bytes(
249
249
  const tsi_handshaker_result* self, const unsigned char** bytes,
250
- size_t* byte_size);
250
+ size_t* bytes_size);
251
251
 
252
252
  /* This method releases the tsi_handshaker_handshaker object. After this method
253
253
  is called, no other method can be called on the object. */
@@ -29,6 +29,8 @@
29
29
  #include <grpc/support/time.h>
30
30
  #include <ruby/thread.h>
31
31
 
32
+ #include "rb_grpc.h"
33
+
32
34
  typedef struct grpc_rb_event {
33
35
  // callback will be called with argument while holding the GVL
34
36
  void (*callback)(void*);
@@ -80,6 +80,9 @@ grpc_server_register_method_type grpc_server_register_method_import;
80
80
  grpc_server_request_registered_call_type grpc_server_request_registered_call_import;
81
81
  grpc_server_create_type grpc_server_create_import;
82
82
  grpc_server_register_completion_queue_type grpc_server_register_completion_queue_import;
83
+ grpc_server_config_fetcher_xds_create_type grpc_server_config_fetcher_xds_create_import;
84
+ grpc_server_config_fetcher_destroy_type grpc_server_config_fetcher_destroy_import;
85
+ grpc_server_set_config_fetcher_type grpc_server_set_config_fetcher_import;
83
86
  grpc_server_add_insecure_http2_port_type grpc_server_add_insecure_http2_port_import;
84
87
  grpc_server_start_type grpc_server_start_import;
85
88
  grpc_server_shutdown_and_notify_type grpc_server_shutdown_and_notify_import;
@@ -130,6 +133,7 @@ grpc_composite_call_credentials_create_type grpc_composite_call_credentials_crea
130
133
  grpc_google_compute_engine_credentials_create_type grpc_google_compute_engine_credentials_create_import;
131
134
  grpc_max_auth_token_lifetime_type grpc_max_auth_token_lifetime_import;
132
135
  grpc_service_account_jwt_access_credentials_create_type grpc_service_account_jwt_access_credentials_create_import;
136
+ grpc_external_account_credentials_create_type grpc_external_account_credentials_create_import;
133
137
  grpc_google_refresh_token_credentials_create_type grpc_google_refresh_token_credentials_create_import;
134
138
  grpc_access_token_credentials_create_type grpc_access_token_credentials_create_import;
135
139
  grpc_google_iam_credentials_create_type grpc_google_iam_credentials_create_import;
@@ -162,6 +166,7 @@ grpc_tls_identity_pairs_create_type grpc_tls_identity_pairs_create_import;
162
166
  grpc_tls_identity_pairs_add_pair_type grpc_tls_identity_pairs_add_pair_import;
163
167
  grpc_tls_identity_pairs_destroy_type grpc_tls_identity_pairs_destroy_import;
164
168
  grpc_tls_certificate_provider_static_data_create_type grpc_tls_certificate_provider_static_data_create_import;
169
+ grpc_tls_certificate_provider_file_watcher_create_type grpc_tls_certificate_provider_file_watcher_create_import;
165
170
  grpc_tls_certificate_provider_release_type grpc_tls_certificate_provider_release_import;
166
171
  grpc_tls_credentials_options_create_type grpc_tls_credentials_options_create_import;
167
172
  grpc_tls_credentials_options_set_cert_request_type_type grpc_tls_credentials_options_set_cert_request_type_import;
@@ -175,6 +180,7 @@ grpc_tls_credentials_options_set_server_authorization_check_config_type grpc_tls
175
180
  grpc_tls_server_authorization_check_config_create_type grpc_tls_server_authorization_check_config_create_import;
176
181
  grpc_tls_server_authorization_check_config_release_type grpc_tls_server_authorization_check_config_release_import;
177
182
  grpc_xds_credentials_create_type grpc_xds_credentials_create_import;
183
+ grpc_xds_server_credentials_create_type grpc_xds_server_credentials_create_import;
178
184
  grpc_raw_byte_buffer_create_type grpc_raw_byte_buffer_create_import;
179
185
  grpc_raw_compressed_byte_buffer_create_type grpc_raw_compressed_byte_buffer_create_import;
180
186
  grpc_byte_buffer_copy_type grpc_byte_buffer_copy_import;
@@ -358,6 +364,9 @@ void grpc_rb_load_imports(HMODULE library) {
358
364
  grpc_server_request_registered_call_import = (grpc_server_request_registered_call_type) GetProcAddress(library, "grpc_server_request_registered_call");
359
365
  grpc_server_create_import = (grpc_server_create_type) GetProcAddress(library, "grpc_server_create");
360
366
  grpc_server_register_completion_queue_import = (grpc_server_register_completion_queue_type) GetProcAddress(library, "grpc_server_register_completion_queue");
367
+ grpc_server_config_fetcher_xds_create_import = (grpc_server_config_fetcher_xds_create_type) GetProcAddress(library, "grpc_server_config_fetcher_xds_create");
368
+ grpc_server_config_fetcher_destroy_import = (grpc_server_config_fetcher_destroy_type) GetProcAddress(library, "grpc_server_config_fetcher_destroy");
369
+ grpc_server_set_config_fetcher_import = (grpc_server_set_config_fetcher_type) GetProcAddress(library, "grpc_server_set_config_fetcher");
361
370
  grpc_server_add_insecure_http2_port_import = (grpc_server_add_insecure_http2_port_type) GetProcAddress(library, "grpc_server_add_insecure_http2_port");
362
371
  grpc_server_start_import = (grpc_server_start_type) GetProcAddress(library, "grpc_server_start");
363
372
  grpc_server_shutdown_and_notify_import = (grpc_server_shutdown_and_notify_type) GetProcAddress(library, "grpc_server_shutdown_and_notify");
@@ -408,6 +417,7 @@ void grpc_rb_load_imports(HMODULE library) {
408
417
  grpc_google_compute_engine_credentials_create_import = (grpc_google_compute_engine_credentials_create_type) GetProcAddress(library, "grpc_google_compute_engine_credentials_create");
409
418
  grpc_max_auth_token_lifetime_import = (grpc_max_auth_token_lifetime_type) GetProcAddress(library, "grpc_max_auth_token_lifetime");
410
419
  grpc_service_account_jwt_access_credentials_create_import = (grpc_service_account_jwt_access_credentials_create_type) GetProcAddress(library, "grpc_service_account_jwt_access_credentials_create");
420
+ grpc_external_account_credentials_create_import = (grpc_external_account_credentials_create_type) GetProcAddress(library, "grpc_external_account_credentials_create");
411
421
  grpc_google_refresh_token_credentials_create_import = (grpc_google_refresh_token_credentials_create_type) GetProcAddress(library, "grpc_google_refresh_token_credentials_create");
412
422
  grpc_access_token_credentials_create_import = (grpc_access_token_credentials_create_type) GetProcAddress(library, "grpc_access_token_credentials_create");
413
423
  grpc_google_iam_credentials_create_import = (grpc_google_iam_credentials_create_type) GetProcAddress(library, "grpc_google_iam_credentials_create");
@@ -440,6 +450,7 @@ void grpc_rb_load_imports(HMODULE library) {
440
450
  grpc_tls_identity_pairs_add_pair_import = (grpc_tls_identity_pairs_add_pair_type) GetProcAddress(library, "grpc_tls_identity_pairs_add_pair");
441
451
  grpc_tls_identity_pairs_destroy_import = (grpc_tls_identity_pairs_destroy_type) GetProcAddress(library, "grpc_tls_identity_pairs_destroy");
442
452
  grpc_tls_certificate_provider_static_data_create_import = (grpc_tls_certificate_provider_static_data_create_type) GetProcAddress(library, "grpc_tls_certificate_provider_static_data_create");
453
+ grpc_tls_certificate_provider_file_watcher_create_import = (grpc_tls_certificate_provider_file_watcher_create_type) GetProcAddress(library, "grpc_tls_certificate_provider_file_watcher_create");
443
454
  grpc_tls_certificate_provider_release_import = (grpc_tls_certificate_provider_release_type) GetProcAddress(library, "grpc_tls_certificate_provider_release");
444
455
  grpc_tls_credentials_options_create_import = (grpc_tls_credentials_options_create_type) GetProcAddress(library, "grpc_tls_credentials_options_create");
445
456
  grpc_tls_credentials_options_set_cert_request_type_import = (grpc_tls_credentials_options_set_cert_request_type_type) GetProcAddress(library, "grpc_tls_credentials_options_set_cert_request_type");
@@ -453,6 +464,7 @@ void grpc_rb_load_imports(HMODULE library) {
453
464
  grpc_tls_server_authorization_check_config_create_import = (grpc_tls_server_authorization_check_config_create_type) GetProcAddress(library, "grpc_tls_server_authorization_check_config_create");
454
465
  grpc_tls_server_authorization_check_config_release_import = (grpc_tls_server_authorization_check_config_release_type) GetProcAddress(library, "grpc_tls_server_authorization_check_config_release");
455
466
  grpc_xds_credentials_create_import = (grpc_xds_credentials_create_type) GetProcAddress(library, "grpc_xds_credentials_create");
467
+ grpc_xds_server_credentials_create_import = (grpc_xds_server_credentials_create_type) GetProcAddress(library, "grpc_xds_server_credentials_create");
456
468
  grpc_raw_byte_buffer_create_import = (grpc_raw_byte_buffer_create_type) GetProcAddress(library, "grpc_raw_byte_buffer_create");
457
469
  grpc_raw_compressed_byte_buffer_create_import = (grpc_raw_compressed_byte_buffer_create_type) GetProcAddress(library, "grpc_raw_compressed_byte_buffer_create");
458
470
  grpc_byte_buffer_copy_import = (grpc_byte_buffer_copy_type) GetProcAddress(library, "grpc_byte_buffer_copy");
@@ -47,7 +47,7 @@ extern grpc_compression_algorithm_is_message_type grpc_compression_algorithm_is_
47
47
  typedef int(*grpc_compression_algorithm_is_stream_type)(grpc_compression_algorithm algorithm);
48
48
  extern grpc_compression_algorithm_is_stream_type grpc_compression_algorithm_is_stream_import;
49
49
  #define grpc_compression_algorithm_is_stream grpc_compression_algorithm_is_stream_import
50
- typedef int(*grpc_compression_algorithm_parse_type)(grpc_slice value, grpc_compression_algorithm* algorithm);
50
+ typedef int(*grpc_compression_algorithm_parse_type)(grpc_slice name, grpc_compression_algorithm* algorithm);
51
51
  extern grpc_compression_algorithm_parse_type grpc_compression_algorithm_parse_import;
52
52
  #define grpc_compression_algorithm_parse grpc_compression_algorithm_parse_import
53
53
  typedef int(*grpc_compression_algorithm_name_type)(grpc_compression_algorithm algorithm, const char** name);
@@ -215,6 +215,15 @@ extern grpc_server_create_type grpc_server_create_import;
215
215
  typedef void(*grpc_server_register_completion_queue_type)(grpc_server* server, grpc_completion_queue* cq, void* reserved);
216
216
  extern grpc_server_register_completion_queue_type grpc_server_register_completion_queue_import;
217
217
  #define grpc_server_register_completion_queue grpc_server_register_completion_queue_import
218
+ typedef grpc_server_config_fetcher*(*grpc_server_config_fetcher_xds_create_type)();
219
+ extern grpc_server_config_fetcher_xds_create_type grpc_server_config_fetcher_xds_create_import;
220
+ #define grpc_server_config_fetcher_xds_create grpc_server_config_fetcher_xds_create_import
221
+ typedef void(*grpc_server_config_fetcher_destroy_type)(grpc_server_config_fetcher* config_fetcher);
222
+ extern grpc_server_config_fetcher_destroy_type grpc_server_config_fetcher_destroy_import;
223
+ #define grpc_server_config_fetcher_destroy grpc_server_config_fetcher_destroy_import
224
+ typedef void(*grpc_server_set_config_fetcher_type)(grpc_server* server, grpc_server_config_fetcher* config_fetcher);
225
+ extern grpc_server_set_config_fetcher_type grpc_server_set_config_fetcher_import;
226
+ #define grpc_server_set_config_fetcher grpc_server_set_config_fetcher_import
218
227
  typedef int(*grpc_server_add_insecure_http2_port_type)(grpc_server* server, const char* addr);
219
228
  extern grpc_server_add_insecure_http2_port_type grpc_server_add_insecure_http2_port_import;
220
229
  #define grpc_server_add_insecure_http2_port grpc_server_add_insecure_http2_port_import
@@ -365,6 +374,9 @@ extern grpc_max_auth_token_lifetime_type grpc_max_auth_token_lifetime_import;
365
374
  typedef grpc_call_credentials*(*grpc_service_account_jwt_access_credentials_create_type)(const char* json_key, gpr_timespec token_lifetime, void* reserved);
366
375
  extern grpc_service_account_jwt_access_credentials_create_type grpc_service_account_jwt_access_credentials_create_import;
367
376
  #define grpc_service_account_jwt_access_credentials_create grpc_service_account_jwt_access_credentials_create_import
377
+ typedef grpc_call_credentials*(*grpc_external_account_credentials_create_type)(const char* json_string, const char* scopes_string);
378
+ extern grpc_external_account_credentials_create_type grpc_external_account_credentials_create_import;
379
+ #define grpc_external_account_credentials_create grpc_external_account_credentials_create_import
368
380
  typedef grpc_call_credentials*(*grpc_google_refresh_token_credentials_create_type)(const char* json_refresh_token, void* reserved);
369
381
  extern grpc_google_refresh_token_credentials_create_type grpc_google_refresh_token_credentials_create_import;
370
382
  #define grpc_google_refresh_token_credentials_create grpc_google_refresh_token_credentials_create_import
@@ -461,6 +473,9 @@ extern grpc_tls_identity_pairs_destroy_type grpc_tls_identity_pairs_destroy_impo
461
473
  typedef grpc_tls_certificate_provider*(*grpc_tls_certificate_provider_static_data_create_type)(const char* root_certificate, grpc_tls_identity_pairs* pem_key_cert_pairs);
462
474
  extern grpc_tls_certificate_provider_static_data_create_type grpc_tls_certificate_provider_static_data_create_import;
463
475
  #define grpc_tls_certificate_provider_static_data_create grpc_tls_certificate_provider_static_data_create_import
476
+ typedef grpc_tls_certificate_provider*(*grpc_tls_certificate_provider_file_watcher_create_type)(const char* private_key_path, const char* identity_certificate_path, const char* root_cert_path, unsigned int refresh_interval_sec);
477
+ extern grpc_tls_certificate_provider_file_watcher_create_type grpc_tls_certificate_provider_file_watcher_create_import;
478
+ #define grpc_tls_certificate_provider_file_watcher_create grpc_tls_certificate_provider_file_watcher_create_import
464
479
  typedef void(*grpc_tls_certificate_provider_release_type)(grpc_tls_certificate_provider* provider);
465
480
  extern grpc_tls_certificate_provider_release_type grpc_tls_certificate_provider_release_import;
466
481
  #define grpc_tls_certificate_provider_release grpc_tls_certificate_provider_release_import
@@ -500,6 +515,9 @@ extern grpc_tls_server_authorization_check_config_release_type grpc_tls_server_a
500
515
  typedef grpc_channel_credentials*(*grpc_xds_credentials_create_type)(grpc_channel_credentials* fallback_credentials);
501
516
  extern grpc_xds_credentials_create_type grpc_xds_credentials_create_import;
502
517
  #define grpc_xds_credentials_create grpc_xds_credentials_create_import
518
+ typedef grpc_server_credentials*(*grpc_xds_server_credentials_create_type)(grpc_server_credentials* fallback_credentials);
519
+ extern grpc_xds_server_credentials_create_type grpc_xds_server_credentials_create_import;
520
+ #define grpc_xds_server_credentials_create grpc_xds_server_credentials_create_import
503
521
  typedef grpc_byte_buffer*(*grpc_raw_byte_buffer_create_type)(grpc_slice* slices, size_t nslices);
504
522
  extern grpc_raw_byte_buffer_create_type grpc_raw_byte_buffer_create_import;
505
523
  #define grpc_raw_byte_buffer_create grpc_raw_byte_buffer_create_import
@@ -512,7 +530,7 @@ extern grpc_byte_buffer_copy_type grpc_byte_buffer_copy_import;
512
530
  typedef size_t(*grpc_byte_buffer_length_type)(grpc_byte_buffer* bb);
513
531
  extern grpc_byte_buffer_length_type grpc_byte_buffer_length_import;
514
532
  #define grpc_byte_buffer_length grpc_byte_buffer_length_import
515
- typedef void(*grpc_byte_buffer_destroy_type)(grpc_byte_buffer* byte_buffer);
533
+ typedef void(*grpc_byte_buffer_destroy_type)(grpc_byte_buffer* bb);
516
534
  extern grpc_byte_buffer_destroy_type grpc_byte_buffer_destroy_import;
517
535
  #define grpc_byte_buffer_destroy grpc_byte_buffer_destroy_import
518
536
  typedef int(*grpc_byte_buffer_reader_init_type)(grpc_byte_buffer_reader* reader, grpc_byte_buffer* buffer);
@@ -680,7 +698,7 @@ extern grpc_slice_buffer_swap_type grpc_slice_buffer_swap_import;
680
698
  typedef void(*grpc_slice_buffer_move_into_type)(grpc_slice_buffer* src, grpc_slice_buffer* dst);
681
699
  extern grpc_slice_buffer_move_into_type grpc_slice_buffer_move_into_import;
682
700
  #define grpc_slice_buffer_move_into grpc_slice_buffer_move_into_import
683
- typedef void(*grpc_slice_buffer_trim_end_type)(grpc_slice_buffer* src, size_t n, grpc_slice_buffer* garbage);
701
+ typedef void(*grpc_slice_buffer_trim_end_type)(grpc_slice_buffer* sb, size_t n, grpc_slice_buffer* garbage);
684
702
  extern grpc_slice_buffer_trim_end_type grpc_slice_buffer_trim_end_import;
685
703
  #define grpc_slice_buffer_trim_end grpc_slice_buffer_trim_end_import
686
704
  typedef void(*grpc_slice_buffer_move_first_type)(grpc_slice_buffer* src, size_t n, grpc_slice_buffer* dst);
@@ -692,10 +710,10 @@ extern grpc_slice_buffer_move_first_no_ref_type grpc_slice_buffer_move_first_no_
692
710
  typedef void(*grpc_slice_buffer_move_first_into_buffer_type)(grpc_slice_buffer* src, size_t n, void* dst);
693
711
  extern grpc_slice_buffer_move_first_into_buffer_type grpc_slice_buffer_move_first_into_buffer_import;
694
712
  #define grpc_slice_buffer_move_first_into_buffer grpc_slice_buffer_move_first_into_buffer_import
695
- typedef grpc_slice(*grpc_slice_buffer_take_first_type)(grpc_slice_buffer* src);
713
+ typedef grpc_slice(*grpc_slice_buffer_take_first_type)(grpc_slice_buffer* sb);
696
714
  extern grpc_slice_buffer_take_first_type grpc_slice_buffer_take_first_import;
697
715
  #define grpc_slice_buffer_take_first grpc_slice_buffer_take_first_import
698
- typedef void(*grpc_slice_buffer_undo_take_first_type)(grpc_slice_buffer* src, grpc_slice slice);
716
+ typedef void(*grpc_slice_buffer_undo_take_first_type)(grpc_slice_buffer* sb, grpc_slice slice);
699
717
  extern grpc_slice_buffer_undo_take_first_type grpc_slice_buffer_undo_take_first_import;
700
718
  #define grpc_slice_buffer_undo_take_first grpc_slice_buffer_undo_take_first_import
701
719
  typedef void*(*gpr_malloc_type)(size_t size);
@@ -761,7 +779,7 @@ extern gpr_cv_signal_type gpr_cv_signal_import;
761
779
  typedef void(*gpr_cv_broadcast_type)(gpr_cv* cv);
762
780
  extern gpr_cv_broadcast_type gpr_cv_broadcast_import;
763
781
  #define gpr_cv_broadcast gpr_cv_broadcast_import
764
- typedef void(*gpr_once_init_type)(gpr_once* once, void (*init_routine)(void));
782
+ typedef void(*gpr_once_init_type)(gpr_once* once, void (*init_function)(void));
765
783
  extern gpr_once_init_type gpr_once_init_import;
766
784
  #define gpr_once_init gpr_once_init_import
767
785
  typedef void(*gpr_event_init_type)(gpr_event* ev);
@@ -821,7 +839,7 @@ extern gpr_time_init_type gpr_time_init_import;
821
839
  typedef gpr_timespec(*gpr_now_type)(gpr_clock_type clock);
822
840
  extern gpr_now_type gpr_now_import;
823
841
  #define gpr_now gpr_now_import
824
- typedef gpr_timespec(*gpr_convert_clock_type_type)(gpr_timespec t, gpr_clock_type target_clock);
842
+ typedef gpr_timespec(*gpr_convert_clock_type_type)(gpr_timespec t, gpr_clock_type clock_type);
825
843
  extern gpr_convert_clock_type_type gpr_convert_clock_type_import;
826
844
  #define gpr_convert_clock_type gpr_convert_clock_type_import
827
845
  typedef int(*gpr_time_cmp_type)(gpr_timespec a, gpr_timespec b);
@@ -839,22 +857,22 @@ extern gpr_time_add_type gpr_time_add_import;
839
857
  typedef gpr_timespec(*gpr_time_sub_type)(gpr_timespec a, gpr_timespec b);
840
858
  extern gpr_time_sub_type gpr_time_sub_import;
841
859
  #define gpr_time_sub gpr_time_sub_import
842
- typedef gpr_timespec(*gpr_time_from_micros_type)(int64_t x, gpr_clock_type clock_type);
860
+ typedef gpr_timespec(*gpr_time_from_micros_type)(int64_t us, gpr_clock_type clock_type);
843
861
  extern gpr_time_from_micros_type gpr_time_from_micros_import;
844
862
  #define gpr_time_from_micros gpr_time_from_micros_import
845
- typedef gpr_timespec(*gpr_time_from_nanos_type)(int64_t x, gpr_clock_type clock_type);
863
+ typedef gpr_timespec(*gpr_time_from_nanos_type)(int64_t ns, gpr_clock_type clock_type);
846
864
  extern gpr_time_from_nanos_type gpr_time_from_nanos_import;
847
865
  #define gpr_time_from_nanos gpr_time_from_nanos_import
848
- typedef gpr_timespec(*gpr_time_from_millis_type)(int64_t x, gpr_clock_type clock_type);
866
+ typedef gpr_timespec(*gpr_time_from_millis_type)(int64_t ms, gpr_clock_type clock_type);
849
867
  extern gpr_time_from_millis_type gpr_time_from_millis_import;
850
868
  #define gpr_time_from_millis gpr_time_from_millis_import
851
- typedef gpr_timespec(*gpr_time_from_seconds_type)(int64_t x, gpr_clock_type clock_type);
869
+ typedef gpr_timespec(*gpr_time_from_seconds_type)(int64_t s, gpr_clock_type clock_type);
852
870
  extern gpr_time_from_seconds_type gpr_time_from_seconds_import;
853
871
  #define gpr_time_from_seconds gpr_time_from_seconds_import
854
- typedef gpr_timespec(*gpr_time_from_minutes_type)(int64_t x, gpr_clock_type clock_type);
872
+ typedef gpr_timespec(*gpr_time_from_minutes_type)(int64_t m, gpr_clock_type clock_type);
855
873
  extern gpr_time_from_minutes_type gpr_time_from_minutes_import;
856
874
  #define gpr_time_from_minutes gpr_time_from_minutes_import
857
- typedef gpr_timespec(*gpr_time_from_hours_type)(int64_t x, gpr_clock_type clock_type);
875
+ typedef gpr_timespec(*gpr_time_from_hours_type)(int64_t h, gpr_clock_type clock_type);
858
876
  extern gpr_time_from_hours_type gpr_time_from_hours_import;
859
877
  #define gpr_time_from_hours gpr_time_from_hours_import
860
878
  typedef int32_t(*gpr_time_to_millis_type)(gpr_timespec timespec);
@@ -14,5 +14,5 @@
14
14
 
15
15
  # GRPC contains the General RPC module.
16
16
  module GRPC
17
- VERSION = '1.34.0'
17
+ VERSION = '1.35.0.pre1'
18
18
  end
@@ -76,6 +76,28 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
76
76
  add_message "grpc.testing.LoadBalancerStatsResponse.RpcsByPeer" do
77
77
  map :rpcs_by_peer, :string, :int32, 1
78
78
  end
79
+ add_message "grpc.testing.LoadBalancerAccumulatedStatsRequest" do
80
+ end
81
+ add_message "grpc.testing.LoadBalancerAccumulatedStatsResponse" do
82
+ map :num_rpcs_started_by_method, :string, :int32, 1
83
+ map :num_rpcs_succeeded_by_method, :string, :int32, 2
84
+ map :num_rpcs_failed_by_method, :string, :int32, 3
85
+ end
86
+ add_message "grpc.testing.ClientConfigureRequest" do
87
+ repeated :types, :enum, 1, "grpc.testing.ClientConfigureRequest.RpcType"
88
+ repeated :metadata, :message, 2, "grpc.testing.ClientConfigureRequest.Metadata"
89
+ end
90
+ add_message "grpc.testing.ClientConfigureRequest.Metadata" do
91
+ optional :type, :enum, 1, "grpc.testing.ClientConfigureRequest.RpcType"
92
+ optional :key, :string, 2
93
+ optional :value, :string, 3
94
+ end
95
+ add_enum "grpc.testing.ClientConfigureRequest.RpcType" do
96
+ value :EMPTY_CALL, 0
97
+ value :UNARY_CALL, 1
98
+ end
99
+ add_message "grpc.testing.ClientConfigureResponse" do
100
+ end
79
101
  add_enum "grpc.testing.PayloadType" do
80
102
  value :COMPRESSABLE, 0
81
103
  end
@@ -104,6 +126,12 @@ module Grpc
104
126
  LoadBalancerStatsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.LoadBalancerStatsRequest").msgclass
105
127
  LoadBalancerStatsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.LoadBalancerStatsResponse").msgclass
106
128
  LoadBalancerStatsResponse::RpcsByPeer = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.LoadBalancerStatsResponse.RpcsByPeer").msgclass
129
+ LoadBalancerAccumulatedStatsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.LoadBalancerAccumulatedStatsRequest").msgclass
130
+ LoadBalancerAccumulatedStatsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.LoadBalancerAccumulatedStatsResponse").msgclass
131
+ ClientConfigureRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ClientConfigureRequest").msgclass
132
+ ClientConfigureRequest::Metadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ClientConfigureRequest.Metadata").msgclass
133
+ ClientConfigureRequest::RpcType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ClientConfigureRequest.RpcType").enummodule
134
+ ClientConfigureResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ClientConfigureResponse").msgclass
107
135
  PayloadType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.PayloadType").enummodule
108
136
  GrpclbRouteType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.GrpclbRouteType").enummodule
109
137
  end
@@ -110,6 +110,8 @@ module Grpc
110
110
 
111
111
  # Gets the backend distribution for RPCs sent by a test client.
112
112
  rpc :GetClientStats, ::Grpc::Testing::LoadBalancerStatsRequest, ::Grpc::Testing::LoadBalancerStatsResponse
113
+ # Gets the accumulated stats for RPCs sent by a test client.
114
+ rpc :GetClientAccumulatedStats, ::Grpc::Testing::LoadBalancerAccumulatedStatsRequest, ::Grpc::Testing::LoadBalancerAccumulatedStatsResponse
113
115
  end
114
116
 
115
117
  Stub = Service.rpc_stub_class
@@ -128,6 +130,22 @@ module Grpc
128
130
  rpc :SetNotServing, ::Grpc::Testing::Empty, ::Grpc::Testing::Empty
129
131
  end
130
132
 
133
+ Stub = Service.rpc_stub_class
134
+ end
135
+ module XdsUpdateClientConfigureService
136
+ # A service to dynamically update the configuration of an xDS test client.
137
+ class Service
138
+
139
+ include GRPC::GenericService
140
+
141
+ self.marshal_class_method = :encode
142
+ self.unmarshal_class_method = :decode
143
+ self.service_name = 'grpc.testing.XdsUpdateClientConfigureService'
144
+
145
+ # Update the tes client's configuration.
146
+ rpc :Configure, ::Grpc::Testing::ClientConfigureRequest, ::Grpc::Testing::ClientConfigureResponse
147
+ end
148
+
131
149
  Stub = Service.rpc_stub_class
132
150
  end
133
151
  end
@@ -71,14 +71,10 @@ describe 'Code Generation Options' do
71
71
  end
72
72
 
73
73
  def with_protos(file_paths)
74
- fail 'CONFIG env variable unexpectedly unset' unless ENV['CONFIG']
75
- bins_sub_dir = ENV['CONFIG']
76
-
77
74
  pb_dir = File.dirname(__FILE__)
78
- bins_dir = File.join('..', '..', '..', '..', '..', 'bins', bins_sub_dir)
79
-
75
+ bins_dir = File.join('..', '..', '..', '..', '..', 'cmake', 'build')
80
76
  plugin = File.join(bins_dir, 'grpc_ruby_plugin')
81
- protoc = File.join(bins_dir, 'protobuf', 'protoc')
77
+ protoc = File.join(bins_dir, 'third_party', 'protobuf', 'protoc')
82
78
 
83
79
  # Generate the service from the proto
84
80
  Dir.mktmpdir(nil, File.dirname(__FILE__)) do |tmp_dir|
@@ -0,0 +1,606 @@
1
+ // Copyright 2018 The Abseil Authors.
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // https://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+ //
15
+ // -----------------------------------------------------------------------------
16
+ // File: flat_hash_map.h
17
+ // -----------------------------------------------------------------------------
18
+ //
19
+ // An `absl::flat_hash_map<K, V>` is an unordered associative container of
20
+ // unique keys and associated values designed to be a more efficient replacement
21
+ // for `std::unordered_map`. Like `unordered_map`, search, insertion, and
22
+ // deletion of map elements can be done as an `O(1)` operation. However,
23
+ // `flat_hash_map` (and other unordered associative containers known as the
24
+ // collection of Abseil "Swiss tables") contain other optimizations that result
25
+ // in both memory and computation advantages.
26
+ //
27
+ // In most cases, your default choice for a hash map should be a map of type
28
+ // `flat_hash_map`.
29
+
30
+ #ifndef ABSL_CONTAINER_FLAT_HASH_MAP_H_
31
+ #define ABSL_CONTAINER_FLAT_HASH_MAP_H_
32
+
33
+ #include <cstddef>
34
+ #include <new>
35
+ #include <type_traits>
36
+ #include <utility>
37
+
38
+ #include "absl/algorithm/container.h"
39
+ #include "absl/container/internal/container_memory.h"
40
+ #include "absl/container/internal/hash_function_defaults.h" // IWYU pragma: export
41
+ #include "absl/container/internal/raw_hash_map.h" // IWYU pragma: export
42
+ #include "absl/memory/memory.h"
43
+
44
+ namespace absl {
45
+ ABSL_NAMESPACE_BEGIN
46
+ namespace container_internal {
47
+ template <class K, class V>
48
+ struct FlatHashMapPolicy;
49
+ } // namespace container_internal
50
+
51
+ // -----------------------------------------------------------------------------
52
+ // absl::flat_hash_map
53
+ // -----------------------------------------------------------------------------
54
+ //
55
+ // An `absl::flat_hash_map<K, V>` is an unordered associative container which
56
+ // has been optimized for both speed and memory footprint in most common use
57
+ // cases. Its interface is similar to that of `std::unordered_map<K, V>` with
58
+ // the following notable differences:
59
+ //
60
+ // * Requires keys that are CopyConstructible
61
+ // * Requires values that are MoveConstructible
62
+ // * Supports heterogeneous lookup, through `find()`, `operator[]()` and
63
+ // `insert()`, provided that the map is provided a compatible heterogeneous
64
+ // hashing function and equality operator.
65
+ // * Invalidates any references and pointers to elements within the table after
66
+ // `rehash()`.
67
+ // * Contains a `capacity()` member function indicating the number of element
68
+ // slots (open, deleted, and empty) within the hash map.
69
+ // * Returns `void` from the `erase(iterator)` overload.
70
+ //
71
+ // By default, `flat_hash_map` uses the `absl::Hash` hashing framework.
72
+ // All fundamental and Abseil types that support the `absl::Hash` framework have
73
+ // a compatible equality operator for comparing insertions into `flat_hash_map`.
74
+ // If your type is not yet supported by the `absl::Hash` framework, see
75
+ // absl/hash/hash.h for information on extending Abseil hashing to user-defined
76
+ // types.
77
+ //
78
+ // NOTE: A `flat_hash_map` stores its value types directly inside its
79
+ // implementation array to avoid memory indirection. Because a `flat_hash_map`
80
+ // is designed to move data when rehashed, map values will not retain pointer
81
+ // stability. If you require pointer stability, or if your values are large,
82
+ // consider using `absl::flat_hash_map<Key, std::unique_ptr<Value>>` instead.
83
+ // If your types are not moveable or you require pointer stability for keys,
84
+ // consider `absl::node_hash_map`.
85
+ //
86
+ // Example:
87
+ //
88
+ // // Create a flat hash map of three strings (that map to strings)
89
+ // absl::flat_hash_map<std::string, std::string> ducks =
90
+ // {{"a", "huey"}, {"b", "dewey"}, {"c", "louie"}};
91
+ //
92
+ // // Insert a new element into the flat hash map
93
+ // ducks.insert({"d", "donald"});
94
+ //
95
+ // // Force a rehash of the flat hash map
96
+ // ducks.rehash(0);
97
+ //
98
+ // // Find the element with the key "b"
99
+ // std::string search_key = "b";
100
+ // auto result = ducks.find(search_key);
101
+ // if (result != ducks.end()) {
102
+ // std::cout << "Result: " << result->second << std::endl;
103
+ // }
104
+ template <class K, class V,
105
+ class Hash = absl::container_internal::hash_default_hash<K>,
106
+ class Eq = absl::container_internal::hash_default_eq<K>,
107
+ class Allocator = std::allocator<std::pair<const K, V>>>
108
+ class flat_hash_map : public absl::container_internal::raw_hash_map<
109
+ absl::container_internal::FlatHashMapPolicy<K, V>,
110
+ Hash, Eq, Allocator> {
111
+ using Base = typename flat_hash_map::raw_hash_map;
112
+
113
+ public:
114
+ // Constructors and Assignment Operators
115
+ //
116
+ // A flat_hash_map supports the same overload set as `std::unordered_map`
117
+ // for construction and assignment:
118
+ //
119
+ // * Default constructor
120
+ //
121
+ // // No allocation for the table's elements is made.
122
+ // absl::flat_hash_map<int, std::string> map1;
123
+ //
124
+ // * Initializer List constructor
125
+ //
126
+ // absl::flat_hash_map<int, std::string> map2 =
127
+ // {{1, "huey"}, {2, "dewey"}, {3, "louie"},};
128
+ //
129
+ // * Copy constructor
130
+ //
131
+ // absl::flat_hash_map<int, std::string> map3(map2);
132
+ //
133
+ // * Copy assignment operator
134
+ //
135
+ // // Hash functor and Comparator are copied as well
136
+ // absl::flat_hash_map<int, std::string> map4;
137
+ // map4 = map3;
138
+ //
139
+ // * Move constructor
140
+ //
141
+ // // Move is guaranteed efficient
142
+ // absl::flat_hash_map<int, std::string> map5(std::move(map4));
143
+ //
144
+ // * Move assignment operator
145
+ //
146
+ // // May be efficient if allocators are compatible
147
+ // absl::flat_hash_map<int, std::string> map6;
148
+ // map6 = std::move(map5);
149
+ //
150
+ // * Range constructor
151
+ //
152
+ // std::vector<std::pair<int, std::string>> v = {{1, "a"}, {2, "b"}};
153
+ // absl::flat_hash_map<int, std::string> map7(v.begin(), v.end());
154
+ flat_hash_map() {}
155
+ using Base::Base;
156
+
157
+ // flat_hash_map::begin()
158
+ //
159
+ // Returns an iterator to the beginning of the `flat_hash_map`.
160
+ using Base::begin;
161
+
162
+ // flat_hash_map::cbegin()
163
+ //
164
+ // Returns a const iterator to the beginning of the `flat_hash_map`.
165
+ using Base::cbegin;
166
+
167
+ // flat_hash_map::cend()
168
+ //
169
+ // Returns a const iterator to the end of the `flat_hash_map`.
170
+ using Base::cend;
171
+
172
+ // flat_hash_map::end()
173
+ //
174
+ // Returns an iterator to the end of the `flat_hash_map`.
175
+ using Base::end;
176
+
177
+ // flat_hash_map::capacity()
178
+ //
179
+ // Returns the number of element slots (assigned, deleted, and empty)
180
+ // available within the `flat_hash_map`.
181
+ //
182
+ // NOTE: this member function is particular to `absl::flat_hash_map` and is
183
+ // not provided in the `std::unordered_map` API.
184
+ using Base::capacity;
185
+
186
+ // flat_hash_map::empty()
187
+ //
188
+ // Returns whether or not the `flat_hash_map` is empty.
189
+ using Base::empty;
190
+
191
+ // flat_hash_map::max_size()
192
+ //
193
+ // Returns the largest theoretical possible number of elements within a
194
+ // `flat_hash_map` under current memory constraints. This value can be thought
195
+ // of the largest value of `std::distance(begin(), end())` for a
196
+ // `flat_hash_map<K, V>`.
197
+ using Base::max_size;
198
+
199
+ // flat_hash_map::size()
200
+ //
201
+ // Returns the number of elements currently within the `flat_hash_map`.
202
+ using Base::size;
203
+
204
+ // flat_hash_map::clear()
205
+ //
206
+ // Removes all elements from the `flat_hash_map`. Invalidates any references,
207
+ // pointers, or iterators referring to contained elements.
208
+ //
209
+ // NOTE: this operation may shrink the underlying buffer. To avoid shrinking
210
+ // the underlying buffer call `erase(begin(), end())`.
211
+ using Base::clear;
212
+
213
+ // flat_hash_map::erase()
214
+ //
215
+ // Erases elements within the `flat_hash_map`. Erasing does not trigger a
216
+ // rehash. Overloads are listed below.
217
+ //
218
+ // void erase(const_iterator pos):
219
+ //
220
+ // Erases the element at `position` of the `flat_hash_map`, returning
221
+ // `void`.
222
+ //
223
+ // NOTE: returning `void` in this case is different than that of STL
224
+ // containers in general and `std::unordered_map` in particular (which
225
+ // return an iterator to the element following the erased element). If that
226
+ // iterator is needed, simply post increment the iterator:
227
+ //
228
+ // map.erase(it++);
229
+ //
230
+ // iterator erase(const_iterator first, const_iterator last):
231
+ //
232
+ // Erases the elements in the open interval [`first`, `last`), returning an
233
+ // iterator pointing to `last`.
234
+ //
235
+ // size_type erase(const key_type& key):
236
+ //
237
+ // Erases the element with the matching key, if it exists, returning the
238
+ // number of elements erased (0 or 1).
239
+ using Base::erase;
240
+
241
+ // flat_hash_map::insert()
242
+ //
243
+ // Inserts an element of the specified value into the `flat_hash_map`,
244
+ // returning an iterator pointing to the newly inserted element, provided that
245
+ // an element with the given key does not already exist. If rehashing occurs
246
+ // due to the insertion, all iterators are invalidated. Overloads are listed
247
+ // below.
248
+ //
249
+ // std::pair<iterator,bool> insert(const init_type& value):
250
+ //
251
+ // Inserts a value into the `flat_hash_map`. Returns a pair consisting of an
252
+ // iterator to the inserted element (or to the element that prevented the
253
+ // insertion) and a bool denoting whether the insertion took place.
254
+ //
255
+ // std::pair<iterator,bool> insert(T&& value):
256
+ // std::pair<iterator,bool> insert(init_type&& value):
257
+ //
258
+ // Inserts a moveable value into the `flat_hash_map`. Returns a pair
259
+ // consisting of an iterator to the inserted element (or to the element that
260
+ // prevented the insertion) and a bool denoting whether the insertion took
261
+ // place.
262
+ //
263
+ // iterator insert(const_iterator hint, const init_type& value):
264
+ // iterator insert(const_iterator hint, T&& value):
265
+ // iterator insert(const_iterator hint, init_type&& value);
266
+ //
267
+ // Inserts a value, using the position of `hint` as a non-binding suggestion
268
+ // for where to begin the insertion search. Returns an iterator to the
269
+ // inserted element, or to the existing element that prevented the
270
+ // insertion.
271
+ //
272
+ // void insert(InputIterator first, InputIterator last):
273
+ //
274
+ // Inserts a range of values [`first`, `last`).
275
+ //
276
+ // NOTE: Although the STL does not specify which element may be inserted if
277
+ // multiple keys compare equivalently, for `flat_hash_map` we guarantee the
278
+ // first match is inserted.
279
+ //
280
+ // void insert(std::initializer_list<init_type> ilist):
281
+ //
282
+ // Inserts the elements within the initializer list `ilist`.
283
+ //
284
+ // NOTE: Although the STL does not specify which element may be inserted if
285
+ // multiple keys compare equivalently within the initializer list, for
286
+ // `flat_hash_map` we guarantee the first match is inserted.
287
+ using Base::insert;
288
+
289
+ // flat_hash_map::insert_or_assign()
290
+ //
291
+ // Inserts an element of the specified value into the `flat_hash_map` provided
292
+ // that a value with the given key does not already exist, or replaces it with
293
+ // the element value if a key for that value already exists, returning an
294
+ // iterator pointing to the newly inserted element. If rehashing occurs due
295
+ // to the insertion, all existing iterators are invalidated. Overloads are
296
+ // listed below.
297
+ //
298
+ // pair<iterator, bool> insert_or_assign(const init_type& k, T&& obj):
299
+ // pair<iterator, bool> insert_or_assign(init_type&& k, T&& obj):
300
+ //
301
+ // Inserts/Assigns (or moves) the element of the specified key into the
302
+ // `flat_hash_map`.
303
+ //
304
+ // iterator insert_or_assign(const_iterator hint,
305
+ // const init_type& k, T&& obj):
306
+ // iterator insert_or_assign(const_iterator hint, init_type&& k, T&& obj):
307
+ //
308
+ // Inserts/Assigns (or moves) the element of the specified key into the
309
+ // `flat_hash_map` using the position of `hint` as a non-binding suggestion
310
+ // for where to begin the insertion search.
311
+ using Base::insert_or_assign;
312
+
313
+ // flat_hash_map::emplace()
314
+ //
315
+ // Inserts an element of the specified value by constructing it in-place
316
+ // within the `flat_hash_map`, provided that no element with the given key
317
+ // already exists.
318
+ //
319
+ // The element may be constructed even if there already is an element with the
320
+ // key in the container, in which case the newly constructed element will be
321
+ // destroyed immediately. Prefer `try_emplace()` unless your key is not
322
+ // copyable or moveable.
323
+ //
324
+ // If rehashing occurs due to the insertion, all iterators are invalidated.
325
+ using Base::emplace;
326
+
327
+ // flat_hash_map::emplace_hint()
328
+ //
329
+ // Inserts an element of the specified value by constructing it in-place
330
+ // within the `flat_hash_map`, using the position of `hint` as a non-binding
331
+ // suggestion for where to begin the insertion search, and only inserts
332
+ // provided that no element with the given key already exists.
333
+ //
334
+ // The element may be constructed even if there already is an element with the
335
+ // key in the container, in which case the newly constructed element will be
336
+ // destroyed immediately. Prefer `try_emplace()` unless your key is not
337
+ // copyable or moveable.
338
+ //
339
+ // If rehashing occurs due to the insertion, all iterators are invalidated.
340
+ using Base::emplace_hint;
341
+
342
+ // flat_hash_map::try_emplace()
343
+ //
344
+ // Inserts an element of the specified value by constructing it in-place
345
+ // within the `flat_hash_map`, provided that no element with the given key
346
+ // already exists. Unlike `emplace()`, if an element with the given key
347
+ // already exists, we guarantee that no element is constructed.
348
+ //
349
+ // If rehashing occurs due to the insertion, all iterators are invalidated.
350
+ // Overloads are listed below.
351
+ //
352
+ // pair<iterator, bool> try_emplace(const key_type& k, Args&&... args):
353
+ // pair<iterator, bool> try_emplace(key_type&& k, Args&&... args):
354
+ //
355
+ // Inserts (via copy or move) the element of the specified key into the
356
+ // `flat_hash_map`.
357
+ //
358
+ // iterator try_emplace(const_iterator hint,
359
+ // const init_type& k, Args&&... args):
360
+ // iterator try_emplace(const_iterator hint, init_type&& k, Args&&... args):
361
+ //
362
+ // Inserts (via copy or move) the element of the specified key into the
363
+ // `flat_hash_map` using the position of `hint` as a non-binding suggestion
364
+ // for where to begin the insertion search.
365
+ //
366
+ // All `try_emplace()` overloads make the same guarantees regarding rvalue
367
+ // arguments as `std::unordered_map::try_emplace()`, namely that these
368
+ // functions will not move from rvalue arguments if insertions do not happen.
369
+ using Base::try_emplace;
370
+
371
+ // flat_hash_map::extract()
372
+ //
373
+ // Extracts the indicated element, erasing it in the process, and returns it
374
+ // as a C++17-compatible node handle. Overloads are listed below.
375
+ //
376
+ // node_type extract(const_iterator position):
377
+ //
378
+ // Extracts the key,value pair of the element at the indicated position and
379
+ // returns a node handle owning that extracted data.
380
+ //
381
+ // node_type extract(const key_type& x):
382
+ //
383
+ // Extracts the key,value pair of the element with a key matching the passed
384
+ // key value and returns a node handle owning that extracted data. If the
385
+ // `flat_hash_map` does not contain an element with a matching key, this
386
+ // function returns an empty node handle.
387
+ //
388
+ // NOTE: when compiled in an earlier version of C++ than C++17,
389
+ // `node_type::key()` returns a const reference to the key instead of a
390
+ // mutable reference. We cannot safely return a mutable reference without
391
+ // std::launder (which is not available before C++17).
392
+ using Base::extract;
393
+
394
+ // flat_hash_map::merge()
395
+ //
396
+ // Extracts elements from a given `source` flat hash map into this
397
+ // `flat_hash_map`. If the destination `flat_hash_map` already contains an
398
+ // element with an equivalent key, that element is not extracted.
399
+ using Base::merge;
400
+
401
+ // flat_hash_map::swap(flat_hash_map& other)
402
+ //
403
+ // Exchanges the contents of this `flat_hash_map` with those of the `other`
404
+ // flat hash map, avoiding invocation of any move, copy, or swap operations on
405
+ // individual elements.
406
+ //
407
+ // All iterators and references on the `flat_hash_map` remain valid, excepting
408
+ // for the past-the-end iterator, which is invalidated.
409
+ //
410
+ // `swap()` requires that the flat hash map's hashing and key equivalence
411
+ // functions be Swappable, and are exchanged using unqualified calls to
412
+ // non-member `swap()`. If the map's allocator has
413
+ // `std::allocator_traits<allocator_type>::propagate_on_container_swap::value`
414
+ // set to `true`, the allocators are also exchanged using an unqualified call
415
+ // to non-member `swap()`; otherwise, the allocators are not swapped.
416
+ using Base::swap;
417
+
418
+ // flat_hash_map::rehash(count)
419
+ //
420
+ // Rehashes the `flat_hash_map`, setting the number of slots to be at least
421
+ // the passed value. If the new number of slots increases the load factor more
422
+ // than the current maximum load factor
423
+ // (`count` < `size()` / `max_load_factor()`), then the new number of slots
424
+ // will be at least `size()` / `max_load_factor()`.
425
+ //
426
+ // To force a rehash, pass rehash(0).
427
+ //
428
+ // NOTE: unlike behavior in `std::unordered_map`, references are also
429
+ // invalidated upon a `rehash()`.
430
+ using Base::rehash;
431
+
432
+ // flat_hash_map::reserve(count)
433
+ //
434
+ // Sets the number of slots in the `flat_hash_map` to the number needed to
435
+ // accommodate at least `count` total elements without exceeding the current
436
+ // maximum load factor, and may rehash the container if needed.
437
+ using Base::reserve;
438
+
439
+ // flat_hash_map::at()
440
+ //
441
+ // Returns a reference to the mapped value of the element with key equivalent
442
+ // to the passed key.
443
+ using Base::at;
444
+
445
+ // flat_hash_map::contains()
446
+ //
447
+ // Determines whether an element with a key comparing equal to the given `key`
448
+ // exists within the `flat_hash_map`, returning `true` if so or `false`
449
+ // otherwise.
450
+ using Base::contains;
451
+
452
+ // flat_hash_map::count(const Key& key) const
453
+ //
454
+ // Returns the number of elements with a key comparing equal to the given
455
+ // `key` within the `flat_hash_map`. note that this function will return
456
+ // either `1` or `0` since duplicate keys are not allowed within a
457
+ // `flat_hash_map`.
458
+ using Base::count;
459
+
460
+ // flat_hash_map::equal_range()
461
+ //
462
+ // Returns a closed range [first, last], defined by a `std::pair` of two
463
+ // iterators, containing all elements with the passed key in the
464
+ // `flat_hash_map`.
465
+ using Base::equal_range;
466
+
467
+ // flat_hash_map::find()
468
+ //
469
+ // Finds an element with the passed `key` within the `flat_hash_map`.
470
+ using Base::find;
471
+
472
+ // flat_hash_map::operator[]()
473
+ //
474
+ // Returns a reference to the value mapped to the passed key within the
475
+ // `flat_hash_map`, performing an `insert()` if the key does not already
476
+ // exist.
477
+ //
478
+ // If an insertion occurs and results in a rehashing of the container, all
479
+ // iterators are invalidated. Otherwise iterators are not affected and
480
+ // references are not invalidated. Overloads are listed below.
481
+ //
482
+ // T& operator[](const Key& key):
483
+ //
484
+ // Inserts an init_type object constructed in-place if the element with the
485
+ // given key does not exist.
486
+ //
487
+ // T& operator[](Key&& key):
488
+ //
489
+ // Inserts an init_type object constructed in-place provided that an element
490
+ // with the given key does not exist.
491
+ using Base::operator[];
492
+
493
+ // flat_hash_map::bucket_count()
494
+ //
495
+ // Returns the number of "buckets" within the `flat_hash_map`. Note that
496
+ // because a flat hash map contains all elements within its internal storage,
497
+ // this value simply equals the current capacity of the `flat_hash_map`.
498
+ using Base::bucket_count;
499
+
500
+ // flat_hash_map::load_factor()
501
+ //
502
+ // Returns the current load factor of the `flat_hash_map` (the average number
503
+ // of slots occupied with a value within the hash map).
504
+ using Base::load_factor;
505
+
506
+ // flat_hash_map::max_load_factor()
507
+ //
508
+ // Manages the maximum load factor of the `flat_hash_map`. Overloads are
509
+ // listed below.
510
+ //
511
+ // float flat_hash_map::max_load_factor()
512
+ //
513
+ // Returns the current maximum load factor of the `flat_hash_map`.
514
+ //
515
+ // void flat_hash_map::max_load_factor(float ml)
516
+ //
517
+ // Sets the maximum load factor of the `flat_hash_map` to the passed value.
518
+ //
519
+ // NOTE: This overload is provided only for API compatibility with the STL;
520
+ // `flat_hash_map` will ignore any set load factor and manage its rehashing
521
+ // internally as an implementation detail.
522
+ using Base::max_load_factor;
523
+
524
+ // flat_hash_map::get_allocator()
525
+ //
526
+ // Returns the allocator function associated with this `flat_hash_map`.
527
+ using Base::get_allocator;
528
+
529
+ // flat_hash_map::hash_function()
530
+ //
531
+ // Returns the hashing function used to hash the keys within this
532
+ // `flat_hash_map`.
533
+ using Base::hash_function;
534
+
535
+ // flat_hash_map::key_eq()
536
+ //
537
+ // Returns the function used for comparing keys equality.
538
+ using Base::key_eq;
539
+ };
540
+
541
+ // erase_if(flat_hash_map<>, Pred)
542
+ //
543
+ // Erases all elements that satisfy the predicate `pred` from the container `c`.
544
+ template <typename K, typename V, typename H, typename E, typename A,
545
+ typename Predicate>
546
+ void erase_if(flat_hash_map<K, V, H, E, A>& c, Predicate pred) {
547
+ container_internal::EraseIf(pred, &c);
548
+ }
549
+
550
+ namespace container_internal {
551
+
552
+ template <class K, class V>
553
+ struct FlatHashMapPolicy {
554
+ using slot_policy = container_internal::map_slot_policy<K, V>;
555
+ using slot_type = typename slot_policy::slot_type;
556
+ using key_type = K;
557
+ using mapped_type = V;
558
+ using init_type = std::pair</*non const*/ key_type, mapped_type>;
559
+
560
+ template <class Allocator, class... Args>
561
+ static void construct(Allocator* alloc, slot_type* slot, Args&&... args) {
562
+ slot_policy::construct(alloc, slot, std::forward<Args>(args)...);
563
+ }
564
+
565
+ template <class Allocator>
566
+ static void destroy(Allocator* alloc, slot_type* slot) {
567
+ slot_policy::destroy(alloc, slot);
568
+ }
569
+
570
+ template <class Allocator>
571
+ static void transfer(Allocator* alloc, slot_type* new_slot,
572
+ slot_type* old_slot) {
573
+ slot_policy::transfer(alloc, new_slot, old_slot);
574
+ }
575
+
576
+ template <class F, class... Args>
577
+ static decltype(absl::container_internal::DecomposePair(
578
+ std::declval<F>(), std::declval<Args>()...))
579
+ apply(F&& f, Args&&... args) {
580
+ return absl::container_internal::DecomposePair(std::forward<F>(f),
581
+ std::forward<Args>(args)...);
582
+ }
583
+
584
+ static size_t space_used(const slot_type*) { return 0; }
585
+
586
+ static std::pair<const K, V>& element(slot_type* slot) { return slot->value; }
587
+
588
+ static V& value(std::pair<const K, V>* kv) { return kv->second; }
589
+ static const V& value(const std::pair<const K, V>* kv) { return kv->second; }
590
+ };
591
+
592
+ } // namespace container_internal
593
+
594
+ namespace container_algorithm_internal {
595
+
596
+ // Specialization of trait in absl/algorithm/container.h
597
+ template <class Key, class T, class Hash, class KeyEqual, class Allocator>
598
+ struct IsUnorderedContainer<
599
+ absl::flat_hash_map<Key, T, Hash, KeyEqual, Allocator>> : std::true_type {};
600
+
601
+ } // namespace container_algorithm_internal
602
+
603
+ ABSL_NAMESPACE_END
604
+ } // namespace absl
605
+
606
+ #endif // ABSL_CONTAINER_FLAT_HASH_MAP_H_