ZTWHHH commited on
Commit
167a3ee
·
verified ·
1 Parent(s): aa690cd

Add files using upload-large-folder tool

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/backend_metric.h +36 -0
  2. videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/backup_poller.h +41 -0
  3. videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/client_channel.h +82 -0
  4. videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/client_channel_channelz.h +80 -0
  5. videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/client_channel_factory.h +47 -0
  6. videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/connector.h +79 -0
  7. videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/global_subchannel_pool.h +68 -0
  8. videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/health/health_check_client.h +175 -0
  9. videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/http_connect_handshaker.h +34 -0
  10. videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/http_proxy.h +28 -0
  11. videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/lb_policy.h +412 -0
  12. videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h +29 -0
  13. videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h +43 -0
  14. videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h +45 -0
  15. videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h +74 -0
  16. videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h +74 -0
  17. videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +454 -0
  18. videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/lb_policy/xds/xds.h +33 -0
  19. videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/lb_policy_factory.h +47 -0
  20. videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/lb_policy_registry.h +65 -0
  21. videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/local_subchannel_pool.h +56 -0
  22. videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/parse_address.h +53 -0
  23. videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/proxy_mapper.h +54 -0
  24. videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/proxy_mapper_registry.h +50 -0
  25. videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/resolver.h +146 -0
  26. videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h +103 -0
  27. videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h +95 -0
  28. videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.h +29 -0
  29. videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h +97 -0
  30. videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/resolver_factory.h +73 -0
  31. videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/resolver_registry.h +89 -0
  32. videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/resolver_result_parsing.h +124 -0
  33. videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/resolving_lb_policy.h +126 -0
  34. videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/retry_throttle.h +77 -0
  35. videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/server_address.h +96 -0
  36. videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/service_config.h +200 -0
  37. videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/subchannel.h +403 -0
  38. videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/subchannel_interface.h +94 -0
  39. videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/subchannel_pool_interface.h +91 -0
  40. videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/xds/xds_api.h +181 -0
  41. videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/xds/xds_bootstrap.h +104 -0
  42. videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/xds/xds_channel.h +44 -0
  43. videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/xds/xds_channel_args.h +26 -0
  44. videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/xds/xds_client.h +226 -0
  45. videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/xds/xds_client_stats.h +232 -0
  46. videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/deadline/deadline_filter.h +90 -0
  47. videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/http/client/http_client_filter.h +31 -0
  48. videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/http/client_authority_filter.h +34 -0
  49. videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/http/message_compress/message_compress_filter.h +53 -0
  50. videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/http/server/http_server_filter.h +29 -0
videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/backend_metric.h ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ //
2
+ // Copyright 2019 gRPC authors.
3
+ //
4
+ // Licensed under the Apache License, Version 2.0 (the "License");
5
+ // you may not use this file except in compliance with the License.
6
+ // You may obtain a copy of the License at
7
+ //
8
+ // http://www.apache.org/licenses/LICENSE-2.0
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
15
+ //
16
+
17
+ #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_BACKEND_METRIC_H
18
+ #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_BACKEND_METRIC_H
19
+
20
+ #include <grpc/support/port_platform.h>
21
+
22
+ #include <grpc/slice.h>
23
+
24
+ #include "src/core/ext/filters/client_channel/lb_policy.h"
25
+ #include "src/core/lib/gprpp/arena.h"
26
+
27
+ namespace grpc_core {
28
+
29
+ // Parses the serialized load report and allocates a BackendMetricData
30
+ // object on the arena.
31
+ const LoadBalancingPolicy::BackendMetricData* ParseBackendMetricData(
32
+ const grpc_slice& serialized_load_report, Arena* arena);
33
+
34
+ } // namespace grpc_core
35
+
36
+ #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_BACKEND_METRIC_H */
videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/backup_poller.h ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ *
3
+ * Copyright 2017 gRPC authors.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ *
17
+ */
18
+
19
+ #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_BACKUP_POLLER_H
20
+ #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_BACKUP_POLLER_H
21
+
22
+ #include <grpc/support/port_platform.h>
23
+
24
+ #include <grpc/grpc.h>
25
+ #include "src/core/lib/channel/channel_stack.h"
26
+ #include "src/core/lib/gprpp/global_config.h"
27
+
28
+ GPR_GLOBAL_CONFIG_DECLARE_INT32(grpc_client_channel_backup_poll_interval_ms);
29
+
30
+ /* Initializes backup polling. */
31
+ void grpc_client_channel_global_init_backup_polling();
32
+
33
+ /* Starts polling \a interested_parties periodically in the timer thread. */
34
+ void grpc_client_channel_start_backup_polling(
35
+ grpc_pollset_set* interested_parties);
36
+
37
+ /* Stops polling \a interested_parties. */
38
+ void grpc_client_channel_stop_backup_polling(
39
+ grpc_pollset_set* interested_parties);
40
+
41
+ #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_BACKUP_POLLER_H */
videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/client_channel.h ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ *
3
+ * Copyright 2015 gRPC authors.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ *
17
+ */
18
+
19
+ #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CLIENT_CHANNEL_H
20
+ #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CLIENT_CHANNEL_H
21
+
22
+ #include <grpc/support/port_platform.h>
23
+
24
+ #include "src/core/ext/filters/client_channel/client_channel_channelz.h"
25
+ #include "src/core/ext/filters/client_channel/client_channel_factory.h"
26
+ #include "src/core/ext/filters/client_channel/resolver.h"
27
+ #include "src/core/lib/channel/channel_stack.h"
28
+
29
+ extern grpc_core::TraceFlag grpc_client_channel_trace;
30
+
31
+ // Channel arg key for server URI string.
32
+ #define GRPC_ARG_SERVER_URI "grpc.server_uri"
33
+
34
+ /* A client channel is a channel that begins disconnected, and can connect
35
+ to some endpoint on demand. If that endpoint disconnects, it will be
36
+ connected to again later.
37
+
38
+ Calls on a disconnected client channel are queued until a connection is
39
+ established. */
40
+
41
+ extern const grpc_channel_filter grpc_client_channel_filter;
42
+
43
+ grpc_connectivity_state grpc_client_channel_check_connectivity_state(
44
+ grpc_channel_element* elem, int try_to_connect);
45
+
46
+ int grpc_client_channel_num_external_connectivity_watchers(
47
+ grpc_channel_element* elem);
48
+
49
+ // Starts a one-time connectivity state watch. When the channel's state
50
+ // becomes different from *state, sets *state to the new state and
51
+ // schedules on_complete. The watcher_timer_init callback is invoked as
52
+ // soon as the watch is actually started (i.e., after hopping into the
53
+ // client channel combiner). I/O will be serviced via pollent.
54
+ //
55
+ // This is intended to be used when starting a watch from outside of C-core
56
+ // via grpc_channel_watch_connectivity_state(). It should not be used
57
+ // by other callers.
58
+ void grpc_client_channel_watch_connectivity_state(
59
+ grpc_channel_element* elem, grpc_polling_entity pollent,
60
+ grpc_connectivity_state* state, grpc_closure* on_complete,
61
+ grpc_closure* watcher_timer_init);
62
+
63
+ // Starts and stops a connectivity watch. The watcher will be initially
64
+ // notified as soon as the state changes from initial_state and then on
65
+ // every subsequent state change until either the watch is stopped or
66
+ // it is notified that the state has changed to SHUTDOWN.
67
+ //
68
+ // This is intended to be used when starting watches from code inside of
69
+ // C-core (e.g., for a nested control plane channel for things like xds).
70
+ void grpc_client_channel_start_connectivity_watch(
71
+ grpc_channel_element* elem, grpc_connectivity_state initial_state,
72
+ grpc_core::OrphanablePtr<grpc_core::AsyncConnectivityStateWatcherInterface>
73
+ watcher);
74
+ void grpc_client_channel_stop_connectivity_watch(
75
+ grpc_channel_element* elem,
76
+ grpc_core::AsyncConnectivityStateWatcherInterface* watcher);
77
+
78
+ /* Debug helper: pull the subchannel call from a call stack element */
79
+ grpc_core::RefCountedPtr<grpc_core::SubchannelCall>
80
+ grpc_client_channel_get_subchannel_call(grpc_call_element* elem);
81
+
82
+ #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CLIENT_CHANNEL_H */
videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/client_channel_channelz.h ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ *
3
+ * Copyright 2018 gRPC authors.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ *
17
+ */
18
+
19
+ #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CLIENT_CHANNEL_CHANNELZ_H
20
+ #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CLIENT_CHANNEL_CHANNELZ_H
21
+
22
+ #include <grpc/support/port_platform.h>
23
+
24
+ #include <string>
25
+
26
+ #include "src/core/lib/channel/channel_args.h"
27
+ #include "src/core/lib/channel/channel_stack.h"
28
+ #include "src/core/lib/channel/channel_trace.h"
29
+ #include "src/core/lib/channel/channelz.h"
30
+
31
+ namespace grpc_core {
32
+
33
+ class Subchannel;
34
+
35
+ namespace channelz {
36
+
37
+ class SubchannelNode : public BaseNode {
38
+ public:
39
+ SubchannelNode(std::string target_address, size_t channel_tracer_max_nodes);
40
+ ~SubchannelNode() override;
41
+
42
+ // Sets the subchannel's connectivity state without health checking.
43
+ void UpdateConnectivityState(grpc_connectivity_state state);
44
+
45
+ // Used when the subchannel's child socket changes. This should be set when
46
+ // the subchannel's transport is created and set to nullptr when the
47
+ // subchannel unrefs the transport.
48
+ void SetChildSocket(RefCountedPtr<SocketNode> socket);
49
+
50
+ grpc_json* RenderJson() override;
51
+
52
+ // proxy methods to composed classes.
53
+ void AddTraceEvent(ChannelTrace::Severity severity, const grpc_slice& data) {
54
+ trace_.AddTraceEvent(severity, data);
55
+ }
56
+ void AddTraceEventWithReference(ChannelTrace::Severity severity,
57
+ const grpc_slice& data,
58
+ RefCountedPtr<BaseNode> referenced_channel) {
59
+ trace_.AddTraceEventWithReference(severity, data,
60
+ std::move(referenced_channel));
61
+ }
62
+ void RecordCallStarted() { call_counter_.RecordCallStarted(); }
63
+ void RecordCallFailed() { call_counter_.RecordCallFailed(); }
64
+ void RecordCallSucceeded() { call_counter_.RecordCallSucceeded(); }
65
+
66
+ private:
67
+ void PopulateConnectivityState(grpc_json* json);
68
+
69
+ Atomic<grpc_connectivity_state> connectivity_state_{GRPC_CHANNEL_IDLE};
70
+ Mutex socket_mu_;
71
+ RefCountedPtr<SocketNode> child_socket_;
72
+ std::string target_;
73
+ CallCountingHelper call_counter_;
74
+ ChannelTrace trace_;
75
+ };
76
+
77
+ } // namespace channelz
78
+ } // namespace grpc_core
79
+
80
+ #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CLIENT_CHANNEL_CHANNELZ_H */
videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/client_channel_factory.h ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ *
3
+ * Copyright 2015 gRPC authors.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ *
17
+ */
18
+
19
+ #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CLIENT_CHANNEL_FACTORY_H
20
+ #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CLIENT_CHANNEL_FACTORY_H
21
+
22
+ #include <grpc/support/port_platform.h>
23
+
24
+ #include <grpc/impl/codegen/grpc_types.h>
25
+
26
+ #include "src/core/ext/filters/client_channel/subchannel.h"
27
+
28
+ namespace grpc_core {
29
+
30
+ class ClientChannelFactory {
31
+ public:
32
+ virtual ~ClientChannelFactory() = default;
33
+
34
+ // Creates a subchannel with the specified args.
35
+ virtual Subchannel* CreateSubchannel(const grpc_channel_args* args) = 0;
36
+
37
+ // Returns a channel arg containing the specified factory.
38
+ static grpc_arg CreateChannelArg(ClientChannelFactory* factory);
39
+
40
+ // Returns the factory from args, or null if not found.
41
+ static ClientChannelFactory* GetFromChannelArgs(
42
+ const grpc_channel_args* args);
43
+ };
44
+
45
+ } // namespace grpc_core
46
+
47
+ #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CLIENT_CHANNEL_FACTORY_H */
videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/connector.h ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ *
3
+ * Copyright 2015 gRPC authors.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ *
17
+ */
18
+
19
+ #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CONNECTOR_H
20
+ #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CONNECTOR_H
21
+
22
+ #include <grpc/support/port_platform.h>
23
+
24
+ #include "src/core/lib/channel/channel_stack.h"
25
+ #include "src/core/lib/channel/channelz.h"
26
+ #include "src/core/lib/gprpp/orphanable.h"
27
+ #include "src/core/lib/iomgr/resolve_address.h"
28
+ #include "src/core/lib/transport/transport.h"
29
+
30
+ namespace grpc_core {
31
+
32
+ // Interface for connection-establishment functionality.
33
+ // Each transport that supports client channels (e.g., not inproc) must
34
+ // supply an implementation of this.
35
+ class SubchannelConnector : public InternallyRefCounted<SubchannelConnector> {
36
+ public:
37
+ struct Args {
38
+ // Set of pollsets interested in this connection.
39
+ grpc_pollset_set* interested_parties;
40
+ // Deadline for connection.
41
+ grpc_millis deadline;
42
+ // Channel args to be passed to handshakers and transport.
43
+ const grpc_channel_args* channel_args;
44
+ };
45
+
46
+ struct Result {
47
+ // The connected transport.
48
+ grpc_transport* transport = nullptr;
49
+ // Channel args to be passed to filters.
50
+ const grpc_channel_args* channel_args = nullptr;
51
+ // Channelz socket node of the connected transport, if any.
52
+ RefCountedPtr<channelz::SocketNode> socket_node;
53
+
54
+ void Reset() {
55
+ transport = nullptr;
56
+ channel_args = nullptr;
57
+ socket_node.reset();
58
+ }
59
+ };
60
+
61
+ // Attempts to connect.
62
+ // When complete, populates *result and invokes notify.
63
+ // Only one connection attempt may be in progress at any one time.
64
+ virtual void Connect(const Args& args, Result* result,
65
+ grpc_closure* notify) = 0;
66
+
67
+ // Cancels any in-flight connection attempt and shuts down the
68
+ // connector.
69
+ virtual void Shutdown(grpc_error* error) = 0;
70
+
71
+ void Orphan() override {
72
+ Shutdown(GRPC_ERROR_CREATE_FROM_STATIC_STRING("Subchannel disconnected"));
73
+ Unref();
74
+ }
75
+ };
76
+
77
+ } // namespace grpc_core
78
+
79
+ #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CONNECTOR_H */
videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/global_subchannel_pool.h ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ *
3
+ * Copyright 2018 gRPC authors.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ *
17
+ */
18
+
19
+ #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_GLOBAL_SUBCHANNEL_POOL_H
20
+ #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_GLOBAL_SUBCHANNEL_POOL_H
21
+
22
+ #include <grpc/support/port_platform.h>
23
+
24
+ #include "src/core/ext/filters/client_channel/subchannel_pool_interface.h"
25
+
26
+ namespace grpc_core {
27
+
28
+ // The global subchannel pool. It shares subchannels among channels. There
29
+ // should be only one instance of this class. Init() should be called once at
30
+ // the filter initialization time; Shutdown() should be called once at the
31
+ // filter shutdown time.
32
+ // TODO(juanlishen): Enable subchannel retention.
33
+ class GlobalSubchannelPool final : public SubchannelPoolInterface {
34
+ public:
35
+ // The ctor and dtor are not intended to use directly.
36
+ GlobalSubchannelPool();
37
+ ~GlobalSubchannelPool() override;
38
+
39
+ // Should be called exactly once at filter initialization time.
40
+ static void Init();
41
+ // Should be called exactly once at filter shutdown time.
42
+ static void Shutdown();
43
+
44
+ // Gets the singleton instance.
45
+ static RefCountedPtr<GlobalSubchannelPool> instance();
46
+
47
+ // Implements interface methods.
48
+ Subchannel* RegisterSubchannel(SubchannelKey* key,
49
+ Subchannel* constructed) override;
50
+ void UnregisterSubchannel(SubchannelKey* key) override;
51
+ Subchannel* FindSubchannel(SubchannelKey* key) override;
52
+
53
+ private:
54
+ // The singleton instance. (It's a pointer to RefCountedPtr so that this
55
+ // non-local static object can be trivially destructible.)
56
+ static RefCountedPtr<GlobalSubchannelPool>* instance_;
57
+
58
+ // The vtable for subchannel operations in an AVL tree.
59
+ static const grpc_avl_vtable subchannel_avl_vtable_;
60
+ // A map from subchannel key to subchannel.
61
+ grpc_avl subchannel_map_;
62
+ // To protect subchannel_map_.
63
+ gpr_mu mu_;
64
+ };
65
+
66
+ } // namespace grpc_core
67
+
68
+ #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_GLOBAL_SUBCHANNEL_POOL_H */
videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/health/health_check_client.h ADDED
@@ -0,0 +1,175 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ *
3
+ * Copyright 2018 gRPC authors.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ *
17
+ */
18
+
19
+ #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_HEALTH_HEALTH_CHECK_CLIENT_H
20
+ #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_HEALTH_HEALTH_CHECK_CLIENT_H
21
+
22
+ #include <grpc/support/port_platform.h>
23
+
24
+ #include <grpc/grpc.h>
25
+ #include <grpc/support/sync.h>
26
+
27
+ #include "src/core/ext/filters/client_channel/client_channel_channelz.h"
28
+ #include "src/core/ext/filters/client_channel/subchannel.h"
29
+ #include "src/core/lib/backoff/backoff.h"
30
+ #include "src/core/lib/gprpp/arena.h"
31
+ #include "src/core/lib/gprpp/atomic.h"
32
+ #include "src/core/lib/gprpp/orphanable.h"
33
+ #include "src/core/lib/gprpp/ref_counted_ptr.h"
34
+ #include "src/core/lib/gprpp/sync.h"
35
+ #include "src/core/lib/iomgr/call_combiner.h"
36
+ #include "src/core/lib/iomgr/closure.h"
37
+ #include "src/core/lib/iomgr/polling_entity.h"
38
+ #include "src/core/lib/iomgr/timer.h"
39
+ #include "src/core/lib/transport/byte_stream.h"
40
+ #include "src/core/lib/transport/metadata_batch.h"
41
+ #include "src/core/lib/transport/transport.h"
42
+
43
+ namespace grpc_core {
44
+
45
+ class HealthCheckClient : public InternallyRefCounted<HealthCheckClient> {
46
+ public:
47
+ HealthCheckClient(const char* service_name,
48
+ RefCountedPtr<ConnectedSubchannel> connected_subchannel,
49
+ grpc_pollset_set* interested_parties,
50
+ RefCountedPtr<channelz::SubchannelNode> channelz_node,
51
+ RefCountedPtr<ConnectivityStateWatcherInterface> watcher);
52
+
53
+ ~HealthCheckClient();
54
+
55
+ void Orphan() override;
56
+
57
+ private:
58
+ // Contains a call to the backend and all the data related to the call.
59
+ class CallState : public Orphanable {
60
+ public:
61
+ CallState(RefCountedPtr<HealthCheckClient> health_check_client,
62
+ grpc_pollset_set* interested_parties_);
63
+ ~CallState();
64
+
65
+ void Orphan() override;
66
+
67
+ void StartCall();
68
+
69
+ private:
70
+ void Cancel();
71
+
72
+ void StartBatch(grpc_transport_stream_op_batch* batch);
73
+ static void StartBatchInCallCombiner(void* arg, grpc_error* error);
74
+
75
+ static void CallEndedRetry(void* arg, grpc_error* error);
76
+ void CallEnded(bool retry);
77
+
78
+ static void OnComplete(void* arg, grpc_error* error);
79
+ static void RecvInitialMetadataReady(void* arg, grpc_error* error);
80
+ static void RecvMessageReady(void* arg, grpc_error* error);
81
+ static void RecvTrailingMetadataReady(void* arg, grpc_error* error);
82
+ static void StartCancel(void* arg, grpc_error* error);
83
+ static void OnCancelComplete(void* arg, grpc_error* error);
84
+
85
+ static void OnByteStreamNext(void* arg, grpc_error* error);
86
+ void ContinueReadingRecvMessage();
87
+ grpc_error* PullSliceFromRecvMessage();
88
+ void DoneReadingRecvMessage(grpc_error* error);
89
+
90
+ static void AfterCallStackDestruction(void* arg, grpc_error* error);
91
+
92
+ RefCountedPtr<HealthCheckClient> health_check_client_;
93
+ grpc_polling_entity pollent_;
94
+
95
+ Arena* arena_;
96
+ grpc_core::CallCombiner call_combiner_;
97
+ grpc_call_context_element context_[GRPC_CONTEXT_COUNT] = {};
98
+
99
+ // The streaming call to the backend. Always non-null.
100
+ // Refs are tracked manually; when the last ref is released, the
101
+ // CallState object will be automatically destroyed.
102
+ SubchannelCall* call_;
103
+
104
+ grpc_transport_stream_op_batch_payload payload_;
105
+ grpc_transport_stream_op_batch batch_;
106
+ grpc_transport_stream_op_batch recv_message_batch_;
107
+ grpc_transport_stream_op_batch recv_trailing_metadata_batch_;
108
+
109
+ grpc_closure on_complete_;
110
+
111
+ // send_initial_metadata
112
+ grpc_metadata_batch send_initial_metadata_;
113
+ grpc_linked_mdelem path_metadata_storage_;
114
+
115
+ // send_message
116
+ ManualConstructor<SliceBufferByteStream> send_message_;
117
+
118
+ // send_trailing_metadata
119
+ grpc_metadata_batch send_trailing_metadata_;
120
+
121
+ // recv_initial_metadata
122
+ grpc_metadata_batch recv_initial_metadata_;
123
+ grpc_closure recv_initial_metadata_ready_;
124
+
125
+ // recv_message
126
+ OrphanablePtr<ByteStream> recv_message_;
127
+ grpc_closure recv_message_ready_;
128
+ grpc_slice_buffer recv_message_buffer_;
129
+ Atomic<bool> seen_response_{false};
130
+
131
+ // recv_trailing_metadata
132
+ grpc_metadata_batch recv_trailing_metadata_;
133
+ grpc_transport_stream_stats collect_stats_;
134
+ grpc_closure recv_trailing_metadata_ready_;
135
+
136
+ // True if the cancel_stream batch has been started.
137
+ Atomic<bool> cancelled_{false};
138
+
139
+ // Closure for call stack destruction.
140
+ grpc_closure after_call_stack_destruction_;
141
+ };
142
+
143
+ void StartCall();
144
+ void StartCallLocked(); // Requires holding mu_.
145
+
146
+ void StartRetryTimer();
147
+ static void OnRetryTimer(void* arg, grpc_error* error);
148
+
149
+ void SetHealthStatus(grpc_connectivity_state state, const char* reason);
150
+ void SetHealthStatusLocked(grpc_connectivity_state state,
151
+ const char* reason); // Requires holding mu_.
152
+
153
+ const char* service_name_; // Do not own.
154
+ RefCountedPtr<ConnectedSubchannel> connected_subchannel_;
155
+ grpc_pollset_set* interested_parties_; // Do not own.
156
+ RefCountedPtr<channelz::SubchannelNode> channelz_node_;
157
+
158
+ Mutex mu_;
159
+ RefCountedPtr<ConnectivityStateWatcherInterface> watcher_;
160
+ bool shutting_down_ = false;
161
+
162
+ // The data associated with the current health check call. It holds a ref
163
+ // to this HealthCheckClient object.
164
+ OrphanablePtr<CallState> call_state_;
165
+
166
+ // Call retry state.
167
+ BackOff retry_backoff_;
168
+ grpc_timer retry_timer_;
169
+ grpc_closure retry_timer_callback_;
170
+ bool retry_timer_callback_pending_ = false;
171
+ };
172
+
173
+ } // namespace grpc_core
174
+
175
+ #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_HEALTH_HEALTH_CHECK_CLIENT_H */
videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/http_connect_handshaker.h ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ *
3
+ * Copyright 2016 gRPC authors.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ *
17
+ */
18
+
19
+ #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_HTTP_CONNECT_HANDSHAKER_H
20
+ #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_HTTP_CONNECT_HANDSHAKER_H
21
+
22
+ /// Channel arg indicating the server in HTTP CONNECT request (string).
23
+ /// The presence of this arg triggers the use of HTTP CONNECT.
24
+ #define GRPC_ARG_HTTP_CONNECT_SERVER "grpc.http_connect_server"
25
+
26
+ /// Channel arg indicating HTTP CONNECT headers (string).
27
+ /// Multiple headers are separated by newlines. Key/value pairs are
28
+ /// separated by colons.
29
+ #define GRPC_ARG_HTTP_CONNECT_HEADERS "grpc.http_connect_headers"
30
+
31
+ /// Registers handshaker factory.
32
+ void grpc_http_connect_register_handshaker_factory();
33
+
34
+ #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_HTTP_CONNECT_HANDSHAKER_H */
videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/http_proxy.h ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ *
3
+ * Copyright 2016 gRPC authors.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ *
17
+ */
18
+
19
+ #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_HTTP_PROXY_H
20
+ #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_HTTP_PROXY_H
21
+
22
+ namespace grpc_core {
23
+
24
+ void RegisterHttpProxyMapper();
25
+
26
+ } // namespace grpc_core
27
+
28
+ #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_HTTP_PROXY_H */
videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/lb_policy.h ADDED
@@ -0,0 +1,412 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ *
3
+ * Copyright 2015 gRPC authors.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ *
17
+ */
18
+
19
+ #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_H
20
+ #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_H
21
+
22
+ #include <grpc/support/port_platform.h>
23
+
24
+ #include <functional>
25
+ #include <iterator>
26
+
27
+ #include "src/core/ext/filters/client_channel/server_address.h"
28
+ #include "src/core/ext/filters/client_channel/service_config.h"
29
+ #include "src/core/ext/filters/client_channel/subchannel_interface.h"
30
+ #include "src/core/lib/gprpp/map.h"
31
+ #include "src/core/lib/gprpp/orphanable.h"
32
+ #include "src/core/lib/gprpp/ref_counted_ptr.h"
33
+ #include "src/core/lib/gprpp/string_view.h"
34
+ #include "src/core/lib/iomgr/combiner.h"
35
+ #include "src/core/lib/iomgr/polling_entity.h"
36
+ #include "src/core/lib/transport/connectivity_state.h"
37
+
38
+ namespace grpc_core {
39
+
40
+ extern DebugOnlyTraceFlag grpc_trace_lb_policy_refcount;
41
+
42
+ /// Interface for load balancing policies.
43
+ ///
44
+ /// The following concepts are used here:
45
+ ///
46
+ /// Channel: An abstraction that manages connections to backend servers
47
+ /// on behalf of a client application. The application creates a channel
48
+ /// for a given server name and then sends calls (RPCs) on it, and the
49
+ /// channel figures out which backend server to send each call to. A channel
50
+ /// contains a resolver, a load balancing policy (or a tree of LB policies),
51
+ /// and a set of one or more subchannels.
52
+ ///
53
+ /// Subchannel: A subchannel represents a connection to one backend server.
54
+ /// The LB policy decides which subchannels to create, manages the
55
+ /// connectivity state of those subchannels, and decides which subchannel
56
+ /// to send any given call to.
57
+ ///
58
+ /// Resolver: A plugin that takes a gRPC server URI and resolves it to a
59
+ /// list of one or more addresses and a service config, as described
60
+ /// in https://github.com/grpc/grpc/blob/master/doc/naming.md. See
61
+ /// resolver.h for the resolver API.
62
+ ///
63
+ /// Load Balancing (LB) Policy: A plugin that takes a list of addresses
64
+ /// from the resolver, maintains and manages a subchannel for each
65
+ /// backend address, and decides which subchannel to send each call on.
66
+ /// An LB policy has two parts:
67
+ /// - A LoadBalancingPolicy, which deals with the control plane work of
68
+ /// managing subchannels.
69
+ /// - A SubchannelPicker, which handles the data plane work of
70
+ /// determining which subchannel a given call should be sent on.
71
+
72
+ /// LoadBalacingPolicy API.
73
+ ///
74
+ /// Note: All methods with a "Locked" suffix must be called from the
75
+ /// combiner passed to the constructor.
76
+ ///
77
+ /// Any I/O done by the LB policy should be done under the pollset_set
78
+ /// returned by \a interested_parties().
79
+ // TODO(roth): Once we move to EventManager-based polling, remove the
80
+ // interested_parties() hooks from the API.
81
+ class LoadBalancingPolicy : public InternallyRefCounted<LoadBalancingPolicy> {
82
+ public:
83
+ // Represents backend metrics reported by the backend to the client.
84
+ struct BackendMetricData {
85
+ /// CPU utilization expressed as a fraction of available CPU resources.
86
+ double cpu_utilization;
87
+ /// Memory utilization expressed as a fraction of available memory
88
+ /// resources.
89
+ double mem_utilization;
90
+ /// Total requests per second being served by the backend. This
91
+ /// should include all services that a backend is responsible for.
92
+ uint64_t requests_per_second;
93
+ /// Application-specific requests cost metrics. Metric names are
94
+ /// determined by the application. Each value is an absolute cost
95
+ /// (e.g. 3487 bytes of storage) associated with the request.
96
+ std::map<StringView, double, StringLess> request_cost;
97
+ /// Application-specific resource utilization metrics. Metric names
98
+ /// are determined by the application. Each value is expressed as a
99
+ /// fraction of total resources available.
100
+ std::map<StringView, double, StringLess> utilization;
101
+ };
102
+
103
+ /// Interface for accessing per-call state.
104
+ /// Implemented by the client channel and used by the SubchannelPicker.
105
+ class CallState {
106
+ public:
107
+ CallState() = default;
108
+ virtual ~CallState() = default;
109
+
110
+ /// Allocates memory associated with the call, which will be
111
+ /// automatically freed when the call is complete.
112
+ /// It is more efficient to use this than to allocate memory directly
113
+ /// for allocations that need to be made on a per-call basis.
114
+ virtual void* Alloc(size_t size) = 0;
115
+
116
+ /// Returns the backend metric data returned by the server for the call,
117
+ /// or null if no backend metric data was returned.
118
+ virtual const BackendMetricData* GetBackendMetricData() = 0;
119
+ };
120
+
121
+ /// Interface for accessing metadata.
122
+ /// Implemented by the client channel and used by the SubchannelPicker.
123
+ class MetadataInterface {
124
+ public:
125
+ class iterator
126
+ : public std::iterator<std::input_iterator_tag,
127
+ std::pair<StringView, StringView>, // value_type
128
+ std::ptrdiff_t, // difference_type
129
+ std::pair<StringView, StringView>*, // pointer
130
+ std::pair<StringView, StringView>& // reference
131
+ > {
132
+ public:
133
+ iterator(const MetadataInterface* md, intptr_t handle)
134
+ : md_(md), handle_(handle) {}
135
+ iterator& operator++() {
136
+ handle_ = md_->IteratorHandleNext(handle_);
137
+ return *this;
138
+ }
139
+ bool operator==(iterator other) const {
140
+ return md_ == other.md_ && handle_ == other.handle_;
141
+ }
142
+ bool operator!=(iterator other) const { return !(*this == other); }
143
+ value_type operator*() const { return md_->IteratorHandleGet(handle_); }
144
+
145
+ private:
146
+ friend class MetadataInterface;
147
+ const MetadataInterface* md_;
148
+ intptr_t handle_;
149
+ };
150
+
151
+ virtual ~MetadataInterface() = default;
152
+
153
+ /// Adds a key/value pair.
154
+ /// Does NOT take ownership of \a key or \a value.
155
+ /// Implementations must ensure that the key and value remain alive
156
+ /// until the call ends. If desired, they may be allocated via
157
+ /// CallState::Alloc().
158
+ virtual void Add(StringView key, StringView value) = 0;
159
+
160
+ /// Iteration interface.
161
+ virtual iterator begin() const = 0;
162
+ virtual iterator end() const = 0;
163
+
164
+ /// Removes the element pointed to by \a it.
165
+ /// Returns an iterator pointing to the next element.
166
+ virtual iterator erase(iterator it) = 0;
167
+
168
+ protected:
169
+ intptr_t GetIteratorHandle(const iterator& it) const { return it.handle_; }
170
+
171
+ private:
172
+ friend class iterator;
173
+
174
+ virtual intptr_t IteratorHandleNext(intptr_t handle) const = 0;
175
+ virtual std::pair<StringView /*key*/, StringView /*value */>
176
+ IteratorHandleGet(intptr_t handle) const = 0;
177
+ };
178
+
179
+ /// Arguments used when picking a subchannel for a call.
180
+ struct PickArgs {
181
+ /// Initial metadata associated with the picking call.
182
+ /// The LB policy may use the existing metadata to influence its routing
183
+ /// decision, and it may add new metadata elements to be sent with the
184
+ /// call to the chosen backend.
185
+ MetadataInterface* initial_metadata;
186
+ /// An interface for accessing call state. Can be used to allocate
187
+ /// data associated with the call in an efficient way.
188
+ CallState* call_state;
189
+ };
190
+
191
+ /// The result of picking a subchannel for a call.
192
+ struct PickResult {
193
+ enum ResultType {
194
+ /// Pick complete. If \a subchannel is non-null, the client channel
195
+ /// will immediately proceed with the call on that subchannel;
196
+ /// otherwise, it will drop the call.
197
+ PICK_COMPLETE,
198
+ /// Pick cannot be completed until something changes on the control
199
+ /// plane. The client channel will queue the pick and try again the
200
+ /// next time the picker is updated.
201
+ PICK_QUEUE,
202
+ /// Pick failed. If the call is wait_for_ready, the client channel
203
+ /// will wait for the next picker and try again; otherwise, it
204
+ /// will immediately fail the call with the status indicated via
205
+ /// \a error (although the call may be retried if the client channel
206
+ /// is configured to do so).
207
+ PICK_FAILED,
208
+ };
209
+ ResultType type;
210
+
211
+ /// Used only if type is PICK_COMPLETE. Will be set to the selected
212
+ /// subchannel, or nullptr if the LB policy decides to drop the call.
213
+ RefCountedPtr<SubchannelInterface> subchannel;
214
+
215
+ /// Used only if type is PICK_FAILED.
216
+ /// Error to be set when returning a failure.
217
+ // TODO(roth): Replace this with something similar to grpc::Status,
218
+ // so that we don't expose grpc_error to this API.
219
+ grpc_error* error = GRPC_ERROR_NONE;
220
+
221
+ /// Used only if type is PICK_COMPLETE.
222
+ /// Callback set by LB policy to be notified of trailing metadata.
223
+ /// If set by LB policy, the client channel will invoke the callback
224
+ /// when trailing metadata is returned.
225
+ /// The metadata may be modified by the callback. However, the callback
226
+ /// does not take ownership, so any data that needs to be used after
227
+ /// returning must be copied.
228
+ /// The call state can be used to obtain backend metric data.
229
+ std::function<void(grpc_error*, MetadataInterface*, CallState*)>
230
+ recv_trailing_metadata_ready;
231
+ };
232
+
233
+ /// A subchannel picker is the object used to pick the subchannel to
234
+ /// use for a given call. This is implemented by the LB policy and
235
+ /// used by the client channel to perform picks.
236
+ ///
237
+ /// Pickers are intended to encapsulate all of the state and logic
238
+ /// needed on the data plane (i.e., to actually process picks for
239
+ /// individual calls sent on the channel) while excluding all of the
240
+ /// state and logic needed on the control plane (i.e., resolver
241
+ /// updates, connectivity state notifications, etc); the latter should
242
+ /// live in the LB policy object itself.
243
+ ///
244
+ /// Currently, pickers are always accessed from within the
245
+ /// client_channel data plane combiner, so they do not have to be
246
+ /// thread-safe.
247
+ class SubchannelPicker {
248
+ public:
249
+ SubchannelPicker() = default;
250
+ virtual ~SubchannelPicker() = default;
251
+
252
+ virtual PickResult Pick(PickArgs args) = 0;
253
+ };
254
+
255
+ /// A proxy object implemented by the client channel and used by the
256
+ /// LB policy to communicate with the channel.
257
+ // TODO(juanlishen): Consider adding a mid-layer subclass that helps handle
258
+ // things like swapping in pending policy when it's ready. Currently, we are
259
+ // duplicating the logic in many subclasses.
260
+ class ChannelControlHelper {
261
+ public:
262
+ ChannelControlHelper() = default;
263
+ virtual ~ChannelControlHelper() = default;
264
+
265
+ /// Creates a new subchannel with the specified channel args.
266
+ virtual RefCountedPtr<SubchannelInterface> CreateSubchannel(
267
+ const grpc_channel_args& args) = 0;
268
+
269
+ /// Sets the connectivity state and returns a new picker to be used
270
+ /// by the client channel.
271
+ virtual void UpdateState(grpc_connectivity_state state,
272
+ std::unique_ptr<SubchannelPicker>) = 0;
273
+
274
+ /// Requests that the resolver re-resolve.
275
+ virtual void RequestReresolution() = 0;
276
+
277
+ /// Adds a trace message associated with the channel.
278
+ enum TraceSeverity { TRACE_INFO, TRACE_WARNING, TRACE_ERROR };
279
+ virtual void AddTraceEvent(TraceSeverity severity, StringView message) = 0;
280
+ };
281
+
282
+ /// Interface for configuration data used by an LB policy implementation.
283
+ /// Individual implementations will create a subclass that adds methods to
284
+ /// return the parameters they need.
285
+ class Config : public RefCounted<Config> {
286
+ public:
287
+ virtual ~Config() = default;
288
+
289
+ // Returns the load balancing policy name
290
+ virtual const char* name() const = 0;
291
+ };
292
+
293
+ /// Data passed to the UpdateLocked() method when new addresses and
294
+ /// config are available.
295
+ struct UpdateArgs {
296
+ ServerAddressList addresses;
297
+ RefCountedPtr<Config> config;
298
+ const grpc_channel_args* args = nullptr;
299
+
300
+ // TODO(roth): Remove everything below once channel args is
301
+ // converted to a copyable and movable C++ object.
302
+ UpdateArgs() = default;
303
+ ~UpdateArgs() { grpc_channel_args_destroy(args); }
304
+ UpdateArgs(const UpdateArgs& other);
305
+ UpdateArgs(UpdateArgs&& other);
306
+ UpdateArgs& operator=(const UpdateArgs& other);
307
+ UpdateArgs& operator=(UpdateArgs&& other);
308
+ };
309
+
310
+ /// Args used to instantiate an LB policy.
311
+ struct Args {
312
+ /// The combiner under which all LB policy calls will be run.
313
+ /// Policy does NOT take ownership of the reference to the combiner.
314
+ // TODO(roth): Once we have a C++-like interface for combiners, this
315
+ // API should change to take a smart pointer that does pass ownership
316
+ // of a reference.
317
+ Combiner* combiner = nullptr;
318
+ /// Channel control helper.
319
+ /// Note: LB policies MUST NOT call any method on the helper from
320
+ /// their constructor.
321
+ std::unique_ptr<ChannelControlHelper> channel_control_helper;
322
+ /// Channel args.
323
+ // TODO(roth): Find a better channel args representation for this API.
324
+ // TODO(roth): Clarify ownership semantics here -- currently, this
325
+ // does not take ownership of args, which is the opposite of how we
326
+ // handle them in UpdateArgs.
327
+ const grpc_channel_args* args = nullptr;
328
+ };
329
+
330
+ explicit LoadBalancingPolicy(Args args, intptr_t initial_refcount = 1);
331
+ virtual ~LoadBalancingPolicy();
332
+
333
+ // Not copyable nor movable.
334
+ LoadBalancingPolicy(const LoadBalancingPolicy&) = delete;
335
+ LoadBalancingPolicy& operator=(const LoadBalancingPolicy&) = delete;
336
+
337
+ /// Returns the name of the LB policy.
338
+ virtual const char* name() const = 0;
339
+
340
+ /// Updates the policy with new data from the resolver. Will be invoked
341
+ /// immediately after LB policy is constructed, and then again whenever
342
+ /// the resolver returns a new result.
343
+ virtual void UpdateLocked(UpdateArgs) = 0; // NOLINT
344
+
345
+ /// Tries to enter a READY connectivity state.
346
+ /// This is a no-op by default, since most LB policies never go into
347
+ /// IDLE state.
348
+ virtual void ExitIdleLocked() {}
349
+
350
+ /// Resets connection backoff.
351
+ virtual void ResetBackoffLocked() = 0;
352
+
353
+ grpc_pollset_set* interested_parties() const { return interested_parties_; }
354
+
355
+ // Note: This must be invoked while holding the combiner.
356
+ void Orphan() override;
357
+
358
+ // A picker that returns PICK_QUEUE for all picks.
359
+ // Also calls the parent LB policy's ExitIdleLocked() method when the
360
+ // first pick is seen.
361
+ class QueuePicker : public SubchannelPicker {
362
+ public:
363
+ explicit QueuePicker(RefCountedPtr<LoadBalancingPolicy> parent)
364
+ : parent_(std::move(parent)) {}
365
+
366
+ ~QueuePicker() { parent_.reset(DEBUG_LOCATION, "QueuePicker"); }
367
+
368
+ PickResult Pick(PickArgs args) override;
369
+
370
+ private:
371
+ static void CallExitIdle(void* arg, grpc_error* error);
372
+
373
+ RefCountedPtr<LoadBalancingPolicy> parent_;
374
+ bool exit_idle_called_ = false;
375
+ };
376
+
377
+ // A picker that returns PICK_TRANSIENT_FAILURE for all picks.
378
+ class TransientFailurePicker : public SubchannelPicker {
379
+ public:
380
+ explicit TransientFailurePicker(grpc_error* error) : error_(error) {}
381
+ ~TransientFailurePicker() override { GRPC_ERROR_UNREF(error_); }
382
+
383
+ PickResult Pick(PickArgs args) override;
384
+
385
+ private:
386
+ grpc_error* error_;
387
+ };
388
+
389
+ protected:
390
+ Combiner* combiner() const { return combiner_; }
391
+
392
+ // Note: LB policies MUST NOT call any method on the helper from their
393
+ // constructor.
394
+ ChannelControlHelper* channel_control_helper() const {
395
+ return channel_control_helper_.get();
396
+ }
397
+
398
+ /// Shuts down the policy.
399
+ virtual void ShutdownLocked() = 0;
400
+
401
+ private:
402
+ /// Combiner under which LB policy actions take place.
403
+ Combiner* combiner_;
404
+ /// Owned pointer to interested parties in load balancing decisions.
405
+ grpc_pollset_set* interested_parties_;
406
+ /// Channel control helper.
407
+ std::unique_ptr<ChannelControlHelper> channel_control_helper_;
408
+ };
409
+
410
+ } // namespace grpc_core
411
+
412
+ #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_H */
videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ *
3
+ * Copyright 2017 gRPC authors.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ *
17
+ */
18
+
19
+ #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_GRPCLB_CLIENT_LOAD_REPORTING_FILTER_H
20
+ #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_GRPCLB_CLIENT_LOAD_REPORTING_FILTER_H
21
+
22
+ #include <grpc/support/port_platform.h>
23
+
24
+ #include "src/core/lib/channel/channel_stack.h"
25
+
26
+ extern const grpc_channel_filter grpc_client_load_reporting_filter;
27
+
28
+ #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_GRPCLB_CLIENT_LOAD_REPORTING_FILTER_H \
29
+ */
videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ *
3
+ * Copyright 2018 gRPC authors.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ *
17
+ */
18
+
19
+ #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_GRPCLB_GRPCLB_H
20
+ #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_GRPCLB_GRPCLB_H
21
+
22
+ #include <grpc/support/port_platform.h>
23
+
24
+ /** Channel arg indicating if a target corresponding to the address is grpclb
25
+ * loadbalancer. The type of this arg is an integer and the value is treated as
26
+ * a bool. */
27
+ #define GRPC_ARG_ADDRESS_IS_GRPCLB_LOAD_BALANCER \
28
+ "grpc.address_is_grpclb_load_balancer"
29
+ /** Channel arg indicating if a target corresponding to the address is a backend
30
+ * received from a balancer. The type of this arg is an integer and the value is
31
+ * treated as a bool. */
32
+ #define GRPC_ARG_ADDRESS_IS_BACKEND_FROM_GRPCLB_LOAD_BALANCER \
33
+ "grpc.address_is_backend_from_grpclb_load_balancer"
34
+
35
+ namespace grpc_core {
36
+
37
+ extern const char kGrpcLbClientStatsMetadataKey[];
38
+ extern const char kGrpcLbLbTokenMetadataKey[];
39
+
40
+ } // namespace grpc_core
41
+
42
+ #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_GRPCLB_GRPCLB_H \
43
+ */
videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ *
3
+ * Copyright 2017 gRPC authors.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ *
17
+ */
18
+
19
+ #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_GRPCLB_GRPCLB_CHANNEL_H
20
+ #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_GRPCLB_GRPCLB_CHANNEL_H
21
+
22
+ #include <grpc/support/port_platform.h>
23
+
24
+ #include <grpc/impl/codegen/grpc_types.h>
25
+
26
+ #include "src/core/ext/filters/client_channel/server_address.h"
27
+
28
+ namespace grpc_core {
29
+
30
+ /// Makes any necessary modifications to \a args for use in the grpclb
31
+ /// balancer channel.
32
+ ///
33
+ /// Takes ownership of \a args.
34
+ ///
35
+ /// Caller takes ownership of the returned args.
36
+ grpc_channel_args* ModifyGrpclbBalancerChannelArgs(
37
+ const ServerAddressList& addresses, grpc_channel_args* args);
38
+
39
+ grpc_channel* CreateGrpclbBalancerChannel(const char* target_uri,
40
+ const grpc_channel_args& args);
41
+
42
+ } // namespace grpc_core
43
+
44
+ #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_GRPCLB_GRPCLB_CHANNEL_H \
45
+ */
videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ *
3
+ * Copyright 2017 gRPC authors.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ *
17
+ */
18
+
19
+ #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_GRPCLB_GRPCLB_CLIENT_STATS_H
20
+ #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_GRPCLB_GRPCLB_CLIENT_STATS_H
21
+
22
+ #include <grpc/support/port_platform.h>
23
+
24
+ #include <grpc/support/atm.h>
25
+
26
+ #include "src/core/lib/gprpp/inlined_vector.h"
27
+ #include "src/core/lib/gprpp/memory.h"
28
+ #include "src/core/lib/gprpp/ref_counted.h"
29
+ #include "src/core/lib/gprpp/sync.h"
30
+
31
+ namespace grpc_core {
32
+
33
+ class GrpcLbClientStats : public RefCounted<GrpcLbClientStats> {
34
+ public:
35
+ struct DropTokenCount {
36
+ grpc_core::UniquePtr<char> token;
37
+ int64_t count;
38
+
39
+ DropTokenCount(grpc_core::UniquePtr<char> token, int64_t count)
40
+ : token(std::move(token)), count(count) {}
41
+ };
42
+
43
+ typedef InlinedVector<DropTokenCount, 10> DroppedCallCounts;
44
+
45
+ void AddCallStarted();
46
+ void AddCallFinished(bool finished_with_client_failed_to_send,
47
+ bool finished_known_received);
48
+
49
+ void AddCallDropped(const char* token);
50
+
51
+ void Get(int64_t* num_calls_started, int64_t* num_calls_finished,
52
+ int64_t* num_calls_finished_with_client_failed_to_send,
53
+ int64_t* num_calls_finished_known_received,
54
+ std::unique_ptr<DroppedCallCounts>* drop_token_counts);
55
+
56
+ // A destruction function to use as the user_data key when attaching
57
+ // client stats to a grpc_mdelem.
58
+ static void Destroy(void* arg) {
59
+ static_cast<GrpcLbClientStats*>(arg)->Unref();
60
+ }
61
+
62
+ private:
63
+ gpr_atm num_calls_started_ = 0;
64
+ gpr_atm num_calls_finished_ = 0;
65
+ gpr_atm num_calls_finished_with_client_failed_to_send_ = 0;
66
+ gpr_atm num_calls_finished_known_received_ = 0;
67
+ Mutex drop_count_mu_; // Guards drop_token_counts_.
68
+ std::unique_ptr<DroppedCallCounts> drop_token_counts_;
69
+ };
70
+
71
+ } // namespace grpc_core
72
+
73
+ #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_GRPCLB_GRPCLB_CLIENT_STATS_H \
74
+ */
videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ *
3
+ * Copyright 2016 gRPC authors.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ *
17
+ */
18
+
19
+ #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_GRPCLB_LOAD_BALANCER_API_H
20
+ #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_GRPCLB_LOAD_BALANCER_API_H
21
+
22
+ #include <grpc/support/port_platform.h>
23
+
24
+ #include <vector>
25
+
26
+ #include <grpc/slice_buffer.h>
27
+
28
+ #include "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h"
29
+ #include "src/core/lib/iomgr/exec_ctx.h"
30
+ #include "src/proto/grpc/lb/v1/load_balancer.upb.h"
31
+
32
+ #define GRPC_GRPCLB_SERVICE_NAME_MAX_LENGTH 128
33
+ #define GRPC_GRPCLB_SERVER_IP_ADDRESS_MAX_SIZE 16
34
+ #define GRPC_GRPCLB_SERVER_LOAD_BALANCE_TOKEN_MAX_SIZE 50
35
+
36
+ namespace grpc_core {
37
+
38
+ // Contains server information. When the drop field is not true, use the other
39
+ // fields.
40
+ struct GrpcLbServer {
41
+ int32_t ip_size;
42
+ char ip_addr[GRPC_GRPCLB_SERVER_IP_ADDRESS_MAX_SIZE];
43
+ int32_t port;
44
+ char load_balance_token[GRPC_GRPCLB_SERVER_LOAD_BALANCE_TOKEN_MAX_SIZE];
45
+ bool drop;
46
+
47
+ bool operator==(const GrpcLbServer& other) const;
48
+ };
49
+
50
+ struct GrpcLbResponse {
51
+ enum { INITIAL, SERVERLIST, FALLBACK } type;
52
+ grpc_millis client_stats_report_interval = 0;
53
+ std::vector<GrpcLbServer> serverlist;
54
+ };
55
+
56
+ // Creates a serialized grpclb request.
57
+ grpc_slice GrpcLbRequestCreate(const char* lb_service_name, upb_arena* arena);
58
+
59
+ // Creates a serialized grpclb load report request.
60
+ grpc_slice GrpcLbLoadReportRequestCreate(
61
+ int64_t num_calls_started, int64_t num_calls_finished,
62
+ int64_t num_calls_finished_with_client_failed_to_send,
63
+ int64_t num_calls_finished_known_received,
64
+ const GrpcLbClientStats::DroppedCallCounts* drop_token_counts,
65
+ upb_arena* arena);
66
+
67
+ // Deserialize a grpclb response.
68
+ bool GrpcLbResponseParse(const grpc_slice& serialized_response,
69
+ upb_arena* arena, GrpcLbResponse* response);
70
+
71
+ } // namespace grpc_core
72
+
73
+ #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_GRPCLB_LOAD_BALANCER_API_H \
74
+ */
videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h ADDED
@@ -0,0 +1,454 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ *
3
+ * Copyright 2015 gRPC authors.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ *
17
+ */
18
+
19
+ #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_SUBCHANNEL_LIST_H
20
+ #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_SUBCHANNEL_LIST_H
21
+
22
+ #include <grpc/support/port_platform.h>
23
+
24
+ #include <string.h>
25
+
26
+ #include <grpc/support/alloc.h>
27
+
28
+ #include "src/core/ext/filters/client_channel/lb_policy_registry.h"
29
+ #include "src/core/ext/filters/client_channel/server_address.h"
30
+ // TODO(roth): Should not need the include of subchannel.h here, since
31
+ // that implementation should be hidden from the LB policy API.
32
+ #include "src/core/ext/filters/client_channel/subchannel.h"
33
+ #include "src/core/ext/filters/client_channel/subchannel_interface.h"
34
+ #include "src/core/lib/channel/channel_args.h"
35
+ #include "src/core/lib/debug/trace.h"
36
+ #include "src/core/lib/gprpp/inlined_vector.h"
37
+ #include "src/core/lib/gprpp/orphanable.h"
38
+ #include "src/core/lib/gprpp/ref_counted.h"
39
+ #include "src/core/lib/gprpp/ref_counted_ptr.h"
40
+ #include "src/core/lib/iomgr/closure.h"
41
+ #include "src/core/lib/iomgr/sockaddr_utils.h"
42
+ #include "src/core/lib/transport/connectivity_state.h"
43
+
44
+ // Code for maintaining a list of subchannels within an LB policy.
45
+ //
46
+ // To use this, callers must create their own subclasses, like so:
47
+ /*
48
+
49
+ class MySubchannelList; // Forward declaration.
50
+
51
+ class MySubchannelData
52
+ : public SubchannelData<MySubchannelList, MySubchannelData> {
53
+ public:
54
+ void ProcessConnectivityChangeLocked(
55
+ grpc_connectivity_state connectivity_state) override {
56
+ // ...code to handle connectivity changes...
57
+ }
58
+ };
59
+
60
+ class MySubchannelList
61
+ : public SubchannelList<MySubchannelList, MySubchannelData> {
62
+ };
63
+
64
+ */
65
+ // All methods will be called from within the client_channel combiner.
66
+
67
+ namespace grpc_core {
68
+
69
+ // Forward declaration.
70
+ template <typename SubchannelListType, typename SubchannelDataType>
71
+ class SubchannelList;
72
+
73
+ // Stores data for a particular subchannel in a subchannel list.
74
+ // Callers must create a subclass that implements the
75
+ // ProcessConnectivityChangeLocked() method.
76
+ template <typename SubchannelListType, typename SubchannelDataType>
77
+ class SubchannelData {
78
+ public:
79
+ // Returns a pointer to the subchannel list containing this object.
80
+ SubchannelListType* subchannel_list() const {
81
+ return static_cast<SubchannelListType*>(subchannel_list_);
82
+ }
83
+
84
+ // Returns the index into the subchannel list of this object.
85
+ size_t Index() const {
86
+ return static_cast<size_t>(static_cast<const SubchannelDataType*>(this) -
87
+ subchannel_list_->subchannel(0));
88
+ }
89
+
90
+ // Returns a pointer to the subchannel.
91
+ SubchannelInterface* subchannel() const { return subchannel_.get(); }
92
+
93
+ // Synchronously checks the subchannel's connectivity state.
94
+ // Must not be called while there is a connectivity notification
95
+ // pending (i.e., between calling StartConnectivityWatchLocked() and
96
+ // calling CancelConnectivityWatchLocked()).
97
+ grpc_connectivity_state CheckConnectivityStateLocked() {
98
+ GPR_ASSERT(pending_watcher_ == nullptr);
99
+ connectivity_state_ = subchannel_->CheckConnectivityState();
100
+ return connectivity_state_;
101
+ }
102
+
103
+ // Resets the connection backoff.
104
+ // TODO(roth): This method should go away when we move the backoff
105
+ // code out of the subchannel and into the LB policies.
106
+ void ResetBackoffLocked();
107
+
108
+ // Starts watching the connectivity state of the subchannel.
109
+ // ProcessConnectivityChangeLocked() will be called whenever the
110
+ // connectivity state changes.
111
+ void StartConnectivityWatchLocked();
112
+
113
+ // Cancels watching the connectivity state of the subchannel.
114
+ void CancelConnectivityWatchLocked(const char* reason);
115
+
116
+ // Cancels any pending connectivity watch and unrefs the subchannel.
117
+ void ShutdownLocked();
118
+
119
+ protected:
120
+ SubchannelData(
121
+ SubchannelList<SubchannelListType, SubchannelDataType>* subchannel_list,
122
+ const ServerAddress& address,
123
+ RefCountedPtr<SubchannelInterface> subchannel);
124
+
125
+ virtual ~SubchannelData();
126
+
127
+ // After StartConnectivityWatchLocked() is called, this method will be
128
+ // invoked whenever the subchannel's connectivity state changes.
129
+ // To stop watching, use CancelConnectivityWatchLocked().
130
+ virtual void ProcessConnectivityChangeLocked(
131
+ grpc_connectivity_state connectivity_state) = 0;
132
+
133
+ private:
134
+ // Watcher for subchannel connectivity state.
135
+ class Watcher
136
+ : public SubchannelInterface::ConnectivityStateWatcherInterface {
137
+ public:
138
+ Watcher(
139
+ SubchannelData<SubchannelListType, SubchannelDataType>* subchannel_data,
140
+ RefCountedPtr<SubchannelListType> subchannel_list)
141
+ : subchannel_data_(subchannel_data),
142
+ subchannel_list_(std::move(subchannel_list)) {}
143
+
144
+ ~Watcher() { subchannel_list_.reset(DEBUG_LOCATION, "Watcher dtor"); }
145
+
146
+ void OnConnectivityStateChange(grpc_connectivity_state new_state) override;
147
+
148
+ grpc_pollset_set* interested_parties() override {
149
+ return subchannel_list_->policy()->interested_parties();
150
+ }
151
+
152
+ private:
153
+ SubchannelData<SubchannelListType, SubchannelDataType>* subchannel_data_;
154
+ RefCountedPtr<SubchannelListType> subchannel_list_;
155
+ };
156
+
157
+ // Unrefs the subchannel.
158
+ void UnrefSubchannelLocked(const char* reason);
159
+
160
+ // Backpointer to owning subchannel list. Not owned.
161
+ SubchannelList<SubchannelListType, SubchannelDataType>* subchannel_list_;
162
+ // The subchannel.
163
+ RefCountedPtr<SubchannelInterface> subchannel_;
164
+ // Will be non-null when the subchannel's state is being watched.
165
+ SubchannelInterface::ConnectivityStateWatcherInterface* pending_watcher_ =
166
+ nullptr;
167
+ // Data updated by the watcher.
168
+ grpc_connectivity_state connectivity_state_;
169
+ };
170
+
171
+ // A list of subchannels.
172
+ template <typename SubchannelListType, typename SubchannelDataType>
173
+ class SubchannelList : public InternallyRefCounted<SubchannelListType> {
174
+ public:
175
+ typedef InlinedVector<SubchannelDataType, 10> SubchannelVector;
176
+
177
+ // The number of subchannels in the list.
178
+ size_t num_subchannels() const { return subchannels_.size(); }
179
+
180
+ // The data for the subchannel at a particular index.
181
+ SubchannelDataType* subchannel(size_t index) { return &subchannels_[index]; }
182
+
183
+ // Returns true if the subchannel list is shutting down.
184
+ bool shutting_down() const { return shutting_down_; }
185
+
186
+ // Accessors.
187
+ LoadBalancingPolicy* policy() const { return policy_; }
188
+ TraceFlag* tracer() const { return tracer_; }
189
+
190
+ // Resets connection backoff of all subchannels.
191
+ // TODO(roth): We will probably need to rethink this as part of moving
192
+ // the backoff code out of subchannels and into LB policies.
193
+ void ResetBackoffLocked();
194
+
195
+ void Orphan() override {
196
+ ShutdownLocked();
197
+ InternallyRefCounted<SubchannelListType>::Unref(DEBUG_LOCATION, "shutdown");
198
+ }
199
+
200
+ protected:
201
+ SubchannelList(LoadBalancingPolicy* policy, TraceFlag* tracer,
202
+ const ServerAddressList& addresses,
203
+ LoadBalancingPolicy::ChannelControlHelper* helper,
204
+ const grpc_channel_args& args);
205
+
206
+ virtual ~SubchannelList();
207
+
208
+ private:
209
+ // For accessing Ref() and Unref().
210
+ friend class SubchannelData<SubchannelListType, SubchannelDataType>;
211
+
212
+ void ShutdownLocked();
213
+
214
+ // Backpointer to owning policy.
215
+ LoadBalancingPolicy* policy_;
216
+
217
+ TraceFlag* tracer_;
218
+
219
+ // The list of subchannels.
220
+ SubchannelVector subchannels_;
221
+
222
+ // Is this list shutting down? This may be true due to the shutdown of the
223
+ // policy itself or because a newer update has arrived while this one hadn't
224
+ // finished processing.
225
+ bool shutting_down_ = false;
226
+ };
227
+
228
+ //
229
+ // implementation -- no user-servicable parts below
230
+ //
231
+
232
+ //
233
+ // SubchannelData::Watcher
234
+ //
235
+
236
+ template <typename SubchannelListType, typename SubchannelDataType>
237
+ void SubchannelData<SubchannelListType, SubchannelDataType>::Watcher::
238
+ OnConnectivityStateChange(grpc_connectivity_state new_state) {
239
+ if (GRPC_TRACE_FLAG_ENABLED(*subchannel_list_->tracer())) {
240
+ gpr_log(GPR_INFO,
241
+ "[%s %p] subchannel list %p index %" PRIuPTR " of %" PRIuPTR
242
+ " (subchannel %p): connectivity changed: state=%s, "
243
+ "shutting_down=%d, pending_watcher=%p",
244
+ subchannel_list_->tracer()->name(), subchannel_list_->policy(),
245
+ subchannel_list_.get(), subchannel_data_->Index(),
246
+ subchannel_list_->num_subchannels(),
247
+ subchannel_data_->subchannel_.get(),
248
+ ConnectivityStateName(new_state), subchannel_list_->shutting_down(),
249
+ subchannel_data_->pending_watcher_);
250
+ }
251
+ if (!subchannel_list_->shutting_down() &&
252
+ subchannel_data_->pending_watcher_ != nullptr) {
253
+ subchannel_data_->connectivity_state_ = new_state;
254
+ // Call the subclass's ProcessConnectivityChangeLocked() method.
255
+ subchannel_data_->ProcessConnectivityChangeLocked(new_state);
256
+ }
257
+ }
258
+
259
+ //
260
+ // SubchannelData
261
+ //
262
+
263
+ template <typename SubchannelListType, typename SubchannelDataType>
264
+ SubchannelData<SubchannelListType, SubchannelDataType>::SubchannelData(
265
+ SubchannelList<SubchannelListType, SubchannelDataType>* subchannel_list,
266
+ const ServerAddress& /*address*/,
267
+ RefCountedPtr<SubchannelInterface> subchannel)
268
+ : subchannel_list_(subchannel_list),
269
+ subchannel_(std::move(subchannel)),
270
+ // We assume that the current state is IDLE. If not, we'll get a
271
+ // callback telling us that.
272
+ connectivity_state_(GRPC_CHANNEL_IDLE) {}
273
+
274
+ template <typename SubchannelListType, typename SubchannelDataType>
275
+ SubchannelData<SubchannelListType, SubchannelDataType>::~SubchannelData() {
276
+ GPR_ASSERT(subchannel_ == nullptr);
277
+ }
278
+
279
+ template <typename SubchannelListType, typename SubchannelDataType>
280
+ void SubchannelData<SubchannelListType, SubchannelDataType>::
281
+ UnrefSubchannelLocked(const char* reason) {
282
+ if (subchannel_ != nullptr) {
283
+ if (GRPC_TRACE_FLAG_ENABLED(*subchannel_list_->tracer())) {
284
+ gpr_log(GPR_INFO,
285
+ "[%s %p] subchannel list %p index %" PRIuPTR " of %" PRIuPTR
286
+ " (subchannel %p): unreffing subchannel (%s)",
287
+ subchannel_list_->tracer()->name(), subchannel_list_->policy(),
288
+ subchannel_list_, Index(), subchannel_list_->num_subchannels(),
289
+ subchannel_.get(), reason);
290
+ }
291
+ subchannel_.reset();
292
+ }
293
+ }
294
+
295
+ template <typename SubchannelListType, typename SubchannelDataType>
296
+ void SubchannelData<SubchannelListType,
297
+ SubchannelDataType>::ResetBackoffLocked() {
298
+ if (subchannel_ != nullptr) {
299
+ subchannel_->ResetBackoff();
300
+ }
301
+ }
302
+
303
+ template <typename SubchannelListType, typename SubchannelDataType>
304
+ void SubchannelData<SubchannelListType,
305
+ SubchannelDataType>::StartConnectivityWatchLocked() {
306
+ if (GRPC_TRACE_FLAG_ENABLED(*subchannel_list_->tracer())) {
307
+ gpr_log(GPR_INFO,
308
+ "[%s %p] subchannel list %p index %" PRIuPTR " of %" PRIuPTR
309
+ " (subchannel %p): starting watch (from %s)",
310
+ subchannel_list_->tracer()->name(), subchannel_list_->policy(),
311
+ subchannel_list_, Index(), subchannel_list_->num_subchannels(),
312
+ subchannel_.get(), ConnectivityStateName(connectivity_state_));
313
+ }
314
+ GPR_ASSERT(pending_watcher_ == nullptr);
315
+ pending_watcher_ =
316
+ new Watcher(this, subchannel_list()->Ref(DEBUG_LOCATION, "Watcher"));
317
+ subchannel_->WatchConnectivityState(
318
+ connectivity_state_,
319
+ std::unique_ptr<SubchannelInterface::ConnectivityStateWatcherInterface>(
320
+ pending_watcher_));
321
+ }
322
+
323
+ template <typename SubchannelListType, typename SubchannelDataType>
324
+ void SubchannelData<SubchannelListType, SubchannelDataType>::
325
+ CancelConnectivityWatchLocked(const char* reason) {
326
+ if (GRPC_TRACE_FLAG_ENABLED(*subchannel_list_->tracer())) {
327
+ gpr_log(GPR_INFO,
328
+ "[%s %p] subchannel list %p index %" PRIuPTR " of %" PRIuPTR
329
+ " (subchannel %p): canceling connectivity watch (%s)",
330
+ subchannel_list_->tracer()->name(), subchannel_list_->policy(),
331
+ subchannel_list_, Index(), subchannel_list_->num_subchannels(),
332
+ subchannel_.get(), reason);
333
+ }
334
+ if (pending_watcher_ != nullptr) {
335
+ subchannel_->CancelConnectivityStateWatch(pending_watcher_);
336
+ pending_watcher_ = nullptr;
337
+ }
338
+ }
339
+
340
+ template <typename SubchannelListType, typename SubchannelDataType>
341
+ void SubchannelData<SubchannelListType, SubchannelDataType>::ShutdownLocked() {
342
+ if (pending_watcher_ != nullptr) CancelConnectivityWatchLocked("shutdown");
343
+ UnrefSubchannelLocked("shutdown");
344
+ }
345
+
346
+ //
347
+ // SubchannelList
348
+ //
349
+
350
+ template <typename SubchannelListType, typename SubchannelDataType>
351
+ SubchannelList<SubchannelListType, SubchannelDataType>::SubchannelList(
352
+ LoadBalancingPolicy* policy, TraceFlag* tracer,
353
+ const ServerAddressList& addresses,
354
+ LoadBalancingPolicy::ChannelControlHelper* helper,
355
+ const grpc_channel_args& args)
356
+ : InternallyRefCounted<SubchannelListType>(tracer),
357
+ policy_(policy),
358
+ tracer_(tracer) {
359
+ if (GRPC_TRACE_FLAG_ENABLED(*tracer_)) {
360
+ gpr_log(GPR_INFO,
361
+ "[%s %p] Creating subchannel list %p for %" PRIuPTR " subchannels",
362
+ tracer_->name(), policy, this, addresses.size());
363
+ }
364
+ subchannels_.reserve(addresses.size());
365
+ // We need to remove the LB addresses in order to be able to compare the
366
+ // subchannel keys of subchannels from a different batch of addresses.
367
+ // We remove the service config, since it will be passed into the
368
+ // subchannel via call context.
369
+ static const char* keys_to_remove[] = {GRPC_ARG_SUBCHANNEL_ADDRESS,
370
+ GRPC_ARG_SERVICE_CONFIG};
371
+ // Create a subchannel for each address.
372
+ for (size_t i = 0; i < addresses.size(); i++) {
373
+ // TODO(roth): we should ideally hide this from the LB policy code. In
374
+ // principle, if we're dealing with this special case in the client_channel
375
+ // code for selecting grpclb, then we should also strip out these addresses
376
+ // there if we're not using grpclb.
377
+ if (addresses[i].IsBalancer()) {
378
+ continue;
379
+ }
380
+ InlinedVector<grpc_arg, 3> args_to_add;
381
+ const size_t subchannel_address_arg_index = args_to_add.size();
382
+ args_to_add.emplace_back(
383
+ Subchannel::CreateSubchannelAddressArg(&addresses[i].address()));
384
+ if (addresses[i].args() != nullptr) {
385
+ for (size_t j = 0; j < addresses[i].args()->num_args; ++j) {
386
+ args_to_add.emplace_back(addresses[i].args()->args[j]);
387
+ }
388
+ }
389
+ grpc_channel_args* new_args = grpc_channel_args_copy_and_add_and_remove(
390
+ &args, keys_to_remove, GPR_ARRAY_SIZE(keys_to_remove),
391
+ args_to_add.data(), args_to_add.size());
392
+ gpr_free(args_to_add[subchannel_address_arg_index].value.string);
393
+ RefCountedPtr<SubchannelInterface> subchannel =
394
+ helper->CreateSubchannel(*new_args);
395
+ grpc_channel_args_destroy(new_args);
396
+ if (subchannel == nullptr) {
397
+ // Subchannel could not be created.
398
+ if (GRPC_TRACE_FLAG_ENABLED(*tracer_)) {
399
+ char* address_uri = grpc_sockaddr_to_uri(&addresses[i].address());
400
+ gpr_log(GPR_INFO,
401
+ "[%s %p] could not create subchannel for address uri %s, "
402
+ "ignoring",
403
+ tracer_->name(), policy_, address_uri);
404
+ gpr_free(address_uri);
405
+ }
406
+ continue;
407
+ }
408
+ if (GRPC_TRACE_FLAG_ENABLED(*tracer_)) {
409
+ char* address_uri = grpc_sockaddr_to_uri(&addresses[i].address());
410
+ gpr_log(GPR_INFO,
411
+ "[%s %p] subchannel list %p index %" PRIuPTR
412
+ ": Created subchannel %p for address uri %s",
413
+ tracer_->name(), policy_, this, subchannels_.size(),
414
+ subchannel.get(), address_uri);
415
+ gpr_free(address_uri);
416
+ }
417
+ subchannels_.emplace_back(this, addresses[i], std::move(subchannel));
418
+ }
419
+ }
420
+
421
+ template <typename SubchannelListType, typename SubchannelDataType>
422
+ SubchannelList<SubchannelListType, SubchannelDataType>::~SubchannelList() {
423
+ if (GRPC_TRACE_FLAG_ENABLED(*tracer_)) {
424
+ gpr_log(GPR_INFO, "[%s %p] Destroying subchannel_list %p", tracer_->name(),
425
+ policy_, this);
426
+ }
427
+ }
428
+
429
+ template <typename SubchannelListType, typename SubchannelDataType>
430
+ void SubchannelList<SubchannelListType, SubchannelDataType>::ShutdownLocked() {
431
+ if (GRPC_TRACE_FLAG_ENABLED(*tracer_)) {
432
+ gpr_log(GPR_INFO, "[%s %p] Shutting down subchannel_list %p",
433
+ tracer_->name(), policy_, this);
434
+ }
435
+ GPR_ASSERT(!shutting_down_);
436
+ shutting_down_ = true;
437
+ for (size_t i = 0; i < subchannels_.size(); i++) {
438
+ SubchannelDataType* sd = &subchannels_[i];
439
+ sd->ShutdownLocked();
440
+ }
441
+ }
442
+
443
+ template <typename SubchannelListType, typename SubchannelDataType>
444
+ void SubchannelList<SubchannelListType,
445
+ SubchannelDataType>::ResetBackoffLocked() {
446
+ for (size_t i = 0; i < subchannels_.size(); i++) {
447
+ SubchannelDataType* sd = &subchannels_[i];
448
+ sd->ResetBackoffLocked();
449
+ }
450
+ }
451
+
452
+ } // namespace grpc_core
453
+
454
+ #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_SUBCHANNEL_LIST_H */
videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/lb_policy/xds/xds.h ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ *
3
+ * Copyright 2018 gRPC authors.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ *
17
+ */
18
+
19
+ #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_XDS_XDS_H
20
+ #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_XDS_XDS_H
21
+
22
+ #include <grpc/support/port_platform.h>
23
+
24
+ /** Channel arg indicating if a target corresponding to the address is a backend
25
+ * received from a balancer. The type of this arg is an integer and the value is
26
+ * treated as a bool. */
27
+ // TODO(roth): Depending on how we ultimately decide to handle fallback,
28
+ // this may no longer be needed.
29
+ #define GRPC_ARG_ADDRESS_IS_BACKEND_FROM_XDS_LOAD_BALANCER \
30
+ "grpc.address_is_backend_from_xds_load_balancer"
31
+
32
+ #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_XDS_XDS_H \
33
+ */
videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/lb_policy_factory.h ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ *
3
+ * Copyright 2015 gRPC authors.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ *
17
+ */
18
+
19
+ #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_FACTORY_H
20
+ #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_FACTORY_H
21
+
22
+ #include <grpc/support/port_platform.h>
23
+
24
+ #include "src/core/ext/filters/client_channel/lb_policy.h"
25
+ #include "src/core/lib/gprpp/orphanable.h"
26
+
27
+ namespace grpc_core {
28
+
29
+ class LoadBalancingPolicyFactory {
30
+ public:
31
+ /// Returns a new LB policy instance.
32
+ virtual OrphanablePtr<LoadBalancingPolicy> CreateLoadBalancingPolicy(
33
+ LoadBalancingPolicy::Args) const = 0;
34
+
35
+ /// Returns the LB policy name that this factory provides.
36
+ /// Caller does NOT take ownership of result.
37
+ virtual const char* name() const = 0;
38
+
39
+ virtual RefCountedPtr<LoadBalancingPolicy::Config> ParseLoadBalancingConfig(
40
+ const grpc_json* json, grpc_error** error) const = 0;
41
+
42
+ virtual ~LoadBalancingPolicyFactory() {}
43
+ };
44
+
45
+ } // namespace grpc_core
46
+
47
+ #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_FACTORY_H */
videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/lb_policy_registry.h ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ *
3
+ * Copyright 2015 gRPC authors.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ *
17
+ */
18
+
19
+ #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_REGISTRY_H
20
+ #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_REGISTRY_H
21
+
22
+ #include <grpc/support/port_platform.h>
23
+
24
+ #include "src/core/ext/filters/client_channel/lb_policy_factory.h"
25
+ #include "src/core/lib/gprpp/memory.h"
26
+ #include "src/core/lib/gprpp/orphanable.h"
27
+
28
+ namespace grpc_core {
29
+
30
+ class LoadBalancingPolicyRegistry {
31
+ public:
32
+ /// Methods used to create and populate the LoadBalancingPolicyRegistry.
33
+ /// NOT THREAD SAFE -- to be used only during global gRPC
34
+ /// initialization and shutdown.
35
+ class Builder {
36
+ public:
37
+ /// Global initialization and shutdown hooks.
38
+ static void InitRegistry();
39
+ static void ShutdownRegistry();
40
+
41
+ /// Registers an LB policy factory. The factory will be used to create an
42
+ /// LB policy whose name matches that of the factory.
43
+ static void RegisterLoadBalancingPolicyFactory(
44
+ std::unique_ptr<LoadBalancingPolicyFactory> factory);
45
+ };
46
+
47
+ /// Creates an LB policy of the type specified by \a name.
48
+ static OrphanablePtr<LoadBalancingPolicy> CreateLoadBalancingPolicy(
49
+ const char* name, LoadBalancingPolicy::Args args);
50
+
51
+ /// Returns true if the LB policy factory specified by \a name exists in this
52
+ /// registry. If the load balancing policy requires a config to be specified
53
+ /// then sets \a requires_config to true.
54
+ static bool LoadBalancingPolicyExists(const char* name,
55
+ bool* requires_config);
56
+
57
+ /// Returns a parsed object of the load balancing policy to be used from a
58
+ /// LoadBalancingConfig array \a json.
59
+ static RefCountedPtr<LoadBalancingPolicy::Config> ParseLoadBalancingConfig(
60
+ const grpc_json* json, grpc_error** error);
61
+ };
62
+
63
+ } // namespace grpc_core
64
+
65
+ #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_REGISTRY_H */
videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/local_subchannel_pool.h ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ *
3
+ * Copyright 2018 gRPC authors.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ *
17
+ */
18
+
19
+ #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LOCAL_SUBCHANNEL_POOL_H
20
+ #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LOCAL_SUBCHANNEL_POOL_H
21
+
22
+ #include <grpc/support/port_platform.h>
23
+
24
+ #include "src/core/ext/filters/client_channel/subchannel_pool_interface.h"
25
+
26
+ namespace grpc_core {
27
+
28
+ // The local subchannel pool that is owned by a single channel. It doesn't
29
+ // support subchannel sharing with other channels by nature. Nor does it support
30
+ // subchannel retention when a subchannel is not used. The only real purpose of
31
+ // using this subchannel pool is to allow subchannel reuse within the channel
32
+ // when an incoming resolver update contains some addresses for which the
33
+ // channel has already created subchannels.
34
+ // Thread-unsafe.
35
+ class LocalSubchannelPool final : public SubchannelPoolInterface {
36
+ public:
37
+ LocalSubchannelPool();
38
+ ~LocalSubchannelPool() override;
39
+
40
+ // Implements interface methods.
41
+ // Thread-unsafe. Intended to be invoked within the client_channel combiner.
42
+ Subchannel* RegisterSubchannel(SubchannelKey* key,
43
+ Subchannel* constructed) override;
44
+ void UnregisterSubchannel(SubchannelKey* key) override;
45
+ Subchannel* FindSubchannel(SubchannelKey* key) override;
46
+
47
+ private:
48
+ // The vtable for subchannel operations in an AVL tree.
49
+ static const grpc_avl_vtable subchannel_avl_vtable_;
50
+ // A map from subchannel key to subchannel.
51
+ grpc_avl subchannel_map_;
52
+ };
53
+
54
+ } // namespace grpc_core
55
+
56
+ #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LOCAL_SUBCHANNEL_POOL_H */
videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/parse_address.h ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ *
3
+ * Copyright 2015 gRPC authors.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ *
17
+ */
18
+
19
+ #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_PARSE_ADDRESS_H
20
+ #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_PARSE_ADDRESS_H
21
+
22
+ #include <grpc/support/port_platform.h>
23
+
24
+ #include <stddef.h>
25
+
26
+ #include "src/core/lib/iomgr/resolve_address.h"
27
+ #include "src/core/lib/uri/uri_parser.h"
28
+
29
+ /** Populate \a resolved_addr from \a uri, whose path is expected to contain a
30
+ * unix socket path. Returns true upon success. */
31
+ bool grpc_parse_unix(const grpc_uri* uri, grpc_resolved_address* resolved_addr);
32
+
33
+ /** Populate \a resolved_addr from \a uri, whose path is expected to contain an
34
+ * IPv4 host:port pair. Returns true upon success. */
35
+ bool grpc_parse_ipv4(const grpc_uri* uri, grpc_resolved_address* resolved_addr);
36
+
37
+ /** Populate \a resolved_addr from \a uri, whose path is expected to contain an
38
+ * IPv6 host:port pair. Returns true upon success. */
39
+ bool grpc_parse_ipv6(const grpc_uri* uri, grpc_resolved_address* resolved_addr);
40
+
41
+ /** Populate \a resolved_addr from \a uri. Returns true upon success. */
42
+ bool grpc_parse_uri(const grpc_uri* uri, grpc_resolved_address* resolved_addr);
43
+
44
+ /** Parse bare IPv4 or IPv6 "IP:port" strings. */
45
+ bool grpc_parse_ipv4_hostport(const char* hostport, grpc_resolved_address* addr,
46
+ bool log_errors);
47
+ bool grpc_parse_ipv6_hostport(const char* hostport, grpc_resolved_address* addr,
48
+ bool log_errors);
49
+
50
+ /* Converts named or numeric port to a uint16 suitable for use in a sockaddr. */
51
+ uint16_t grpc_strhtons(const char* port);
52
+
53
+ #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_PARSE_ADDRESS_H */
videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/proxy_mapper.h ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ *
3
+ * Copyright 2017 gRPC authors.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ *
17
+ */
18
+
19
+ #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_PROXY_MAPPER_H
20
+ #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_PROXY_MAPPER_H
21
+
22
+ #include <grpc/support/port_platform.h>
23
+
24
+ #include <grpc/impl/codegen/grpc_types.h>
25
+
26
+ #include "src/core/lib/iomgr/resolve_address.h"
27
+
28
+ namespace grpc_core {
29
+
30
+ class ProxyMapperInterface {
31
+ public:
32
+ virtual ~ProxyMapperInterface() = default;
33
+
34
+ /// Determines the proxy name to resolve for \a server_uri.
35
+ /// If no proxy is needed, returns false.
36
+ /// Otherwise, sets \a name_to_resolve, optionally sets \a new_args,
37
+ /// and returns true.
38
+ virtual bool MapName(const char* server_uri, const grpc_channel_args* args,
39
+ char** name_to_resolve,
40
+ grpc_channel_args** new_args) = 0;
41
+
42
+ /// Determines the proxy address to use to contact \a address.
43
+ /// If no proxy is needed, returns false.
44
+ /// Otherwise, sets \a new_address, optionally sets \a new_args, and
45
+ /// returns true.
46
+ virtual bool MapAddress(const grpc_resolved_address& address,
47
+ const grpc_channel_args* args,
48
+ grpc_resolved_address** new_address,
49
+ grpc_channel_args** new_args) = 0;
50
+ };
51
+
52
+ } // namespace grpc_core
53
+
54
+ #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_PROXY_MAPPER_H */
videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/proxy_mapper_registry.h ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ *
3
+ * Copyright 2017 gRPC authors.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ *
17
+ */
18
+
19
+ #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_PROXY_MAPPER_REGISTRY_H
20
+ #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_PROXY_MAPPER_REGISTRY_H
21
+
22
+ #include <grpc/support/port_platform.h>
23
+
24
+ #include "src/core/ext/filters/client_channel/proxy_mapper.h"
25
+
26
+ namespace grpc_core {
27
+
28
+ class ProxyMapperRegistry {
29
+ public:
30
+ static void Init();
31
+ static void Shutdown();
32
+
33
+ /// Registers a new proxy mapper.
34
+ /// If \a at_start is true, the new mapper will be at the beginning of
35
+ /// the list. Otherwise, it will be added to the end.
36
+ static void Register(bool at_start,
37
+ std::unique_ptr<ProxyMapperInterface> mapper);
38
+
39
+ static bool MapName(const char* server_uri, const grpc_channel_args* args,
40
+ char** name_to_resolve, grpc_channel_args** new_args);
41
+
42
+ static bool MapAddress(const grpc_resolved_address& address,
43
+ const grpc_channel_args* args,
44
+ grpc_resolved_address** new_address,
45
+ grpc_channel_args** new_args);
46
+ };
47
+
48
+ } // namespace grpc_core
49
+
50
+ #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_PROXY_MAPPER_REGISTRY_H */
videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/resolver.h ADDED
@@ -0,0 +1,146 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ *
3
+ * Copyright 2015 gRPC authors.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ *
17
+ */
18
+
19
+ #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_H
20
+ #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_H
21
+
22
+ #include <grpc/support/port_platform.h>
23
+
24
+ #include <grpc/impl/codegen/grpc_types.h>
25
+
26
+ #include "src/core/ext/filters/client_channel/server_address.h"
27
+ #include "src/core/ext/filters/client_channel/service_config.h"
28
+ #include "src/core/lib/gprpp/orphanable.h"
29
+ #include "src/core/lib/gprpp/ref_counted_ptr.h"
30
+ #include "src/core/lib/iomgr/combiner.h"
31
+ #include "src/core/lib/iomgr/iomgr.h"
32
+
33
+ extern grpc_core::DebugOnlyTraceFlag grpc_trace_resolver_refcount;
34
+
35
+ namespace grpc_core {
36
+
37
+ /// Interface for name resolution.
38
+ ///
39
+ /// This interface is designed to support both push-based and pull-based
40
+ /// mechanisms. A push-based mechanism is one where the resolver will
41
+ /// subscribe to updates for a given name, and the name service will
42
+ /// proactively send new data to the resolver whenever the data associated
43
+ /// with the name changes. A pull-based mechanism is one where the resolver
44
+ /// needs to query the name service again to get updated information (e.g.,
45
+ /// DNS).
46
+ ///
47
+ /// Note: All methods with a "Locked" suffix must be called from the
48
+ /// combiner passed to the constructor.
49
+ class Resolver : public InternallyRefCounted<Resolver> {
50
+ public:
51
+ /// Results returned by the resolver.
52
+ struct Result {
53
+ ServerAddressList addresses;
54
+ RefCountedPtr<ServiceConfig> service_config;
55
+ grpc_error* service_config_error = GRPC_ERROR_NONE;
56
+ const grpc_channel_args* args = nullptr;
57
+
58
+ // TODO(roth): Remove everything below once grpc_error and
59
+ // grpc_channel_args are convert to copyable and movable C++ objects.
60
+ Result() = default;
61
+ ~Result();
62
+ Result(const Result& other);
63
+ Result(Result&& other);
64
+ Result& operator=(const Result& other);
65
+ Result& operator=(Result&& other);
66
+ };
67
+
68
+ /// A proxy object used by the resolver to return results to the
69
+ /// client channel.
70
+ class ResultHandler {
71
+ public:
72
+ virtual ~ResultHandler() {}
73
+
74
+ /// Returns a result to the channel.
75
+ /// Takes ownership of \a result.args.
76
+ virtual void ReturnResult(Result result) = 0; // NOLINT
77
+
78
+ /// Returns a transient error to the channel.
79
+ /// If the resolver does not set the GRPC_ERROR_INT_GRPC_STATUS
80
+ /// attribute on the error, calls will be failed with status UNKNOWN.
81
+ virtual void ReturnError(grpc_error* error) = 0;
82
+
83
+ // TODO(yashkt): As part of the service config error handling
84
+ // changes, add a method to parse the service config JSON string.
85
+ };
86
+
87
+ // Not copyable nor movable.
88
+ Resolver(const Resolver&) = delete;
89
+ Resolver& operator=(const Resolver&) = delete;
90
+ virtual ~Resolver();
91
+
92
+ /// Starts resolving.
93
+ virtual void StartLocked() = 0;
94
+
95
+ /// Asks the resolver to obtain an updated resolver result, if
96
+ /// applicable.
97
+ ///
98
+ /// This is useful for pull-based implementations to decide when to
99
+ /// re-resolve. However, the implementation is not required to
100
+ /// re-resolve immediately upon receiving this call; it may instead
101
+ /// elect to delay based on some configured minimum time between
102
+ /// queries, to avoid hammering the name service with queries.
103
+ ///
104
+ /// For push-based implementations, this may be a no-op.
105
+ ///
106
+ /// Note: Implementations must not invoke any method on the
107
+ /// ResultHandler from within this call.
108
+ virtual void RequestReresolutionLocked() {}
109
+
110
+ /// Resets the re-resolution backoff, if any.
111
+ /// This needs to be implemented only by pull-based implementations;
112
+ /// for push-based implementations, it will be a no-op.
113
+ /// TODO(roth): Pull the backoff code out of resolver and into
114
+ /// client_channel, so that it can be shared across resolver
115
+ /// implementations. At that point, this method can go away.
116
+ virtual void ResetBackoffLocked() {}
117
+
118
+ // Note: This must be invoked while holding the combiner.
119
+ void Orphan() override {
120
+ ShutdownLocked();
121
+ Unref();
122
+ }
123
+
124
+ protected:
125
+ /// Does NOT take ownership of the reference to \a combiner.
126
+ // TODO(roth): Once we have a C++-like interface for combiners, this
127
+ // API should change to take a RefCountedPtr<>, so that we always take
128
+ // ownership of a new ref.
129
+ explicit Resolver(Combiner* combiner,
130
+ std::unique_ptr<ResultHandler> result_handler);
131
+
132
+ /// Shuts down the resolver.
133
+ virtual void ShutdownLocked() = 0;
134
+
135
+ Combiner* combiner() const { return combiner_; }
136
+
137
+ ResultHandler* result_handler() const { return result_handler_.get(); }
138
+
139
+ private:
140
+ std::unique_ptr<ResultHandler> result_handler_;
141
+ Combiner* combiner_;
142
+ };
143
+
144
+ } // namespace grpc_core
145
+
146
+ #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_H */
videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h ADDED
@@ -0,0 +1,103 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ *
3
+ * Copyright 2016 gRPC authors.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ *
17
+ */
18
+
19
+ #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_DNS_C_ARES_GRPC_ARES_EV_DRIVER_H
20
+ #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_DNS_C_ARES_GRPC_ARES_EV_DRIVER_H
21
+
22
+ #include <grpc/support/port_platform.h>
23
+
24
+ #include <ares.h>
25
+ #include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h"
26
+ #include "src/core/lib/iomgr/pollset_set.h"
27
+
28
+ typedef struct grpc_ares_ev_driver grpc_ares_ev_driver;
29
+
30
+ /* Start \a ev_driver. It will keep working until all IO on its ares_channel is
31
+ done, or grpc_ares_ev_driver_destroy() is called. It may notify the callbacks
32
+ bound to its ares_channel when necessary. */
33
+ void grpc_ares_ev_driver_start_locked(grpc_ares_ev_driver* ev_driver);
34
+
35
+ /* Returns the ares_channel owned by \a ev_driver. To bind a c-ares query to
36
+ \a ev_driver, use the ares_channel owned by \a ev_driver as the arg of the
37
+ query. */
38
+ ares_channel* grpc_ares_ev_driver_get_channel_locked(
39
+ grpc_ares_ev_driver* ev_driver);
40
+
41
+ /* Creates a new grpc_ares_ev_driver. Returns GRPC_ERROR_NONE if \a ev_driver is
42
+ created successfully. */
43
+ grpc_error* grpc_ares_ev_driver_create_locked(grpc_ares_ev_driver** ev_driver,
44
+ grpc_pollset_set* pollset_set,
45
+ int query_timeout_ms,
46
+ grpc_core::Combiner* combiner,
47
+ grpc_ares_request* request);
48
+
49
+ /* Called back when all DNS lookups have completed. */
50
+ void grpc_ares_ev_driver_on_queries_complete_locked(
51
+ grpc_ares_ev_driver* ev_driver);
52
+
53
+ /* Shutdown all the grpc_fds used by \a ev_driver */
54
+ void grpc_ares_ev_driver_shutdown_locked(grpc_ares_ev_driver* ev_driver);
55
+
56
+ /* Exposed in this header for C-core tests only */
57
+ extern void (*grpc_ares_test_only_inject_config)(ares_channel channel);
58
+
59
+ namespace grpc_core {
60
+
61
+ /* A wrapped fd that integrates with the grpc iomgr of the current platform.
62
+ * A GrpcPolledFd knows how to create grpc platform-specific iomgr endpoints
63
+ * from "ares_socket_t" sockets, and then sign up for readability/writeability
64
+ * with that poller, and do shutdown and destruction. */
65
+ class GrpcPolledFd {
66
+ public:
67
+ virtual ~GrpcPolledFd() {}
68
+ /* Called when c-ares library is interested and there's no pending callback */
69
+ virtual void RegisterForOnReadableLocked(grpc_closure* read_closure) = 0;
70
+ /* Called when c-ares library is interested and there's no pending callback */
71
+ virtual void RegisterForOnWriteableLocked(grpc_closure* write_closure) = 0;
72
+ /* Indicates if there is data left even after just being read from */
73
+ virtual bool IsFdStillReadableLocked() = 0;
74
+ /* Called once and only once. Must cause cancellation of any pending
75
+ * read/write callbacks. */
76
+ virtual void ShutdownLocked(grpc_error* error) = 0;
77
+ /* Get the underlying ares_socket_t that this was created from */
78
+ virtual ares_socket_t GetWrappedAresSocketLocked() = 0;
79
+ /* A unique name, for logging */
80
+ virtual const char* GetName() = 0;
81
+ };
82
+
83
+ /* A GrpcPolledFdFactory is 1-to-1 with and owned by the
84
+ * ares event driver. It knows how to create GrpcPolledFd's
85
+ * for the current platform, and the ares driver uses it for all of
86
+ * its fd's. */
87
+ class GrpcPolledFdFactory {
88
+ public:
89
+ virtual ~GrpcPolledFdFactory() {}
90
+ /* Creates a new wrapped fd for the current platform */
91
+ virtual GrpcPolledFd* NewGrpcPolledFdLocked(
92
+ ares_socket_t as, grpc_pollset_set* driver_pollset_set,
93
+ Combiner* combiner) = 0;
94
+ /* Optionally configures the ares channel after creation */
95
+ virtual void ConfigureAresChannelLocked(ares_channel channel) = 0;
96
+ };
97
+
98
+ std::unique_ptr<GrpcPolledFdFactory> NewGrpcPolledFdFactory(Combiner* combiner);
99
+
100
+ } // namespace grpc_core
101
+
102
+ #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_DNS_C_ARES_GRPC_ARES_EV_DRIVER_H \
103
+ */
videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ *
3
+ * Copyright 2016 gRPC authors.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ *
17
+ */
18
+
19
+ #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_DNS_C_ARES_GRPC_ARES_WRAPPER_H
20
+ #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_DNS_C_ARES_GRPC_ARES_WRAPPER_H
21
+
22
+ #include <grpc/support/port_platform.h>
23
+
24
+ #include "src/core/ext/filters/client_channel/server_address.h"
25
+ #include "src/core/lib/iomgr/iomgr.h"
26
+ #include "src/core/lib/iomgr/polling_entity.h"
27
+ #include "src/core/lib/iomgr/resolve_address.h"
28
+
29
+ #define GRPC_DNS_ARES_DEFAULT_QUERY_TIMEOUT_MS 120000
30
+
31
+ extern grpc_core::TraceFlag grpc_trace_cares_address_sorting;
32
+
33
+ extern grpc_core::TraceFlag grpc_trace_cares_resolver;
34
+
35
+ #define GRPC_CARES_TRACE_LOG(format, ...) \
36
+ do { \
37
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_cares_resolver)) { \
38
+ gpr_log(GPR_DEBUG, "(c-ares resolver) " format, __VA_ARGS__); \
39
+ } \
40
+ } while (0)
41
+
42
+ typedef struct grpc_ares_request grpc_ares_request;
43
+
44
+ /* Asynchronously resolve \a name. Use \a default_port if a port isn't
45
+ designated in \a name, otherwise use the port in \a name. grpc_ares_init()
46
+ must be called at least once before this function. \a on_done may be
47
+ called directly in this function without being scheduled with \a exec_ctx,
48
+ so it must not try to acquire locks that are being held by the caller. */
49
+ extern void (*grpc_resolve_address_ares)(const char* name,
50
+ const char* default_port,
51
+ grpc_pollset_set* interested_parties,
52
+ grpc_closure* on_done,
53
+ grpc_resolved_addresses** addresses);
54
+
55
+ /* Asynchronously resolve \a name. It will try to resolve grpclb SRV records in
56
+ addition to the normal address records. For normal address records, it uses
57
+ \a default_port if a port isn't designated in \a name, otherwise it uses the
58
+ port in \a name. grpc_ares_init() must be called at least once before this
59
+ function. \a on_done may be called directly in this function without being
60
+ scheduled with \a exec_ctx, so it must not try to acquire locks that are
61
+ being held by the caller. The returned grpc_ares_request object is owned
62
+ by the caller and it is safe to free after on_done is called back. */
63
+ extern grpc_ares_request* (*grpc_dns_lookup_ares_locked)(
64
+ const char* dns_server, const char* name, const char* default_port,
65
+ grpc_pollset_set* interested_parties, grpc_closure* on_done,
66
+ std::unique_ptr<grpc_core::ServerAddressList>* addresses, bool check_grpclb,
67
+ char** service_config_json, int query_timeout_ms,
68
+ grpc_core::Combiner* combiner);
69
+
70
+ /* Cancel the pending grpc_ares_request \a request */
71
+ extern void (*grpc_cancel_ares_request_locked)(grpc_ares_request* request);
72
+
73
+ /* Initialize gRPC ares wrapper. Must be called at least once before
74
+ grpc_resolve_address_ares(). */
75
+ grpc_error* grpc_ares_init(void);
76
+
77
+ /* Uninitialized gRPC ares wrapper. If there was more than one previous call to
78
+ grpc_ares_init(), this function uninitializes the gRPC ares wrapper only if
79
+ it has been called the same number of times as grpc_ares_init(). */
80
+ void grpc_ares_cleanup(void);
81
+
82
+ /** Schedules the desired callback for request completion
83
+ * and destroys the grpc_ares_request */
84
+ void grpc_ares_complete_request_locked(grpc_ares_request* request);
85
+
86
+ /* Indicates whether or not AAAA queries should be attempted. */
87
+ /* E.g., return false if ipv6 is known to not be available. */
88
+ bool grpc_ares_query_ipv6();
89
+
90
+ /* Sorts destinations in lb_addrs according to RFC 6724. */
91
+ void grpc_cares_wrapper_address_sorting_sort(
92
+ grpc_core::ServerAddressList* addresses);
93
+
94
+ #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_DNS_C_ARES_GRPC_ARES_WRAPPER_H \
95
+ */
videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.h ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ *
3
+ * Copyright 2019 gRPC authors.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ *
17
+ */
18
+
19
+ #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_DNS_DNS_RESOLVER_SELECTION_H
20
+ #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_DNS_DNS_RESOLVER_SELECTION_H
21
+
22
+ #include <grpc/support/port_platform.h>
23
+
24
+ #include "src/core/lib/gprpp/global_config.h"
25
+
26
+ GPR_GLOBAL_CONFIG_DECLARE_STRING(grpc_dns_resolver);
27
+
28
+ #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_DNS_DNS_RESOLVER_SELECTION_H \
29
+ */
videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ //
2
+ // Copyright 2016 gRPC authors.
3
+ //
4
+ // Licensed under the Apache License, Version 2.0 (the "License");
5
+ // you may not use this file except in compliance with the License.
6
+ // You may obtain a copy of the License at
7
+ //
8
+ // http://www.apache.org/licenses/LICENSE-2.0
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
15
+ //
16
+
17
+ #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_FAKE_FAKE_RESOLVER_H
18
+ #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_FAKE_FAKE_RESOLVER_H
19
+
20
+ #include <grpc/support/port_platform.h>
21
+
22
+ #include "src/core/ext/filters/client_channel/resolver.h"
23
+ #include "src/core/lib/channel/channel_args.h"
24
+ #include "src/core/lib/gprpp/ref_counted.h"
25
+ #include "src/core/lib/iomgr/error.h"
26
+
27
+ #define GRPC_ARG_FAKE_RESOLVER_RESPONSE_GENERATOR \
28
+ "grpc.fake_resolver.response_generator"
29
+
30
+ namespace grpc_core {
31
+
32
+ class FakeResolver;
33
+
34
+ /// A mechanism for generating responses for the fake resolver.
35
+ /// An instance of this class is passed to the fake resolver via a channel
36
+ /// argument (see \a MakeChannelArg()) and used to inject and trigger custom
37
+ /// resolutions.
38
+ // TODO(roth): I would ideally like this to be InternallyRefCounted
39
+ // instead of RefCounted, but external refs are currently needed to
40
+ // encode this in channel args. Once channel_args are converted to C++,
41
+ // see if we can find a way to fix this.
42
+ class FakeResolverResponseGenerator
43
+ : public RefCounted<FakeResolverResponseGenerator> {
44
+ public:
45
+ FakeResolverResponseGenerator();
46
+ ~FakeResolverResponseGenerator();
47
+
48
+ // Instructs the fake resolver associated with the response generator
49
+ // instance to trigger a new resolution with the specified result. If the
50
+ // resolver is not available yet, delays response setting until it is. This
51
+ // can be called at most once before the resolver is available.
52
+ void SetResponse(Resolver::Result result);
53
+
54
+ // Sets the re-resolution response, which is returned by the fake resolver
55
+ // when re-resolution is requested (via \a RequestReresolutionLocked()).
56
+ // The new re-resolution response replaces any previous re-resolution
57
+ // response that may have been set by a previous call.
58
+ void SetReresolutionResponse(Resolver::Result result);
59
+
60
+ // Unsets the re-resolution response. After this, the fake resolver will
61
+ // not return anything when \a RequestReresolutionLocked() is called.
62
+ void UnsetReresolutionResponse();
63
+
64
+ // Tells the resolver to return a transient failure.
65
+ void SetFailure();
66
+
67
+ // Same as SetFailure(), but instead of returning the error
68
+ // immediately, waits for the next call to RequestReresolutionLocked().
69
+ void SetFailureOnReresolution();
70
+
71
+ // Returns a channel arg containing \a generator.
72
+ static grpc_arg MakeChannelArg(FakeResolverResponseGenerator* generator);
73
+
74
+ // Returns the response generator in \a args, or null if not found.
75
+ static RefCountedPtr<FakeResolverResponseGenerator> GetFromArgs(
76
+ const grpc_channel_args* args);
77
+
78
+ private:
79
+ friend class FakeResolver;
80
+ // Set the corresponding FakeResolver to this generator.
81
+ void SetFakeResolver(RefCountedPtr<FakeResolver> resolver);
82
+
83
+ static void SetResponseLocked(void* arg, grpc_error* error);
84
+ static void SetReresolutionResponseLocked(void* arg, grpc_error* error);
85
+ static void SetFailureLocked(void* arg, grpc_error* error);
86
+
87
+ // Mutex protecting the members below.
88
+ Mutex mu_;
89
+ RefCountedPtr<FakeResolver> resolver_;
90
+ Resolver::Result result_;
91
+ bool has_result_ = false;
92
+ };
93
+
94
+ } // namespace grpc_core
95
+
96
+ #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_FAKE_FAKE_RESOLVER_H \
97
+ */
videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/resolver_factory.h ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ *
3
+ * Copyright 2015 gRPC authors.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ *
17
+ */
18
+
19
+ #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_FACTORY_H
20
+ #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_FACTORY_H
21
+
22
+ #include <grpc/support/port_platform.h>
23
+
24
+ #include <grpc/support/string_util.h>
25
+
26
+ #include "src/core/ext/filters/client_channel/resolver.h"
27
+ #include "src/core/lib/gprpp/memory.h"
28
+ #include "src/core/lib/gprpp/orphanable.h"
29
+ #include "src/core/lib/iomgr/pollset_set.h"
30
+ #include "src/core/lib/uri/uri_parser.h"
31
+
32
+ namespace grpc_core {
33
+
34
+ struct ResolverArgs {
35
+ /// The parsed URI to resolve.
36
+ grpc_uri* uri = nullptr;
37
+ /// Channel args to be included in resolver results.
38
+ const grpc_channel_args* args = nullptr;
39
+ /// Used to drive I/O in the name resolution process.
40
+ grpc_pollset_set* pollset_set = nullptr;
41
+ /// The combiner under which all resolver calls will be run.
42
+ Combiner* combiner = nullptr;
43
+ /// The result handler to be used by the resolver.
44
+ std::unique_ptr<Resolver::ResultHandler> result_handler;
45
+ };
46
+
47
+ class ResolverFactory {
48
+ public:
49
+ /// Returns a bool indicating whether the input uri is valid to create a
50
+ /// resolver.
51
+ virtual bool IsValidUri(const grpc_uri* uri) const = 0;
52
+
53
+ /// Returns a new resolver instance.
54
+ virtual OrphanablePtr<Resolver> CreateResolver(ResolverArgs args) const = 0;
55
+
56
+ /// Returns a string representing the default authority to use for this
57
+ /// scheme.
58
+ virtual grpc_core::UniquePtr<char> GetDefaultAuthority(grpc_uri* uri) const {
59
+ const char* path = uri->path;
60
+ if (path[0] == '/') ++path;
61
+ return grpc_core::UniquePtr<char>(gpr_strdup(path));
62
+ }
63
+
64
+ /// Returns the URI scheme that this factory implements.
65
+ /// Caller does NOT take ownership of result.
66
+ virtual const char* scheme() const = 0;
67
+
68
+ virtual ~ResolverFactory() {}
69
+ };
70
+
71
+ } // namespace grpc_core
72
+
73
+ #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_FACTORY_H */
videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/resolver_registry.h ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ *
3
+ * Copyright 2015 gRPC authors.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ *
17
+ */
18
+
19
+ #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_REGISTRY_H
20
+ #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_REGISTRY_H
21
+
22
+ #include <grpc/support/port_platform.h>
23
+
24
+ #include "src/core/ext/filters/client_channel/resolver_factory.h"
25
+ #include "src/core/lib/gprpp/inlined_vector.h"
26
+ #include "src/core/lib/gprpp/memory.h"
27
+ #include "src/core/lib/gprpp/orphanable.h"
28
+ #include "src/core/lib/iomgr/pollset_set.h"
29
+
30
+ namespace grpc_core {
31
+
32
+ class ResolverRegistry {
33
+ public:
34
+ /// Methods used to create and populate the ResolverRegistry.
35
+ /// NOT THREAD SAFE -- to be used only during global gRPC
36
+ /// initialization and shutdown.
37
+ class Builder {
38
+ public:
39
+ /// Global initialization and shutdown hooks.
40
+ static void InitRegistry();
41
+ static void ShutdownRegistry();
42
+
43
+ /// Sets the default URI prefix to \a default_prefix.
44
+ /// Calls InitRegistry() if it has not already been called.
45
+ static void SetDefaultPrefix(const char* default_prefix);
46
+
47
+ /// Registers a resolver factory. The factory will be used to create a
48
+ /// resolver for any URI whose scheme matches that of the factory.
49
+ /// Calls InitRegistry() if it has not already been called.
50
+ static void RegisterResolverFactory(
51
+ std::unique_ptr<ResolverFactory> factory);
52
+ };
53
+
54
+ /// Checks whether the user input \a target is valid to create a resolver.
55
+ static bool IsValidTarget(const char* target);
56
+
57
+ /// Creates a resolver given \a target.
58
+ /// First tries to parse \a target as a URI. If this succeeds, tries
59
+ /// to locate a registered resolver factory based on the URI scheme.
60
+ /// If parsing fails or there is no factory for the URI's scheme,
61
+ /// prepends default_prefix to target and tries again.
62
+ /// If a resolver factory is found, uses it to instantiate a resolver and
63
+ /// returns it; otherwise, returns nullptr.
64
+ /// \a args, \a pollset_set, and \a combiner are passed to the factory's
65
+ /// \a CreateResolver() method.
66
+ /// \a args are the channel args to be included in resolver results.
67
+ /// \a pollset_set is used to drive I/O in the name resolution process.
68
+ /// \a combiner is the combiner under which all resolver calls will be run.
69
+ /// \a result_handler is used to return results from the resolver.
70
+ static OrphanablePtr<Resolver> CreateResolver(
71
+ const char* target, const grpc_channel_args* args,
72
+ grpc_pollset_set* pollset_set, Combiner* combiner,
73
+ std::unique_ptr<Resolver::ResultHandler> result_handler);
74
+
75
+ /// Returns the default authority to pass from a client for \a target.
76
+ static grpc_core::UniquePtr<char> GetDefaultAuthority(const char* target);
77
+
78
+ /// Returns \a target with the default prefix prepended, if needed.
79
+ static grpc_core::UniquePtr<char> AddDefaultPrefixIfNeeded(
80
+ const char* target);
81
+
82
+ /// Returns the resolver factory for \a scheme.
83
+ /// Caller does NOT own the return value.
84
+ static ResolverFactory* LookupResolverFactory(const char* scheme);
85
+ };
86
+
87
+ } // namespace grpc_core
88
+
89
+ #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_REGISTRY_H */
videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/resolver_result_parsing.h ADDED
@@ -0,0 +1,124 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ *
3
+ * Copyright 2018 gRPC authors.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ *
17
+ */
18
+
19
+ #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_RESULT_PARSING_H
20
+ #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_RESULT_PARSING_H
21
+
22
+ #include <grpc/support/port_platform.h>
23
+
24
+ #include "src/core/ext/filters/client_channel/lb_policy.h"
25
+ #include "src/core/ext/filters/client_channel/lb_policy_factory.h"
26
+ #include "src/core/ext/filters/client_channel/resolver.h"
27
+ #include "src/core/ext/filters/client_channel/retry_throttle.h"
28
+ #include "src/core/ext/filters/client_channel/service_config.h"
29
+ #include "src/core/lib/channel/status_util.h"
30
+ #include "src/core/lib/gprpp/optional.h"
31
+ #include "src/core/lib/gprpp/ref_counted.h"
32
+ #include "src/core/lib/gprpp/ref_counted_ptr.h"
33
+ #include "src/core/lib/iomgr/exec_ctx.h" // for grpc_millis
34
+ #include "src/core/lib/json/json.h"
35
+ #include "src/core/lib/slice/slice_hash_table.h"
36
+
37
+ namespace grpc_core {
38
+ namespace internal {
39
+
40
+ class ClientChannelGlobalParsedConfig : public ServiceConfig::ParsedConfig {
41
+ public:
42
+ struct RetryThrottling {
43
+ intptr_t max_milli_tokens = 0;
44
+ intptr_t milli_token_ratio = 0;
45
+ };
46
+
47
+ ClientChannelGlobalParsedConfig(
48
+ RefCountedPtr<LoadBalancingPolicy::Config> parsed_lb_config,
49
+ grpc_core::UniquePtr<char> parsed_deprecated_lb_policy,
50
+ const Optional<RetryThrottling>& retry_throttling,
51
+ const char* health_check_service_name)
52
+ : parsed_lb_config_(std::move(parsed_lb_config)),
53
+ parsed_deprecated_lb_policy_(std::move(parsed_deprecated_lb_policy)),
54
+ retry_throttling_(retry_throttling),
55
+ health_check_service_name_(health_check_service_name) {}
56
+
57
+ Optional<RetryThrottling> retry_throttling() const {
58
+ return retry_throttling_;
59
+ }
60
+
61
+ RefCountedPtr<LoadBalancingPolicy::Config> parsed_lb_config() const {
62
+ return parsed_lb_config_;
63
+ }
64
+
65
+ const char* parsed_deprecated_lb_policy() const {
66
+ return parsed_deprecated_lb_policy_.get();
67
+ }
68
+
69
+ const char* health_check_service_name() const {
70
+ return health_check_service_name_;
71
+ }
72
+
73
+ private:
74
+ RefCountedPtr<LoadBalancingPolicy::Config> parsed_lb_config_;
75
+ grpc_core::UniquePtr<char> parsed_deprecated_lb_policy_;
76
+ Optional<RetryThrottling> retry_throttling_;
77
+ const char* health_check_service_name_;
78
+ };
79
+
80
+ class ClientChannelMethodParsedConfig : public ServiceConfig::ParsedConfig {
81
+ public:
82
+ struct RetryPolicy {
83
+ int max_attempts = 0;
84
+ grpc_millis initial_backoff = 0;
85
+ grpc_millis max_backoff = 0;
86
+ float backoff_multiplier = 0;
87
+ StatusCodeSet retryable_status_codes;
88
+ };
89
+
90
+ ClientChannelMethodParsedConfig(grpc_millis timeout,
91
+ const Optional<bool>& wait_for_ready,
92
+ std::unique_ptr<RetryPolicy> retry_policy)
93
+ : timeout_(timeout),
94
+ wait_for_ready_(wait_for_ready),
95
+ retry_policy_(std::move(retry_policy)) {}
96
+
97
+ grpc_millis timeout() const { return timeout_; }
98
+
99
+ Optional<bool> wait_for_ready() const { return wait_for_ready_; }
100
+
101
+ const RetryPolicy* retry_policy() const { return retry_policy_.get(); }
102
+
103
+ private:
104
+ grpc_millis timeout_ = 0;
105
+ Optional<bool> wait_for_ready_;
106
+ std::unique_ptr<RetryPolicy> retry_policy_;
107
+ };
108
+
109
+ class ClientChannelServiceConfigParser : public ServiceConfig::Parser {
110
+ public:
111
+ std::unique_ptr<ServiceConfig::ParsedConfig> ParseGlobalParams(
112
+ const grpc_json* json, grpc_error** error) override;
113
+
114
+ std::unique_ptr<ServiceConfig::ParsedConfig> ParsePerMethodParams(
115
+ const grpc_json* json, grpc_error** error) override;
116
+
117
+ static size_t ParserIndex();
118
+ static void Register();
119
+ };
120
+
121
+ } // namespace internal
122
+ } // namespace grpc_core
123
+
124
+ #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_RESULT_PARSING_H */
videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/resolving_lb_policy.h ADDED
@@ -0,0 +1,126 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ *
3
+ * Copyright 2018 gRPC authors.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ *
17
+ */
18
+
19
+ #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVING_LB_POLICY_H
20
+ #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVING_LB_POLICY_H
21
+
22
+ #include <grpc/support/port_platform.h>
23
+
24
+ #include "src/core/ext/filters/client_channel/lb_policy.h"
25
+ #include "src/core/ext/filters/client_channel/lb_policy_factory.h"
26
+ #include "src/core/ext/filters/client_channel/resolver.h"
27
+ #include "src/core/lib/channel/channel_args.h"
28
+ #include "src/core/lib/channel/channel_stack.h"
29
+ #include "src/core/lib/debug/trace.h"
30
+ #include "src/core/lib/gprpp/inlined_vector.h"
31
+ #include "src/core/lib/gprpp/orphanable.h"
32
+ #include "src/core/lib/iomgr/call_combiner.h"
33
+ #include "src/core/lib/iomgr/closure.h"
34
+ #include "src/core/lib/iomgr/polling_entity.h"
35
+ #include "src/core/lib/iomgr/pollset_set.h"
36
+ #include "src/core/lib/transport/connectivity_state.h"
37
+ #include "src/core/lib/transport/metadata_batch.h"
38
+
39
+ namespace grpc_core {
40
+
41
+ // An LB policy that wraps a resolver and a child LB policy to make use
42
+ // of the addresses returned by the resolver.
43
+ //
44
+ // When used in the client_channel code, the resolver will attempt to
45
+ // fetch the service config, and the child LB policy name and config
46
+ // will be determined based on the service config.
47
+ //
48
+ // When used in an LB policy implementation that needs to do another
49
+ // round of resolution before creating a child policy, the resolver does
50
+ // not fetch the service config, and the caller must pre-determine the
51
+ // child LB policy and config to use.
52
+ class ResolvingLoadBalancingPolicy : public LoadBalancingPolicy {
53
+ public:
54
+ // Synchronous callback that takes the resolver result and sets
55
+ // lb_policy_name and lb_policy_config to point to the right data.
56
+ // Returns true if the service config has changed since the last result.
57
+ // If the returned service_config_error is not none and lb_policy_name is
58
+ // empty, it means that we don't have a valid service config to use, and we
59
+ // should set the channel to be in TRANSIENT_FAILURE.
60
+ typedef bool (*ProcessResolverResultCallback)(
61
+ void* user_data, const Resolver::Result& result,
62
+ const char** lb_policy_name,
63
+ RefCountedPtr<LoadBalancingPolicy::Config>* lb_policy_config,
64
+ grpc_error** service_config_error);
65
+ // If error is set when this returns, then construction failed, and
66
+ // the caller may not use the new object.
67
+ ResolvingLoadBalancingPolicy(
68
+ Args args, TraceFlag* tracer, grpc_core::UniquePtr<char> target_uri,
69
+ ProcessResolverResultCallback process_resolver_result,
70
+ void* process_resolver_result_user_data);
71
+
72
+ virtual const char* name() const override { return "resolving_lb"; }
73
+
74
+ // No-op -- should never get updates from the channel.
75
+ // TODO(roth): Need to support updating child LB policy's config for xds
76
+ // use case.
77
+ void UpdateLocked(UpdateArgs /*args*/) override {}
78
+
79
+ void ExitIdleLocked() override;
80
+
81
+ void ResetBackoffLocked() override;
82
+
83
+ private:
84
+ using TraceStringVector = InlinedVector<char*, 3>;
85
+
86
+ class ResolverResultHandler;
87
+ class ResolvingControlHelper;
88
+
89
+ ~ResolvingLoadBalancingPolicy();
90
+
91
+ void ShutdownLocked() override;
92
+
93
+ void OnResolverError(grpc_error* error);
94
+ void CreateOrUpdateLbPolicyLocked(
95
+ const char* lb_policy_name,
96
+ RefCountedPtr<LoadBalancingPolicy::Config> lb_policy_config,
97
+ Resolver::Result result, TraceStringVector* trace_strings);
98
+ OrphanablePtr<LoadBalancingPolicy> CreateLbPolicyLocked(
99
+ const char* lb_policy_name, const grpc_channel_args& args,
100
+ TraceStringVector* trace_strings);
101
+ void MaybeAddTraceMessagesForAddressChangesLocked(
102
+ bool resolution_contains_addresses, TraceStringVector* trace_strings);
103
+ void ConcatenateAndAddChannelTraceLocked(
104
+ TraceStringVector* trace_strings) const;
105
+ void OnResolverResultChangedLocked(Resolver::Result result);
106
+
107
+ // Passed in from caller at construction time.
108
+ TraceFlag* tracer_;
109
+ grpc_core::UniquePtr<char> target_uri_;
110
+ ProcessResolverResultCallback process_resolver_result_ = nullptr;
111
+ void* process_resolver_result_user_data_ = nullptr;
112
+ grpc_core::UniquePtr<char> child_policy_name_;
113
+ RefCountedPtr<LoadBalancingPolicy::Config> child_lb_config_;
114
+
115
+ // Resolver and associated state.
116
+ OrphanablePtr<Resolver> resolver_;
117
+ bool previous_resolution_contained_addresses_ = false;
118
+
119
+ // Child LB policy.
120
+ OrphanablePtr<LoadBalancingPolicy> lb_policy_;
121
+ OrphanablePtr<LoadBalancingPolicy> pending_lb_policy_;
122
+ };
123
+
124
+ } // namespace grpc_core
125
+
126
+ #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVING_LB_POLICY_H */
videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/retry_throttle.h ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ *
3
+ * Copyright 2017 gRPC authors.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ *
17
+ */
18
+
19
+ #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RETRY_THROTTLE_H
20
+ #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RETRY_THROTTLE_H
21
+
22
+ #include <grpc/support/port_platform.h>
23
+
24
+ #include "src/core/lib/gprpp/memory.h"
25
+ #include "src/core/lib/gprpp/ref_counted.h"
26
+
27
+ namespace grpc_core {
28
+ namespace internal {
29
+
30
+ /// Tracks retry throttling data for an individual server name.
31
+ class ServerRetryThrottleData : public RefCounted<ServerRetryThrottleData> {
32
+ public:
33
+ ServerRetryThrottleData(intptr_t max_milli_tokens, intptr_t milli_token_ratio,
34
+ ServerRetryThrottleData* old_throttle_data);
35
+ ~ServerRetryThrottleData();
36
+
37
+ /// Records a failure. Returns true if it's okay to send a retry.
38
+ bool RecordFailure();
39
+
40
+ /// Records a success.
41
+ void RecordSuccess();
42
+
43
+ intptr_t max_milli_tokens() const { return max_milli_tokens_; }
44
+ intptr_t milli_token_ratio() const { return milli_token_ratio_; }
45
+
46
+ private:
47
+ void GetReplacementThrottleDataIfNeeded(
48
+ ServerRetryThrottleData** throttle_data);
49
+
50
+ const intptr_t max_milli_tokens_;
51
+ const intptr_t milli_token_ratio_;
52
+ gpr_atm milli_tokens_;
53
+ // A pointer to the replacement for this ServerRetryThrottleData entry.
54
+ // If non-nullptr, then this entry is stale and must not be used.
55
+ // We hold a reference to the replacement.
56
+ gpr_atm replacement_ = 0;
57
+ };
58
+
59
+ /// Global map of server name to retry throttle data.
60
+ class ServerRetryThrottleMap {
61
+ public:
62
+ /// Initializes global map of failure data for each server name.
63
+ static void Init();
64
+ /// Shuts down global map of failure data for each server name.
65
+ static void Shutdown();
66
+
67
+ /// Returns the failure data for \a server_name, creating a new entry if
68
+ /// needed.
69
+ static RefCountedPtr<ServerRetryThrottleData> GetDataForServer(
70
+ const char* server_name, intptr_t max_milli_tokens,
71
+ intptr_t milli_token_ratio);
72
+ };
73
+
74
+ } // namespace internal
75
+ } // namespace grpc_core
76
+
77
+ #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RETRY_THROTTLE_H */
videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/server_address.h ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ *
3
+ * Copyright 2018 gRPC authors.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ *
17
+ */
18
+
19
+ #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SERVER_ADDRESS_H
20
+ #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SERVER_ADDRESS_H
21
+
22
+ #include <grpc/support/port_platform.h>
23
+
24
+ #include "src/core/lib/channel/channel_args.h"
25
+ #include "src/core/lib/gprpp/inlined_vector.h"
26
+ #include "src/core/lib/iomgr/resolve_address.h"
27
+
28
+ // Channel arg key for a bool indicating whether an address is a grpclb
29
+ // load balancer (as opposed to a backend).
30
+ #define GRPC_ARG_ADDRESS_IS_BALANCER "grpc.address_is_balancer"
31
+
32
+ // Channel arg key for a string indicating an address's balancer name.
33
+ #define GRPC_ARG_ADDRESS_BALANCER_NAME "grpc.address_balancer_name"
34
+
35
+ namespace grpc_core {
36
+
37
+ //
38
+ // ServerAddress
39
+ //
40
+
41
+ // A server address is a grpc_resolved_address with an associated set of
42
+ // channel args. Any args present here will be merged into the channel
43
+ // args when a subchannel is created for this address.
44
+ class ServerAddress {
45
+ public:
46
+ // Takes ownership of args.
47
+ ServerAddress(const grpc_resolved_address& address, grpc_channel_args* args);
48
+ ServerAddress(const void* address, size_t address_len,
49
+ grpc_channel_args* args);
50
+
51
+ ~ServerAddress() { grpc_channel_args_destroy(args_); }
52
+
53
+ // Copyable.
54
+ ServerAddress(const ServerAddress& other)
55
+ : address_(other.address_), args_(grpc_channel_args_copy(other.args_)) {}
56
+ ServerAddress& operator=(const ServerAddress& other) {
57
+ address_ = other.address_;
58
+ grpc_channel_args_destroy(args_);
59
+ args_ = grpc_channel_args_copy(other.args_);
60
+ return *this;
61
+ }
62
+
63
+ // Movable.
64
+ ServerAddress(ServerAddress&& other)
65
+ : address_(other.address_), args_(other.args_) {
66
+ other.args_ = nullptr;
67
+ }
68
+ ServerAddress& operator=(ServerAddress&& other) {
69
+ address_ = other.address_;
70
+ grpc_channel_args_destroy(args_);
71
+ args_ = other.args_;
72
+ other.args_ = nullptr;
73
+ return *this;
74
+ }
75
+
76
+ bool operator==(const ServerAddress& other) const;
77
+
78
+ const grpc_resolved_address& address() const { return address_; }
79
+ const grpc_channel_args* args() const { return args_; }
80
+
81
+ bool IsBalancer() const;
82
+
83
+ private:
84
+ grpc_resolved_address address_;
85
+ grpc_channel_args* args_;
86
+ };
87
+
88
+ //
89
+ // ServerAddressList
90
+ //
91
+
92
+ typedef InlinedVector<ServerAddress, 1> ServerAddressList;
93
+
94
+ } // namespace grpc_core
95
+
96
+ #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SERVER_ADDRESS_H */
videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/service_config.h ADDED
@@ -0,0 +1,200 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ //
2
+ // Copyright 2016 gRPC authors.
3
+ //
4
+ // Licensed under the Apache License, Version 2.0 (the "License");
5
+ // you may not use this file except in compliance with the License.
6
+ // You may obtain a copy of the License at
7
+ //
8
+ // http://www.apache.org/licenses/LICENSE-2.0
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
15
+ //
16
+
17
+ #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SERVICE_CONFIG_H
18
+ #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SERVICE_CONFIG_H
19
+
20
+ #include <grpc/support/port_platform.h>
21
+
22
+ #include <grpc/impl/codegen/grpc_types.h>
23
+ #include <grpc/support/string_util.h>
24
+
25
+ #include "src/core/lib/gprpp/inlined_vector.h"
26
+ #include "src/core/lib/gprpp/ref_counted.h"
27
+ #include "src/core/lib/gprpp/ref_counted_ptr.h"
28
+ #include "src/core/lib/iomgr/error.h"
29
+ #include "src/core/lib/json/json.h"
30
+ #include "src/core/lib/slice/slice_hash_table.h"
31
+
32
+ // The main purpose of the code here is to parse the service config in
33
+ // JSON form, which will look like this:
34
+ //
35
+ // {
36
+ // "loadBalancingPolicy": "string", // optional
37
+ // "methodConfig": [ // array of one or more method_config objects
38
+ // {
39
+ // "name": [ // array of one or more name objects
40
+ // {
41
+ // "service": "string", // required
42
+ // "method": "string", // optional
43
+ // }
44
+ // ],
45
+ // // remaining fields are optional.
46
+ // // see https://developers.google.com/protocol-buffers/docs/proto3#json
47
+ // // for format details.
48
+ // "waitForReady": bool,
49
+ // "timeout": "duration_string",
50
+ // "maxRequestMessageBytes": "int64_string",
51
+ // "maxResponseMessageBytes": "int64_string",
52
+ // }
53
+ // ]
54
+ // }
55
+
56
+ namespace grpc_core {
57
+
58
+ class ServiceConfig : public RefCounted<ServiceConfig> {
59
+ public:
60
+ /// This is the base class that all service config parsers MUST use to store
61
+ /// parsed service config data.
62
+ class ParsedConfig {
63
+ public:
64
+ virtual ~ParsedConfig() = default;
65
+ };
66
+
67
+ /// This is the base class that all service config parsers should derive from.
68
+ class Parser {
69
+ public:
70
+ virtual ~Parser() = default;
71
+
72
+ virtual std::unique_ptr<ParsedConfig> ParseGlobalParams(
73
+ const grpc_json* /* json */, grpc_error** error) {
74
+ // Avoid unused parameter warning on debug-only parameter
75
+ (void)error;
76
+ GPR_DEBUG_ASSERT(error != nullptr);
77
+ return nullptr;
78
+ }
79
+
80
+ virtual std::unique_ptr<ParsedConfig> ParsePerMethodParams(
81
+ const grpc_json* /* json */, grpc_error** error) {
82
+ // Avoid unused parameter warning on debug-only parameter
83
+ (void)error;
84
+ GPR_DEBUG_ASSERT(error != nullptr);
85
+ return nullptr;
86
+ }
87
+ };
88
+
89
+ static constexpr int kNumPreallocatedParsers = 4;
90
+ typedef InlinedVector<std::unique_ptr<ParsedConfig>, kNumPreallocatedParsers>
91
+ ParsedConfigVector;
92
+
93
+ /// When a service config is applied to a call in the client_channel_filter,
94
+ /// we create an instance of this object and store it in the call_data for
95
+ /// client_channel. A pointer to this object is also stored in the
96
+ /// call_context, so that future filters can easily access method and global
97
+ /// parameters for the call.
98
+ class CallData {
99
+ public:
100
+ CallData() = default;
101
+ CallData(RefCountedPtr<ServiceConfig> svc_cfg, const grpc_slice& path)
102
+ : service_config_(std::move(svc_cfg)) {
103
+ if (service_config_ != nullptr) {
104
+ method_params_vector_ =
105
+ service_config_->GetMethodParsedConfigVector(path);
106
+ }
107
+ }
108
+
109
+ ServiceConfig* service_config() { return service_config_.get(); }
110
+
111
+ ParsedConfig* GetMethodParsedConfig(size_t index) const {
112
+ return method_params_vector_ != nullptr
113
+ ? (*method_params_vector_)[index].get()
114
+ : nullptr;
115
+ }
116
+
117
+ ParsedConfig* GetGlobalParsedConfig(size_t index) const {
118
+ return service_config_->GetGlobalParsedConfig(index);
119
+ }
120
+
121
+ private:
122
+ RefCountedPtr<ServiceConfig> service_config_;
123
+ const ParsedConfigVector* method_params_vector_ = nullptr;
124
+ };
125
+
126
+ /// Creates a new service config from parsing \a json_string.
127
+ /// Returns null on parse error.
128
+ static RefCountedPtr<ServiceConfig> Create(const char* json,
129
+ grpc_error** error);
130
+
131
+ // Takes ownership of \a json_tree.
132
+ ServiceConfig(grpc_core::UniquePtr<char> service_config_json,
133
+ grpc_core::UniquePtr<char> json_string, grpc_json* json_tree,
134
+ grpc_error** error);
135
+ ~ServiceConfig();
136
+
137
+ const char* service_config_json() const { return service_config_json_.get(); }
138
+
139
+ /// Retrieves the global parsed config at index \a index. The
140
+ /// lifetime of the returned object is tied to the lifetime of the
141
+ /// ServiceConfig object.
142
+ ParsedConfig* GetGlobalParsedConfig(size_t index) {
143
+ GPR_DEBUG_ASSERT(index < parsed_global_configs_.size());
144
+ return parsed_global_configs_[index].get();
145
+ }
146
+
147
+ /// Retrieves the vector of parsed configs for the method identified
148
+ /// by \a path. The lifetime of the returned vector and contained objects
149
+ /// is tied to the lifetime of the ServiceConfig object.
150
+ const ParsedConfigVector* GetMethodParsedConfigVector(const grpc_slice& path);
151
+
152
+ /// Globally register a service config parser. On successful registration, it
153
+ /// returns the index at which the parser was registered. On failure, -1 is
154
+ /// returned. Each new service config update will go through all the
155
+ /// registered parser. Each parser is responsible for reading the service
156
+ /// config json and returning a parsed config. This parsed config can later be
157
+ /// retrieved using the same index that was returned at registration time.
158
+ static size_t RegisterParser(std::unique_ptr<Parser> parser);
159
+
160
+ static void Init();
161
+
162
+ static void Shutdown();
163
+
164
+ private:
165
+ // Helper functions to parse the service config
166
+ grpc_error* ParseGlobalParams(const grpc_json* json_tree);
167
+ grpc_error* ParsePerMethodParams(const grpc_json* json_tree);
168
+
169
+ // Returns the number of names specified in the method config \a json.
170
+ static int CountNamesInMethodConfig(grpc_json* json);
171
+
172
+ // Returns a path string for the JSON name object specified by \a json.
173
+ // Returns null on error, and stores error in \a error.
174
+ static grpc_core::UniquePtr<char> ParseJsonMethodName(grpc_json* json,
175
+ grpc_error** error);
176
+
177
+ grpc_error* ParseJsonMethodConfigToServiceConfigVectorTable(
178
+ const grpc_json* json,
179
+ SliceHashTable<const ParsedConfigVector*>::Entry* entries, size_t* idx);
180
+
181
+ grpc_core::UniquePtr<char> service_config_json_;
182
+ grpc_core::UniquePtr<char> json_string_; // Underlying storage for json_tree.
183
+ grpc_json* json_tree_;
184
+
185
+ InlinedVector<std::unique_ptr<ParsedConfig>, kNumPreallocatedParsers>
186
+ parsed_global_configs_;
187
+ // A map from the method name to the parsed config vector. Note that we are
188
+ // using a raw pointer and not a unique pointer so that we can use the same
189
+ // vector for multiple names.
190
+ RefCountedPtr<SliceHashTable<const ParsedConfigVector*>>
191
+ parsed_method_configs_table_;
192
+ // Storage for all the vectors that are being used in
193
+ // parsed_method_configs_table_.
194
+ InlinedVector<std::unique_ptr<ParsedConfigVector>, 32>
195
+ parsed_method_config_vectors_storage_;
196
+ };
197
+
198
+ } // namespace grpc_core
199
+
200
+ #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SERVICE_CONFIG_H */
videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/subchannel.h ADDED
@@ -0,0 +1,403 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ *
3
+ * Copyright 2015 gRPC authors.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ *
17
+ */
18
+
19
+ #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SUBCHANNEL_H
20
+ #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SUBCHANNEL_H
21
+
22
+ #include <grpc/support/port_platform.h>
23
+
24
+ #include "src/core/ext/filters/client_channel/client_channel_channelz.h"
25
+ #include "src/core/ext/filters/client_channel/connector.h"
26
+ #include "src/core/ext/filters/client_channel/subchannel_pool_interface.h"
27
+ #include "src/core/lib/backoff/backoff.h"
28
+ #include "src/core/lib/channel/channel_stack.h"
29
+ #include "src/core/lib/gpr/time_precise.h"
30
+ #include "src/core/lib/gprpp/arena.h"
31
+ #include "src/core/lib/gprpp/map.h"
32
+ #include "src/core/lib/gprpp/ref_counted.h"
33
+ #include "src/core/lib/gprpp/ref_counted_ptr.h"
34
+ #include "src/core/lib/gprpp/sync.h"
35
+ #include "src/core/lib/iomgr/polling_entity.h"
36
+ #include "src/core/lib/iomgr/timer.h"
37
+ #include "src/core/lib/transport/connectivity_state.h"
38
+ #include "src/core/lib/transport/metadata.h"
39
+
40
+ // Channel arg containing a grpc_resolved_address to connect to.
41
+ #define GRPC_ARG_SUBCHANNEL_ADDRESS "grpc.subchannel_address"
42
+
43
+ // For debugging refcounting.
44
+ #ifndef NDEBUG
45
+ #define GRPC_SUBCHANNEL_REF(p, r) (p)->Ref(__FILE__, __LINE__, (r))
46
+ #define GRPC_SUBCHANNEL_REF_FROM_WEAK_REF(p, r) (p)->RefFromWeakRef()
47
+ #define GRPC_SUBCHANNEL_UNREF(p, r) (p)->Unref(__FILE__, __LINE__, (r))
48
+ #define GRPC_SUBCHANNEL_WEAK_REF(p, r) (p)->WeakRef(__FILE__, __LINE__, (r))
49
+ #define GRPC_SUBCHANNEL_WEAK_UNREF(p, r) (p)->WeakUnref(__FILE__, __LINE__, (r))
50
+ #define GRPC_SUBCHANNEL_REF_EXTRA_ARGS \
51
+ const char *file, int line, const char *reason
52
+ #define GRPC_SUBCHANNEL_REF_REASON reason
53
+ #define GRPC_SUBCHANNEL_REF_MUTATE_EXTRA_ARGS \
54
+ , GRPC_SUBCHANNEL_REF_EXTRA_ARGS, const char* purpose
55
+ #define GRPC_SUBCHANNEL_REF_MUTATE_PURPOSE(x) , file, line, reason, x
56
+ #else
57
+ #define GRPC_SUBCHANNEL_REF(p, r) (p)->Ref()
58
+ #define GRPC_SUBCHANNEL_REF_FROM_WEAK_REF(p, r) (p)->RefFromWeakRef()
59
+ #define GRPC_SUBCHANNEL_UNREF(p, r) (p)->Unref()
60
+ #define GRPC_SUBCHANNEL_WEAK_REF(p, r) (p)->WeakRef()
61
+ #define GRPC_SUBCHANNEL_WEAK_UNREF(p, r) (p)->WeakUnref()
62
+ #define GRPC_SUBCHANNEL_REF_EXTRA_ARGS
63
+ #define GRPC_SUBCHANNEL_REF_REASON ""
64
+ #define GRPC_SUBCHANNEL_REF_MUTATE_EXTRA_ARGS
65
+ #define GRPC_SUBCHANNEL_REF_MUTATE_PURPOSE(x)
66
+ #endif
67
+
68
+ namespace grpc_core {
69
+
70
+ class SubchannelCall;
71
+
72
+ class ConnectedSubchannel : public RefCounted<ConnectedSubchannel> {
73
+ public:
74
+ ConnectedSubchannel(
75
+ grpc_channel_stack* channel_stack, const grpc_channel_args* args,
76
+ RefCountedPtr<channelz::SubchannelNode> channelz_subchannel);
77
+ ~ConnectedSubchannel();
78
+
79
+ void StartWatch(grpc_pollset_set* interested_parties,
80
+ OrphanablePtr<ConnectivityStateWatcherInterface> watcher);
81
+
82
+ void Ping(grpc_closure* on_initiate, grpc_closure* on_ack);
83
+
84
+ grpc_channel_stack* channel_stack() const { return channel_stack_; }
85
+ const grpc_channel_args* args() const { return args_; }
86
+ channelz::SubchannelNode* channelz_subchannel() const {
87
+ return channelz_subchannel_.get();
88
+ }
89
+
90
+ size_t GetInitialCallSizeEstimate(size_t parent_data_size) const;
91
+
92
+ private:
93
+ grpc_channel_stack* channel_stack_;
94
+ grpc_channel_args* args_;
95
+ // ref counted pointer to the channelz node in this connected subchannel's
96
+ // owning subchannel.
97
+ RefCountedPtr<channelz::SubchannelNode> channelz_subchannel_;
98
+ };
99
+
100
+ // Implements the interface of RefCounted<>.
101
+ class SubchannelCall {
102
+ public:
103
+ struct Args {
104
+ RefCountedPtr<ConnectedSubchannel> connected_subchannel;
105
+ grpc_polling_entity* pollent;
106
+ grpc_slice path;
107
+ gpr_cycle_counter start_time;
108
+ grpc_millis deadline;
109
+ Arena* arena;
110
+ grpc_call_context_element* context;
111
+ CallCombiner* call_combiner;
112
+ size_t parent_data_size;
113
+ };
114
+ static RefCountedPtr<SubchannelCall> Create(Args args, grpc_error** error);
115
+
116
+ // Continues processing a transport stream op batch.
117
+ void StartTransportStreamOpBatch(grpc_transport_stream_op_batch* batch);
118
+
119
+ // Returns a pointer to the parent data associated with the subchannel call.
120
+ // The data will be of the size specified in \a parent_data_size field of
121
+ // the args passed to \a ConnectedSubchannel::CreateCall().
122
+ void* GetParentData();
123
+
124
+ // Returns the call stack of the subchannel call.
125
+ grpc_call_stack* GetCallStack();
126
+
127
+ // Sets the 'then_schedule_closure' argument for call stack destruction.
128
+ // Must be called once per call.
129
+ void SetAfterCallStackDestroy(grpc_closure* closure);
130
+
131
+ // Interface of RefCounted<>.
132
+ RefCountedPtr<SubchannelCall> Ref() GRPC_MUST_USE_RESULT;
133
+ RefCountedPtr<SubchannelCall> Ref(const DebugLocation& location,
134
+ const char* reason) GRPC_MUST_USE_RESULT;
135
+ // When refcount drops to 0, destroys itself and the associated call stack,
136
+ // but does NOT free the memory because it's in the call arena.
137
+ void Unref();
138
+ void Unref(const DebugLocation& location, const char* reason);
139
+
140
+ static void Destroy(void* arg, grpc_error* error);
141
+
142
+ private:
143
+ // Allow RefCountedPtr<> to access IncrementRefCount().
144
+ template <typename T>
145
+ friend class RefCountedPtr;
146
+
147
+ SubchannelCall(Args args, grpc_error** error);
148
+
149
+ // If channelz is enabled, intercepts recv_trailing so that we may check the
150
+ // status and associate it to a subchannel.
151
+ void MaybeInterceptRecvTrailingMetadata(
152
+ grpc_transport_stream_op_batch* batch);
153
+
154
+ static void RecvTrailingMetadataReady(void* arg, grpc_error* error);
155
+
156
+ // Interface of RefCounted<>.
157
+ void IncrementRefCount();
158
+ void IncrementRefCount(const DebugLocation& location, const char* reason);
159
+
160
+ RefCountedPtr<ConnectedSubchannel> connected_subchannel_;
161
+ grpc_closure* after_call_stack_destroy_ = nullptr;
162
+ // State needed to support channelz interception of recv trailing metadata.
163
+ grpc_closure recv_trailing_metadata_ready_;
164
+ grpc_closure* original_recv_trailing_metadata_ = nullptr;
165
+ grpc_metadata_batch* recv_trailing_metadata_ = nullptr;
166
+ grpc_millis deadline_;
167
+ };
168
+
169
+ // A subchannel that knows how to connect to exactly one target address. It
170
+ // provides a target for load balancing.
171
+ //
172
+ // Note that this is the "real" subchannel implementation, whose API is
173
+ // different from the SubchannelInterface that is exposed to LB policy
174
+ // implementations. The client channel provides an adaptor class
175
+ // (SubchannelWrapper) that "converts" between the two.
176
+ class Subchannel {
177
+ public:
178
+ class ConnectivityStateWatcherInterface
179
+ : public InternallyRefCounted<ConnectivityStateWatcherInterface> {
180
+ public:
181
+ virtual ~ConnectivityStateWatcherInterface() = default;
182
+
183
+ // Will be invoked whenever the subchannel's connectivity state
184
+ // changes. There will be only one invocation of this method on a
185
+ // given watcher instance at any given time.
186
+ //
187
+ // When the state changes to READY, connected_subchannel will
188
+ // contain a ref to the connected subchannel. When it changes from
189
+ // READY to some other state, the implementation must release its
190
+ // ref to the connected subchannel.
191
+ virtual void OnConnectivityStateChange(
192
+ grpc_connectivity_state new_state,
193
+ RefCountedPtr<ConnectedSubchannel> connected_subchannel) // NOLINT
194
+ = 0;
195
+
196
+ virtual grpc_pollset_set* interested_parties() = 0;
197
+ };
198
+
199
+ // The ctor and dtor are not intended to use directly.
200
+ Subchannel(SubchannelKey* key, OrphanablePtr<SubchannelConnector> connector,
201
+ const grpc_channel_args* args);
202
+ ~Subchannel();
203
+
204
+ // Creates a subchannel given \a connector and \a args.
205
+ static Subchannel* Create(OrphanablePtr<SubchannelConnector> connector,
206
+ const grpc_channel_args* args);
207
+
208
+ // Strong and weak refcounting.
209
+ Subchannel* Ref(GRPC_SUBCHANNEL_REF_EXTRA_ARGS);
210
+ void Unref(GRPC_SUBCHANNEL_REF_EXTRA_ARGS);
211
+ Subchannel* WeakRef(GRPC_SUBCHANNEL_REF_EXTRA_ARGS);
212
+ void WeakUnref(GRPC_SUBCHANNEL_REF_EXTRA_ARGS);
213
+ // Attempts to return a strong ref when only the weak refcount is guaranteed
214
+ // non-zero. If the strong refcount is zero, does not alter the refcount and
215
+ // returns null.
216
+ Subchannel* RefFromWeakRef();
217
+
218
+ // Gets the string representing the subchannel address.
219
+ // Caller doesn't take ownership.
220
+ const char* GetTargetAddress();
221
+
222
+ const grpc_channel_args* channel_args() const { return args_; }
223
+
224
+ channelz::SubchannelNode* channelz_node();
225
+
226
+ // Returns the current connectivity state of the subchannel.
227
+ // If health_check_service_name is non-null, the returned connectivity
228
+ // state will be based on the state reported by the backend for that
229
+ // service name.
230
+ // If the return value is GRPC_CHANNEL_READY, also sets *connected_subchannel.
231
+ grpc_connectivity_state CheckConnectivityState(
232
+ const char* health_check_service_name,
233
+ RefCountedPtr<ConnectedSubchannel>* connected_subchannel);
234
+
235
+ // Starts watching the subchannel's connectivity state.
236
+ // The first callback to the watcher will be delivered when the
237
+ // subchannel's connectivity state becomes a value other than
238
+ // initial_state, which may happen immediately.
239
+ // Subsequent callbacks will be delivered as the subchannel's state
240
+ // changes.
241
+ // The watcher will be destroyed either when the subchannel is
242
+ // destroyed or when CancelConnectivityStateWatch() is called.
243
+ void WatchConnectivityState(
244
+ grpc_connectivity_state initial_state,
245
+ grpc_core::UniquePtr<char> health_check_service_name,
246
+ OrphanablePtr<ConnectivityStateWatcherInterface> watcher);
247
+
248
+ // Cancels a connectivity state watch.
249
+ // If the watcher has already been destroyed, this is a no-op.
250
+ void CancelConnectivityStateWatch(const char* health_check_service_name,
251
+ ConnectivityStateWatcherInterface* watcher);
252
+
253
+ // Attempt to connect to the backend. Has no effect if already connected.
254
+ void AttemptToConnect();
255
+
256
+ // Resets the connection backoff of the subchannel.
257
+ // TODO(roth): Move connection backoff out of subchannels and up into LB
258
+ // policy code (probably by adding a SubchannelGroup between
259
+ // SubchannelList and SubchannelData), at which point this method can
260
+ // go away.
261
+ void ResetBackoff();
262
+
263
+ // Returns a new channel arg encoding the subchannel address as a URI
264
+ // string. Caller is responsible for freeing the string.
265
+ static grpc_arg CreateSubchannelAddressArg(const grpc_resolved_address* addr);
266
+
267
+ // Returns the URI string from the subchannel address arg in \a args.
268
+ static const char* GetUriFromSubchannelAddressArg(
269
+ const grpc_channel_args* args);
270
+
271
+ // Sets \a addr from the subchannel address arg in \a args.
272
+ static void GetAddressFromSubchannelAddressArg(const grpc_channel_args* args,
273
+ grpc_resolved_address* addr);
274
+
275
+ private:
276
+ // A linked list of ConnectivityStateWatcherInterfaces that are monitoring
277
+ // the subchannel's state.
278
+ class ConnectivityStateWatcherList {
279
+ public:
280
+ ~ConnectivityStateWatcherList() { Clear(); }
281
+
282
+ void AddWatcherLocked(
283
+ OrphanablePtr<ConnectivityStateWatcherInterface> watcher);
284
+ void RemoveWatcherLocked(ConnectivityStateWatcherInterface* watcher);
285
+
286
+ // Notifies all watchers in the list about a change to state.
287
+ void NotifyLocked(Subchannel* subchannel, grpc_connectivity_state state);
288
+
289
+ void Clear() { watchers_.clear(); }
290
+
291
+ bool empty() const { return watchers_.empty(); }
292
+
293
+ private:
294
+ // TODO(roth): Once we can use C++-14 heterogeneous lookups, this can
295
+ // be a set instead of a map.
296
+ std::map<ConnectivityStateWatcherInterface*,
297
+ OrphanablePtr<ConnectivityStateWatcherInterface>>
298
+ watchers_;
299
+ };
300
+
301
+ // A map that tracks ConnectivityStateWatcherInterfaces using a particular
302
+ // health check service name.
303
+ //
304
+ // There is one entry in the map for each health check service name.
305
+ // Entries exist only as long as there are watchers using the
306
+ // corresponding service name.
307
+ //
308
+ // A health check client is maintained only while the subchannel is in
309
+ // state READY.
310
+ class HealthWatcherMap {
311
+ public:
312
+ void AddWatcherLocked(
313
+ Subchannel* subchannel, grpc_connectivity_state initial_state,
314
+ grpc_core::UniquePtr<char> health_check_service_name,
315
+ OrphanablePtr<ConnectivityStateWatcherInterface> watcher);
316
+ void RemoveWatcherLocked(const char* health_check_service_name,
317
+ ConnectivityStateWatcherInterface* watcher);
318
+
319
+ // Notifies the watcher when the subchannel's state changes.
320
+ void NotifyLocked(grpc_connectivity_state state);
321
+
322
+ grpc_connectivity_state CheckConnectivityStateLocked(
323
+ Subchannel* subchannel, const char* health_check_service_name);
324
+
325
+ void ShutdownLocked();
326
+
327
+ private:
328
+ class HealthWatcher;
329
+
330
+ std::map<const char*, OrphanablePtr<HealthWatcher>, StringLess> map_;
331
+ };
332
+
333
+ class ConnectedSubchannelStateWatcher;
334
+
335
+ // Sets the subchannel's connectivity state to \a state.
336
+ void SetConnectivityStateLocked(grpc_connectivity_state state);
337
+
338
+ // Methods for connection.
339
+ void MaybeStartConnectingLocked();
340
+ static void OnRetryAlarm(void* arg, grpc_error* error);
341
+ void ContinueConnectingLocked();
342
+ static void OnConnectingFinished(void* arg, grpc_error* error);
343
+ bool PublishTransportLocked();
344
+ void Disconnect();
345
+
346
+ gpr_atm RefMutate(gpr_atm delta,
347
+ int barrier GRPC_SUBCHANNEL_REF_MUTATE_EXTRA_ARGS);
348
+
349
+ // The subchannel pool this subchannel is in.
350
+ RefCountedPtr<SubchannelPoolInterface> subchannel_pool_;
351
+ // TODO(juanlishen): Consider using args_ as key_ directly.
352
+ // Subchannel key that identifies this subchannel in the subchannel pool.
353
+ SubchannelKey* key_;
354
+ // Channel args.
355
+ grpc_channel_args* args_;
356
+ // pollset_set tracking who's interested in a connection being setup.
357
+ grpc_pollset_set* pollset_set_;
358
+ // Protects the other members.
359
+ Mutex mu_;
360
+ // Refcount
361
+ // - lower INTERNAL_REF_BITS bits are for internal references:
362
+ // these do not keep the subchannel open.
363
+ // - upper remaining bits are for public references: these do
364
+ // keep the subchannel open
365
+ gpr_atm ref_pair_;
366
+
367
+ // Connection states.
368
+ OrphanablePtr<SubchannelConnector> connector_;
369
+ // Set during connection.
370
+ SubchannelConnector::Result connecting_result_;
371
+ grpc_closure on_connecting_finished_;
372
+ // Active connection, or null.
373
+ RefCountedPtr<ConnectedSubchannel> connected_subchannel_;
374
+ bool connecting_ = false;
375
+ bool disconnected_ = false;
376
+
377
+ // Connectivity state tracking.
378
+ grpc_connectivity_state state_ = GRPC_CHANNEL_IDLE;
379
+ // The list of watchers without a health check service name.
380
+ ConnectivityStateWatcherList watcher_list_;
381
+ // The map of watchers with health check service names.
382
+ HealthWatcherMap health_watcher_map_;
383
+
384
+ // Backoff state.
385
+ BackOff backoff_;
386
+ grpc_millis next_attempt_deadline_;
387
+ grpc_millis min_connect_timeout_ms_;
388
+ bool backoff_begun_ = false;
389
+
390
+ // Retry alarm.
391
+ grpc_timer retry_alarm_;
392
+ grpc_closure on_retry_alarm_;
393
+ bool have_retry_alarm_ = false;
394
+ // reset_backoff() was called while alarm was pending.
395
+ bool retry_immediately_ = false;
396
+
397
+ // Channelz tracking.
398
+ RefCountedPtr<channelz::SubchannelNode> channelz_node_;
399
+ };
400
+
401
+ } // namespace grpc_core
402
+
403
+ #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SUBCHANNEL_H */
videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/subchannel_interface.h ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ *
3
+ * Copyright 2019 gRPC authors.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ *
17
+ */
18
+
19
+ #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SUBCHANNEL_INTERFACE_H
20
+ #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SUBCHANNEL_INTERFACE_H
21
+
22
+ #include <grpc/support/port_platform.h>
23
+
24
+ #include "src/core/lib/gprpp/ref_counted.h"
25
+ #include "src/core/lib/gprpp/ref_counted_ptr.h"
26
+
27
+ namespace grpc_core {
28
+
29
+ // The interface for subchannels that is exposed to LB policy implementations.
30
+ class SubchannelInterface : public RefCounted<SubchannelInterface> {
31
+ public:
32
+ class ConnectivityStateWatcherInterface {
33
+ public:
34
+ virtual ~ConnectivityStateWatcherInterface() = default;
35
+
36
+ // Will be invoked whenever the subchannel's connectivity state
37
+ // changes. There will be only one invocation of this method on a
38
+ // given watcher instance at any given time.
39
+ virtual void OnConnectivityStateChange(
40
+ grpc_connectivity_state new_state) = 0;
41
+
42
+ // TODO(roth): Remove this as soon as we move to EventManager-based
43
+ // polling.
44
+ virtual grpc_pollset_set* interested_parties() = 0;
45
+ };
46
+
47
+ template <typename TraceFlagT = TraceFlag>
48
+ explicit SubchannelInterface(TraceFlagT* trace_flag = nullptr)
49
+ : RefCounted<SubchannelInterface>(trace_flag) {}
50
+
51
+ virtual ~SubchannelInterface() = default;
52
+
53
+ // Returns the current connectivity state of the subchannel.
54
+ virtual grpc_connectivity_state CheckConnectivityState() = 0;
55
+
56
+ // Starts watching the subchannel's connectivity state.
57
+ // The first callback to the watcher will be delivered when the
58
+ // subchannel's connectivity state becomes a value other than
59
+ // initial_state, which may happen immediately.
60
+ // Subsequent callbacks will be delivered as the subchannel's state
61
+ // changes.
62
+ // The watcher will be destroyed either when the subchannel is
63
+ // destroyed or when CancelConnectivityStateWatch() is called.
64
+ // There can be only one watcher of a given subchannel. It is not
65
+ // valid to call this method a second time without first cancelling
66
+ // the previous watcher using CancelConnectivityStateWatch().
67
+ virtual void WatchConnectivityState(
68
+ grpc_connectivity_state initial_state,
69
+ std::unique_ptr<ConnectivityStateWatcherInterface> watcher) = 0;
70
+
71
+ // Cancels a connectivity state watch.
72
+ // If the watcher has already been destroyed, this is a no-op.
73
+ virtual void CancelConnectivityStateWatch(
74
+ ConnectivityStateWatcherInterface* watcher) = 0;
75
+
76
+ // Attempt to connect to the backend. Has no effect if already connected.
77
+ // If the subchannel is currently in backoff delay due to a previously
78
+ // failed attempt, the new connection attempt will not start until the
79
+ // backoff delay has elapsed.
80
+ virtual void AttemptToConnect() = 0;
81
+
82
+ // Resets the subchannel's connection backoff state. If AttemptToConnect()
83
+ // has been called since the subchannel entered TRANSIENT_FAILURE state,
84
+ // starts a new connection attempt immediately; otherwise, a new connection
85
+ // attempt will be started as soon as AttemptToConnect() is called.
86
+ virtual void ResetBackoff() = 0;
87
+
88
+ // TODO(roth): Need a better non-grpc-specific abstraction here.
89
+ virtual const grpc_channel_args* channel_args() = 0;
90
+ };
91
+
92
+ } // namespace grpc_core
93
+
94
+ #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SUBCHANNEL_INTERFACE_H */
videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/subchannel_pool_interface.h ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ *
3
+ * Copyright 2018 gRPC authors.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ *
17
+ */
18
+
19
+ #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SUBCHANNEL_POOL_INTERFACE_H
20
+ #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SUBCHANNEL_POOL_INTERFACE_H
21
+
22
+ #include <grpc/support/port_platform.h>
23
+
24
+ #include "src/core/lib/avl/avl.h"
25
+ #include "src/core/lib/channel/channel_args.h"
26
+ #include "src/core/lib/gprpp/ref_counted.h"
27
+
28
+ namespace grpc_core {
29
+
30
+ class Subchannel;
31
+
32
+ extern TraceFlag grpc_subchannel_pool_trace;
33
+
34
+ // A key that can uniquely identify a subchannel.
35
+ class SubchannelKey {
36
+ public:
37
+ explicit SubchannelKey(const grpc_channel_args* args);
38
+ ~SubchannelKey();
39
+
40
+ // Copyable.
41
+ SubchannelKey(const SubchannelKey& other);
42
+ SubchannelKey& operator=(const SubchannelKey& other);
43
+ // Not movable.
44
+ SubchannelKey(SubchannelKey&&) = delete;
45
+ SubchannelKey& operator=(SubchannelKey&&) = delete;
46
+
47
+ int Cmp(const SubchannelKey& other) const;
48
+
49
+ private:
50
+ // Initializes the subchannel key with the given \a args and the function to
51
+ // copy channel args.
52
+ void Init(
53
+ const grpc_channel_args* args,
54
+ grpc_channel_args* (*copy_channel_args)(const grpc_channel_args* args));
55
+
56
+ const grpc_channel_args* args_;
57
+ };
58
+
59
+ // Interface for subchannel pool.
60
+ // TODO(juanlishen): This refcounting mechanism may lead to memory leak.
61
+ // To solve that, we should force polling to flush any pending callbacks, then
62
+ // shut down safely. See https://github.com/grpc/grpc/issues/12560.
63
+ class SubchannelPoolInterface : public RefCounted<SubchannelPoolInterface> {
64
+ public:
65
+ SubchannelPoolInterface() : RefCounted(&grpc_subchannel_pool_trace) {}
66
+ virtual ~SubchannelPoolInterface() {}
67
+
68
+ // Registers a subchannel against a key. Returns the subchannel registered
69
+ // with \a key, which may be different from \a constructed because we reuse
70
+ // (instead of update) any existing subchannel already registered with \a key.
71
+ virtual Subchannel* RegisterSubchannel(SubchannelKey* key,
72
+ Subchannel* constructed) = 0;
73
+
74
+ // Removes the registered subchannel found by \a key.
75
+ virtual void UnregisterSubchannel(SubchannelKey* key) = 0;
76
+
77
+ // Finds the subchannel registered for the given subchannel key. Returns NULL
78
+ // if no such channel exists. Thread-safe.
79
+ virtual Subchannel* FindSubchannel(SubchannelKey* key) = 0;
80
+
81
+ // Creates a channel arg from \a subchannel pool.
82
+ static grpc_arg CreateChannelArg(SubchannelPoolInterface* subchannel_pool);
83
+
84
+ // Gets the subchannel pool from the channel args.
85
+ static SubchannelPoolInterface* GetSubchannelPoolFromChannelArgs(
86
+ const grpc_channel_args* args);
87
+ };
88
+
89
+ } // namespace grpc_core
90
+
91
+ #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SUBCHANNEL_POOL_INTERFACE_H */
videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/xds/xds_api.h ADDED
@@ -0,0 +1,181 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ *
3
+ * Copyright 2018 gRPC authors.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ *
17
+ */
18
+
19
+ #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_XDS_XDS_API_H
20
+ #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_XDS_XDS_API_H
21
+
22
+ #include <grpc/support/port_platform.h>
23
+
24
+ #include <stdint.h>
25
+
26
+ #include <grpc/slice_buffer.h>
27
+
28
+ #include "src/core/ext/filters/client_channel/server_address.h"
29
+ #include "src/core/ext/filters/client_channel/xds/xds_bootstrap.h"
30
+ #include "src/core/ext/filters/client_channel/xds/xds_client_stats.h"
31
+
32
+ namespace grpc_core {
33
+
34
+ class XdsPriorityListUpdate {
35
+ public:
36
+ struct LocalityMap {
37
+ struct Locality {
38
+ bool operator==(const Locality& other) const {
39
+ return *name == *other.name && serverlist == other.serverlist &&
40
+ lb_weight == other.lb_weight && priority == other.priority;
41
+ }
42
+
43
+ // This comparator only compares the locality names.
44
+ struct Less {
45
+ bool operator()(const Locality& lhs, const Locality& rhs) const {
46
+ return XdsLocalityName::Less()(lhs.name, rhs.name);
47
+ }
48
+ };
49
+
50
+ RefCountedPtr<XdsLocalityName> name;
51
+ ServerAddressList serverlist;
52
+ uint32_t lb_weight;
53
+ uint32_t priority;
54
+ };
55
+
56
+ bool Contains(const RefCountedPtr<XdsLocalityName>& name) const {
57
+ return localities.find(name) != localities.end();
58
+ }
59
+
60
+ size_t size() const { return localities.size(); }
61
+
62
+ std::map<RefCountedPtr<XdsLocalityName>, Locality, XdsLocalityName::Less>
63
+ localities;
64
+ };
65
+
66
+ bool operator==(const XdsPriorityListUpdate& other) const;
67
+ bool operator!=(const XdsPriorityListUpdate& other) const {
68
+ return !(*this == other);
69
+ }
70
+
71
+ void Add(LocalityMap::Locality locality);
72
+
73
+ const LocalityMap* Find(uint32_t priority) const;
74
+
75
+ bool Contains(uint32_t priority) const {
76
+ return priority < priorities_.size();
77
+ }
78
+ bool Contains(const RefCountedPtr<XdsLocalityName>& name);
79
+
80
+ bool empty() const { return priorities_.empty(); }
81
+ size_t size() const { return priorities_.size(); }
82
+
83
+ // Callers should make sure the priority list is non-empty.
84
+ uint32_t LowestPriority() const {
85
+ return static_cast<uint32_t>(priorities_.size()) - 1;
86
+ }
87
+
88
+ private:
89
+ InlinedVector<LocalityMap, 2> priorities_;
90
+ };
91
+
92
+ // There are two phases of accessing this class's content:
93
+ // 1. to initialize in the control plane combiner;
94
+ // 2. to use in the data plane combiner.
95
+ // So no additional synchronization is needed.
96
+ class XdsDropConfig : public RefCounted<XdsDropConfig> {
97
+ public:
98
+ struct DropCategory {
99
+ bool operator==(const DropCategory& other) const {
100
+ return strcmp(name.get(), other.name.get()) == 0 &&
101
+ parts_per_million == other.parts_per_million;
102
+ }
103
+
104
+ grpc_core::UniquePtr<char> name;
105
+ const uint32_t parts_per_million;
106
+ };
107
+
108
+ using DropCategoryList = InlinedVector<DropCategory, 2>;
109
+
110
+ void AddCategory(grpc_core::UniquePtr<char> name,
111
+ uint32_t parts_per_million) {
112
+ drop_category_list_.emplace_back(
113
+ DropCategory{std::move(name), parts_per_million});
114
+ }
115
+
116
+ // The only method invoked from the data plane combiner.
117
+ bool ShouldDrop(const grpc_core::UniquePtr<char>** category_name) const;
118
+
119
+ const DropCategoryList& drop_category_list() const {
120
+ return drop_category_list_;
121
+ }
122
+
123
+ bool operator==(const XdsDropConfig& other) const {
124
+ return drop_category_list_ == other.drop_category_list_;
125
+ }
126
+ bool operator!=(const XdsDropConfig& other) const {
127
+ return !(*this == other);
128
+ }
129
+
130
+ private:
131
+ DropCategoryList drop_category_list_;
132
+ };
133
+
134
+ struct EdsUpdate {
135
+ XdsPriorityListUpdate priority_list_update;
136
+ RefCountedPtr<XdsDropConfig> drop_config;
137
+ bool drop_all = false;
138
+ };
139
+
140
+ struct CdsUpdate {
141
+ // The name to use in the EDS request.
142
+ // If null, the cluster name will be used.
143
+ grpc_core::UniquePtr<char> eds_service_name;
144
+ // The LRS server to use for load reporting.
145
+ // If null, load reporting will be disabled.
146
+ // If set to the empty string, will use the same server we obtained
147
+ // the CDS data from.
148
+ grpc_core::UniquePtr<char> lrs_load_reporting_server_name;
149
+ };
150
+
151
+ // Creates an EDS request querying \a service_name.
152
+ grpc_slice XdsEdsRequestCreateAndEncode(const char* server_name,
153
+ const XdsBootstrap::Node* node,
154
+ const char* build_version);
155
+
156
+ // Parses the EDS response and returns the args to update locality map. If there
157
+ // is any error, the output update is invalid.
158
+ grpc_error* XdsEdsResponseDecodeAndParse(const grpc_slice& encoded_response,
159
+ EdsUpdate* update);
160
+
161
+ // Creates an LRS request querying \a server_name.
162
+ grpc_slice XdsLrsRequestCreateAndEncode(const char* server_name,
163
+ const XdsBootstrap::Node* node,
164
+ const char* build_version);
165
+
166
+ // Creates an LRS request sending client-side load reports. If all the counters
167
+ // in \a client_stats are zero, returns empty slice.
168
+ grpc_slice XdsLrsRequestCreateAndEncode(const char* server_name,
169
+ XdsClientStats* client_stats);
170
+
171
+ // Parses the LRS response and returns \a cluster_name and \a
172
+ // load_reporting_interval for client-side load reporting. If there is any
173
+ // error, the output config is invalid.
174
+ grpc_error* XdsLrsResponseDecodeAndParse(
175
+ const grpc_slice& encoded_response,
176
+ grpc_core::UniquePtr<char>* cluster_name,
177
+ grpc_millis* load_reporting_interval);
178
+
179
+ } // namespace grpc_core
180
+
181
+ #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_XDS_XDS_API_H */
videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/xds/xds_bootstrap.h ADDED
@@ -0,0 +1,104 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ //
2
+ // Copyright 2019 gRPC authors.
3
+ //
4
+ // Licensed under the Apache License, Version 2.0 (the "License");
5
+ // you may not use this file except in compliance with the License.
6
+ // You may obtain a copy of the License at
7
+ //
8
+ // http://www.apache.org/licenses/LICENSE-2.0
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
15
+ //
16
+
17
+ #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_XDS_XDS_BOOTSTRAP_H
18
+ #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_XDS_XDS_BOOTSTRAP_H
19
+
20
+ #include <grpc/support/port_platform.h>
21
+
22
+ #include <vector>
23
+
24
+ #include <grpc/impl/codegen/slice.h>
25
+
26
+ #include "src/core/lib/gprpp/inlined_vector.h"
27
+ #include "src/core/lib/gprpp/map.h"
28
+ #include "src/core/lib/gprpp/memory.h"
29
+ #include "src/core/lib/iomgr/error.h"
30
+ #include "src/core/lib/json/json.h"
31
+
32
+ namespace grpc_core {
33
+
34
+ class XdsBootstrap {
35
+ public:
36
+ struct MetadataValue {
37
+ enum class Type { MD_NULL, DOUBLE, STRING, BOOL, STRUCT, LIST };
38
+ Type type = Type::MD_NULL;
39
+ // TODO(roth): Once we can use C++17, these can be in a std::variant.
40
+ double double_value;
41
+ const char* string_value;
42
+ bool bool_value;
43
+ std::map<const char*, MetadataValue, StringLess> struct_value;
44
+ std::vector<MetadataValue> list_value;
45
+ };
46
+
47
+ struct Node {
48
+ const char* id = nullptr;
49
+ const char* cluster = nullptr;
50
+ const char* locality_region = nullptr;
51
+ const char* locality_zone = nullptr;
52
+ const char* locality_subzone = nullptr;
53
+ std::map<const char*, MetadataValue, StringLess> metadata;
54
+ };
55
+
56
+ struct ChannelCreds {
57
+ const char* type = nullptr;
58
+ grpc_json* config = nullptr;
59
+ };
60
+
61
+ struct XdsServer {
62
+ const char* server_uri = nullptr;
63
+ InlinedVector<ChannelCreds, 1> channel_creds;
64
+ };
65
+
66
+ // If *error is not GRPC_ERROR_NONE after returning, then there was an
67
+ // error reading the file.
68
+ static std::unique_ptr<XdsBootstrap> ReadFromFile(grpc_error** error);
69
+
70
+ // Do not instantiate directly -- use ReadFromFile() above instead.
71
+ XdsBootstrap(grpc_slice contents, grpc_error** error);
72
+ ~XdsBootstrap();
73
+
74
+ // TODO(roth): We currently support only one server. Fix this when we
75
+ // add support for fallback for the xds channel.
76
+ const XdsServer& server() const { return servers_[0]; }
77
+ const Node* node() const { return node_.get(); }
78
+
79
+ private:
80
+ grpc_error* ParseXdsServerList(grpc_json* json);
81
+ grpc_error* ParseXdsServer(grpc_json* json, size_t idx);
82
+ grpc_error* ParseChannelCredsArray(grpc_json* json, XdsServer* server);
83
+ grpc_error* ParseChannelCreds(grpc_json* json, size_t idx, XdsServer* server);
84
+ grpc_error* ParseNode(grpc_json* json);
85
+ grpc_error* ParseLocality(grpc_json* json);
86
+
87
+ InlinedVector<grpc_error*, 1> ParseMetadataStruct(
88
+ grpc_json* json,
89
+ std::map<const char*, MetadataValue, StringLess>* result);
90
+ InlinedVector<grpc_error*, 1> ParseMetadataList(
91
+ grpc_json* json, std::vector<MetadataValue>* result);
92
+ grpc_error* ParseMetadataValue(grpc_json* json, size_t idx,
93
+ MetadataValue* result);
94
+
95
+ grpc_slice contents_;
96
+ grpc_json* tree_ = nullptr;
97
+
98
+ InlinedVector<XdsServer, 1> servers_;
99
+ std::unique_ptr<Node> node_;
100
+ };
101
+
102
+ } // namespace grpc_core
103
+
104
+ #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_XDS_XDS_BOOTSTRAP_H */
videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/xds/xds_channel.h ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ *
3
+ * Copyright 2018 gRPC authors.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ *
17
+ */
18
+
19
+ #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_XDS_XDS_CHANNEL_H
20
+ #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_XDS_XDS_CHANNEL_H
21
+
22
+ #include <grpc/support/port_platform.h>
23
+
24
+ #include <grpc/impl/codegen/grpc_types.h>
25
+
26
+ #include "src/core/ext/filters/client_channel/xds/xds_bootstrap.h"
27
+
28
+ namespace grpc_core {
29
+
30
+ /// Makes any necessary modifications to \a args for use in the xds
31
+ /// balancer channel.
32
+ ///
33
+ /// Takes ownership of \a args.
34
+ ///
35
+ /// Caller takes ownership of the returned args.
36
+ grpc_channel_args* ModifyXdsChannelArgs(grpc_channel_args* args);
37
+
38
+ grpc_channel* CreateXdsChannel(const XdsBootstrap& bootstrap,
39
+ const grpc_channel_args& args);
40
+
41
+ } // namespace grpc_core
42
+
43
+ #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_XDS_XDS_CHANNEL_H \
44
+ */
videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/xds/xds_channel_args.h ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ //
2
+ // Copyright 2019 gRPC authors.
3
+ //
4
+ // Licensed under the Apache License, Version 2.0 (the "License");
5
+ // you may not use this file except in compliance with the License.
6
+ // You may obtain a copy of the License at
7
+ //
8
+ // http://www.apache.org/licenses/LICENSE-2.0
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
15
+ //
16
+
17
+ #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_XDS_XDS_CHANNEL_ARGS_H
18
+ #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_XDS_XDS_CHANNEL_ARGS_H
19
+
20
+ // Boolean channel arg indicating whether the target is an xds server.
21
+ #define GRPC_ARG_ADDRESS_IS_XDS_SERVER "grpc.address_is_xds_server"
22
+
23
+ // Pointer channel arg containing a ref to the XdsClient object.
24
+ #define GRPC_ARG_XDS_CLIENT "grpc.xds_client"
25
+
26
+ #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_XDS_XDS_CHANNEL_ARGS_H */
videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/xds/xds_client.h ADDED
@@ -0,0 +1,226 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ //
2
+ // Copyright 2019 gRPC authors.
3
+ //
4
+ // Licensed under the Apache License, Version 2.0 (the "License");
5
+ // you may not use this file except in compliance with the License.
6
+ // You may obtain a copy of the License at
7
+ //
8
+ // http://www.apache.org/licenses/LICENSE-2.0
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
15
+ //
16
+
17
+ #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_XDS_XDS_CLIENT_H
18
+ #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_XDS_XDS_CLIENT_H
19
+
20
+ #include <grpc/support/port_platform.h>
21
+
22
+ #include <set>
23
+
24
+ #include "src/core/ext/filters/client_channel/service_config.h"
25
+ #include "src/core/ext/filters/client_channel/xds/xds_api.h"
26
+ #include "src/core/ext/filters/client_channel/xds/xds_bootstrap.h"
27
+ #include "src/core/ext/filters/client_channel/xds/xds_client_stats.h"
28
+ #include "src/core/lib/gprpp/map.h"
29
+ #include "src/core/lib/gprpp/memory.h"
30
+ #include "src/core/lib/gprpp/orphanable.h"
31
+ #include "src/core/lib/gprpp/ref_counted.h"
32
+ #include "src/core/lib/gprpp/ref_counted_ptr.h"
33
+ #include "src/core/lib/gprpp/string_view.h"
34
+ #include "src/core/lib/iomgr/combiner.h"
35
+
36
+ namespace grpc_core {
37
+
38
+ extern TraceFlag xds_client_trace;
39
+
40
+ class XdsClient : public InternallyRefCounted<XdsClient> {
41
+ public:
42
+ // Service config watcher interface. Implemented by callers.
43
+ class ServiceConfigWatcherInterface {
44
+ public:
45
+ virtual ~ServiceConfigWatcherInterface() = default;
46
+
47
+ virtual void OnServiceConfigChanged(
48
+ RefCountedPtr<ServiceConfig> service_config) = 0;
49
+
50
+ virtual void OnError(grpc_error* error) = 0;
51
+ };
52
+
53
+ // Cluster data watcher interface. Implemented by callers.
54
+ class ClusterWatcherInterface {
55
+ public:
56
+ virtual ~ClusterWatcherInterface() = default;
57
+
58
+ virtual void OnClusterChanged(CdsUpdate cluster_data) = 0;
59
+
60
+ virtual void OnError(grpc_error* error) = 0;
61
+ };
62
+
63
+ // Endpoint data watcher interface. Implemented by callers.
64
+ class EndpointWatcherInterface {
65
+ public:
66
+ virtual ~EndpointWatcherInterface() = default;
67
+
68
+ virtual void OnEndpointChanged(EdsUpdate update) = 0;
69
+
70
+ virtual void OnError(grpc_error* error) = 0;
71
+ };
72
+
73
+ // If *error is not GRPC_ERROR_NONE after construction, then there was
74
+ // an error initializing the client.
75
+ XdsClient(Combiner* combiner, grpc_pollset_set* interested_parties,
76
+ StringView server_name,
77
+ std::unique_ptr<ServiceConfigWatcherInterface> watcher,
78
+ const grpc_channel_args& channel_args, grpc_error** error);
79
+ ~XdsClient();
80
+
81
+ void Orphan() override;
82
+
83
+ // Start and cancel cluster data watch for a cluster.
84
+ // The XdsClient takes ownership of the watcher, but the caller may
85
+ // keep a raw pointer to the watcher, which may be used only for
86
+ // cancellation. (Because the caller does not own the watcher, the
87
+ // pointer must not be used for any other purpose.)
88
+ void WatchClusterData(StringView cluster,
89
+ std::unique_ptr<ClusterWatcherInterface> watcher);
90
+ void CancelClusterDataWatch(StringView cluster,
91
+ ClusterWatcherInterface* watcher);
92
+
93
+ // Start and cancel endpoint data watch for a cluster.
94
+ // The XdsClient takes ownership of the watcher, but the caller may
95
+ // keep a raw pointer to the watcher, which may be used only for
96
+ // cancellation. (Because the caller does not own the watcher, the
97
+ // pointer must not be used for any other purpose.)
98
+ void WatchEndpointData(StringView cluster,
99
+ std::unique_ptr<EndpointWatcherInterface> watcher);
100
+ void CancelEndpointDataWatch(StringView cluster,
101
+ EndpointWatcherInterface* watcher);
102
+
103
+ // Adds and removes client stats for cluster.
104
+ void AddClientStats(StringView lrs_server, StringView cluster,
105
+ XdsClientStats* client_stats);
106
+ void RemoveClientStats(StringView lrs_server, StringView cluster,
107
+ XdsClientStats* client_stats);
108
+
109
+ // Resets connection backoff state.
110
+ void ResetBackoff();
111
+
112
+ // Helpers for encoding the XdsClient object in channel args.
113
+ grpc_arg MakeChannelArg() const;
114
+ static RefCountedPtr<XdsClient> GetFromChannelArgs(
115
+ const grpc_channel_args& args);
116
+
117
+ private:
118
+ // Contains a channel to the xds server and all the data related to the
119
+ // channel. Holds a ref to the xds client object.
120
+ // TODO(roth): This is separate from the XdsClient object because it was
121
+ // originally designed to be able to swap itself out in case the
122
+ // balancer name changed. Now that the balancer name is going to be
123
+ // coming from the bootstrap file, we don't really need this level of
124
+ // indirection unless we decide to support watching the bootstrap file
125
+ // for changes. At some point, if we decide that we're never going to
126
+ // need to do that, then we can eliminate this class and move its
127
+ // contents directly into the XdsClient class.
128
+ class ChannelState : public InternallyRefCounted<ChannelState> {
129
+ public:
130
+ template <typename T>
131
+ class RetryableCall;
132
+
133
+ class AdsCallState;
134
+ class LrsCallState;
135
+
136
+ ChannelState(RefCountedPtr<XdsClient> xds_client,
137
+ const grpc_channel_args& args);
138
+ ~ChannelState();
139
+
140
+ void Orphan() override;
141
+
142
+ grpc_channel* channel() const { return channel_; }
143
+ XdsClient* xds_client() const { return xds_client_.get(); }
144
+ AdsCallState* ads_calld() const;
145
+ LrsCallState* lrs_calld() const;
146
+
147
+ void MaybeStartAdsCall();
148
+ void StopAdsCall();
149
+
150
+ void MaybeStartLrsCall();
151
+ void StopLrsCall();
152
+
153
+ bool HasActiveAdsCall() const;
154
+
155
+ void StartConnectivityWatchLocked();
156
+ void CancelConnectivityWatchLocked();
157
+
158
+ private:
159
+ class StateWatcher;
160
+
161
+ // The owning xds client.
162
+ RefCountedPtr<XdsClient> xds_client_;
163
+
164
+ // The channel and its status.
165
+ grpc_channel* channel_;
166
+ bool shutting_down_ = false;
167
+ StateWatcher* watcher_ = nullptr;
168
+
169
+ // The retryable XDS calls.
170
+ OrphanablePtr<RetryableCall<AdsCallState>> ads_calld_;
171
+ OrphanablePtr<RetryableCall<LrsCallState>> lrs_calld_;
172
+ };
173
+
174
+ struct ClusterState {
175
+ std::map<ClusterWatcherInterface*, std::unique_ptr<ClusterWatcherInterface>>
176
+ cluster_watchers;
177
+ std::map<EndpointWatcherInterface*,
178
+ std::unique_ptr<EndpointWatcherInterface>>
179
+ endpoint_watchers;
180
+ std::set<XdsClientStats*> client_stats;
181
+ // The latest data seen from EDS.
182
+ EdsUpdate eds_update;
183
+ };
184
+
185
+ // Sends an error notification to all watchers.
186
+ void NotifyOnError(grpc_error* error);
187
+
188
+ // TODO(juanlishen): Once we implement LDS support, this can be a
189
+ // normal method instead of a closure callback.
190
+ static void NotifyOnServiceConfig(void* arg, grpc_error* error);
191
+
192
+ // Channel arg vtable functions.
193
+ static void* ChannelArgCopy(void* p);
194
+ static void ChannelArgDestroy(void* p);
195
+ static int ChannelArgCmp(void* p, void* q);
196
+
197
+ static const grpc_arg_pointer_vtable kXdsClientVtable;
198
+
199
+ grpc_core::UniquePtr<char> build_version_;
200
+
201
+ Combiner* combiner_;
202
+ grpc_pollset_set* interested_parties_;
203
+
204
+ std::unique_ptr<XdsBootstrap> bootstrap_;
205
+
206
+ grpc_core::UniquePtr<char> server_name_;
207
+ std::unique_ptr<ServiceConfigWatcherInterface> service_config_watcher_;
208
+ // TODO(juanlishen): Once we implement LDS support, this will no
209
+ // longer be needed.
210
+ grpc_closure service_config_notify_;
211
+
212
+ // The channel for communicating with the xds server.
213
+ OrphanablePtr<ChannelState> chand_;
214
+
215
+ // TODO(juanlishen): As part of adding CDS support, replace
216
+ // cluster_state_ with a map keyed by cluster name, so that we can
217
+ // support multiple clusters for both CDS and EDS.
218
+ ClusterState cluster_state_;
219
+ // Map<StringView /*cluster*/, ClusterState, StringLess> clusters_;
220
+
221
+ bool shutting_down_ = false;
222
+ };
223
+
224
+ } // namespace grpc_core
225
+
226
+ #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_XDS_XDS_CLIENT_H */
videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/client_channel/xds/xds_client_stats.h ADDED
@@ -0,0 +1,232 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ *
3
+ * Copyright 2018 gRPC authors.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ *
17
+ */
18
+
19
+ #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_XDS_XDS_CLIENT_STATS_H
20
+ #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_XDS_XDS_CLIENT_STATS_H
21
+
22
+ #include <grpc/support/port_platform.h>
23
+
24
+ #include <grpc/support/string_util.h>
25
+
26
+ #include "src/core/lib/gprpp/atomic.h"
27
+ #include "src/core/lib/gprpp/inlined_vector.h"
28
+ #include "src/core/lib/gprpp/map.h"
29
+ #include "src/core/lib/gprpp/memory.h"
30
+ #include "src/core/lib/gprpp/ref_counted.h"
31
+ #include "src/core/lib/gprpp/sync.h"
32
+ #include "src/core/lib/iomgr/exec_ctx.h"
33
+
34
+ namespace grpc_core {
35
+
36
+ class XdsLocalityName : public RefCounted<XdsLocalityName> {
37
+ public:
38
+ struct Less {
39
+ bool operator()(const RefCountedPtr<XdsLocalityName>& lhs,
40
+ const RefCountedPtr<XdsLocalityName>& rhs) const {
41
+ int cmp_result = strcmp(lhs->region_.get(), rhs->region_.get());
42
+ if (cmp_result != 0) return cmp_result < 0;
43
+ cmp_result = strcmp(lhs->zone_.get(), rhs->zone_.get());
44
+ if (cmp_result != 0) return cmp_result < 0;
45
+ return strcmp(lhs->sub_zone_.get(), rhs->sub_zone_.get()) < 0;
46
+ }
47
+ };
48
+
49
+ XdsLocalityName(grpc_core::UniquePtr<char> region,
50
+ grpc_core::UniquePtr<char> zone,
51
+ grpc_core::UniquePtr<char> subzone)
52
+ : region_(std::move(region)),
53
+ zone_(std::move(zone)),
54
+ sub_zone_(std::move(subzone)) {}
55
+
56
+ bool operator==(const XdsLocalityName& other) const {
57
+ return strcmp(region_.get(), other.region_.get()) == 0 &&
58
+ strcmp(zone_.get(), other.zone_.get()) == 0 &&
59
+ strcmp(sub_zone_.get(), other.sub_zone_.get()) == 0;
60
+ }
61
+
62
+ const char* region() const { return region_.get(); }
63
+ const char* zone() const { return zone_.get(); }
64
+ const char* sub_zone() const { return sub_zone_.get(); }
65
+
66
+ const char* AsHumanReadableString() {
67
+ if (human_readable_string_ == nullptr) {
68
+ char* tmp;
69
+ gpr_asprintf(&tmp, "{region=\"%s\", zone=\"%s\", sub_zone=\"%s\"}",
70
+ region_.get(), zone_.get(), sub_zone_.get());
71
+ human_readable_string_.reset(tmp);
72
+ }
73
+ return human_readable_string_.get();
74
+ }
75
+
76
+ private:
77
+ grpc_core::UniquePtr<char> region_;
78
+ grpc_core::UniquePtr<char> zone_;
79
+ grpc_core::UniquePtr<char> sub_zone_;
80
+ grpc_core::UniquePtr<char> human_readable_string_;
81
+ };
82
+
83
+ // The stats classes (i.e., XdsClientStats, LocalityStats, and LoadMetric) can
84
+ // be taken a snapshot (and reset) to populate the load report. The snapshots
85
+ // are contained in the respective Snapshot structs. The Snapshot structs have
86
+ // no synchronization. The stats classes use several different synchronization
87
+ // methods. 1. Most of the counters are Atomic<>s for performance. 2. Some of
88
+ // the Map<>s are protected by Mutex if we are not guaranteed that the accesses
89
+ // to them are synchronized by the callers. 3. The Map<>s to which the accesses
90
+ // are already synchronized by the callers do not have additional
91
+ // synchronization here. Note that the Map<>s we mentioned in 2 and 3 refer to
92
+ // the map's tree structure rather than the content in each tree node.
93
+ class XdsClientStats {
94
+ public:
95
+ class LocalityStats : public RefCounted<LocalityStats> {
96
+ public:
97
+ class LoadMetric {
98
+ public:
99
+ struct Snapshot {
100
+ bool IsAllZero() const;
101
+
102
+ uint64_t num_requests_finished_with_metric;
103
+ double total_metric_value;
104
+ };
105
+
106
+ // Returns a snapshot of this instance and reset all the accumulative
107
+ // counters.
108
+ Snapshot GetSnapshotAndReset();
109
+
110
+ private:
111
+ uint64_t num_requests_finished_with_metric_{0};
112
+ double total_metric_value_{0};
113
+ };
114
+
115
+ using LoadMetricMap =
116
+ std::map<grpc_core::UniquePtr<char>, LoadMetric, StringLess>;
117
+ using LoadMetricSnapshotMap =
118
+ std::map<grpc_core::UniquePtr<char>, LoadMetric::Snapshot, StringLess>;
119
+
120
+ struct Snapshot {
121
+ // TODO(juanlishen): Change this to const method when const_iterator is
122
+ // added to Map<>.
123
+ bool IsAllZero();
124
+
125
+ uint64_t total_successful_requests;
126
+ uint64_t total_requests_in_progress;
127
+ uint64_t total_error_requests;
128
+ uint64_t total_issued_requests;
129
+ LoadMetricSnapshotMap load_metric_stats;
130
+ };
131
+
132
+ // Returns a snapshot of this instance and reset all the accumulative
133
+ // counters.
134
+ Snapshot GetSnapshotAndReset();
135
+
136
+ // Each XdsLb::PickerWrapper holds a ref to the perspective LocalityStats.
137
+ // If the refcount is 0, there won't be new calls recorded to the
138
+ // LocalityStats, so the LocalityStats can be safely deleted when all the
139
+ // in-progress calls have finished.
140
+ // Only be called from the control plane combiner.
141
+ void RefByPicker() { picker_refcount_.FetchAdd(1, MemoryOrder::ACQ_REL); }
142
+ // Might be called from the control plane combiner or the data plane
143
+ // combiner.
144
+ // TODO(juanlishen): Once https://github.com/grpc/grpc/pull/19390 is merged,
145
+ // this method will also only be invoked in the control plane combiner.
146
+ // We may then be able to simplify the LocalityStats' lifetime by making it
147
+ // RefCounted<> and populating the protobuf in its dtor.
148
+ void UnrefByPicker() { picker_refcount_.FetchSub(1, MemoryOrder::ACQ_REL); }
149
+ // Only be called from the control plane combiner.
150
+ // The only place where the picker_refcount_ can be increased is
151
+ // RefByPicker(), which also can only be called from the control plane
152
+ // combiner. Also, if the picker_refcount_ is 0, total_requests_in_progress_
153
+ // can't be increased from 0. So it's safe to delete the LocalityStats right
154
+ // after this method returns true.
155
+ bool IsSafeToDelete() {
156
+ return picker_refcount_.FetchAdd(0, MemoryOrder::ACQ_REL) == 0 &&
157
+ total_requests_in_progress_.FetchAdd(0, MemoryOrder::ACQ_REL) == 0;
158
+ }
159
+
160
+ void AddCallStarted();
161
+ void AddCallFinished(bool fail = false);
162
+
163
+ private:
164
+ Atomic<uint64_t> total_successful_requests_{0};
165
+ Atomic<uint64_t> total_requests_in_progress_{0};
166
+ // Requests that were issued (not dropped) but failed.
167
+ Atomic<uint64_t> total_error_requests_{0};
168
+ Atomic<uint64_t> total_issued_requests_{0};
169
+ // Protects load_metric_stats_. A mutex is necessary because the length of
170
+ // load_metric_stats_ can be accessed by both the callback intercepting the
171
+ // call's recv_trailing_metadata (not from any combiner) and the load
172
+ // reporting thread (from the control plane combiner).
173
+ Mutex load_metric_stats_mu_;
174
+ LoadMetricMap load_metric_stats_;
175
+ // Can be accessed from either the control plane combiner or the data plane
176
+ // combiner.
177
+ Atomic<uint8_t> picker_refcount_{0};
178
+ };
179
+
180
+ // TODO(juanlishen): The value type of Map<> must be movable in current
181
+ // implementation. To avoid making LocalityStats movable, we wrap it by
182
+ // std::unique_ptr<>. We should remove this wrapper if the value type of Map<>
183
+ // doesn't have to be movable.
184
+ using LocalityStatsMap =
185
+ std::map<RefCountedPtr<XdsLocalityName>, RefCountedPtr<LocalityStats>,
186
+ XdsLocalityName::Less>;
187
+ using LocalityStatsSnapshotMap =
188
+ std::map<RefCountedPtr<XdsLocalityName>, LocalityStats::Snapshot,
189
+ XdsLocalityName::Less>;
190
+ using DroppedRequestsMap =
191
+ std::map<grpc_core::UniquePtr<char>, uint64_t, StringLess>;
192
+ using DroppedRequestsSnapshotMap = DroppedRequestsMap;
193
+
194
+ struct Snapshot {
195
+ // TODO(juanlishen): Change this to const method when const_iterator is
196
+ // added to Map<>.
197
+ bool IsAllZero();
198
+
199
+ LocalityStatsSnapshotMap upstream_locality_stats;
200
+ uint64_t total_dropped_requests;
201
+ DroppedRequestsSnapshotMap dropped_requests;
202
+ // The actual load report interval.
203
+ grpc_millis load_report_interval;
204
+ };
205
+
206
+ // Returns a snapshot of this instance and reset all the accumulative
207
+ // counters.
208
+ Snapshot GetSnapshotAndReset();
209
+
210
+ void MaybeInitLastReportTime();
211
+ RefCountedPtr<LocalityStats> FindLocalityStats(
212
+ const RefCountedPtr<XdsLocalityName>& locality_name);
213
+ void PruneLocalityStats();
214
+ void AddCallDropped(const grpc_core::UniquePtr<char>& category);
215
+
216
+ private:
217
+ // The stats for each locality.
218
+ LocalityStatsMap upstream_locality_stats_;
219
+ Atomic<uint64_t> total_dropped_requests_{0};
220
+ // Protects dropped_requests_. A mutex is necessary because the length of
221
+ // dropped_requests_ can be accessed by both the picker (from data plane
222
+ // combiner) and the load reporting thread (from the control plane combiner).
223
+ Mutex dropped_requests_mu_;
224
+ DroppedRequestsMap dropped_requests_;
225
+ // The timestamp of last reporting. For the LB-policy-wide first report, the
226
+ // last_report_time is the time we scheduled the first reporting timer.
227
+ grpc_millis last_report_time_ = -1;
228
+ };
229
+
230
+ } // namespace grpc_core
231
+
232
+ #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_XDS_XDS_CLIENT_STATS_H */
videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/deadline/deadline_filter.h ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ //
2
+ // Copyright 2016 gRPC authors.
3
+ //
4
+ // Licensed under the Apache License, Version 2.0 (the "License");
5
+ // you may not use this file except in compliance with the License.
6
+ // You may obtain a copy of the License at
7
+ //
8
+ // http://www.apache.org/licenses/LICENSE-2.0
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
15
+ //
16
+
17
+ #ifndef GRPC_CORE_EXT_FILTERS_DEADLINE_DEADLINE_FILTER_H
18
+ #define GRPC_CORE_EXT_FILTERS_DEADLINE_DEADLINE_FILTER_H
19
+
20
+ #include <grpc/support/port_platform.h>
21
+
22
+ #include "src/core/lib/channel/channel_stack.h"
23
+ #include "src/core/lib/iomgr/timer.h"
24
+
25
+ enum grpc_deadline_timer_state {
26
+ GRPC_DEADLINE_STATE_INITIAL,
27
+ GRPC_DEADLINE_STATE_PENDING,
28
+ GRPC_DEADLINE_STATE_FINISHED
29
+ };
30
+
31
+ // State used for filters that enforce call deadlines.
32
+ // Must be the first field in the filter's call_data.
33
+ struct grpc_deadline_state {
34
+ grpc_deadline_state(grpc_call_element* elem, grpc_call_stack* call_stack,
35
+ grpc_core::CallCombiner* call_combiner,
36
+ grpc_millis deadline);
37
+ ~grpc_deadline_state();
38
+
39
+ // We take a reference to the call stack for the timer callback.
40
+ grpc_call_stack* call_stack;
41
+ grpc_core::CallCombiner* call_combiner;
42
+ grpc_deadline_timer_state timer_state = GRPC_DEADLINE_STATE_INITIAL;
43
+ grpc_timer timer;
44
+ grpc_closure timer_callback;
45
+ // Closure to invoke when we receive trailing metadata.
46
+ // We use this to cancel the timer.
47
+ grpc_closure recv_trailing_metadata_ready;
48
+ // The original recv_trailing_metadata_ready closure, which we chain to
49
+ // after our own closure is invoked.
50
+ grpc_closure* original_recv_trailing_metadata_ready;
51
+ };
52
+
53
+ //
54
+ // NOTE: All of these functions require that the first field in
55
+ // elem->call_data is a grpc_deadline_state.
56
+ //
57
+
58
+ // Cancels the existing timer and starts a new one with new_deadline.
59
+ //
60
+ // Note: It is generally safe to call this with an earlier deadline
61
+ // value than the current one, but not the reverse. No checks are done
62
+ // to ensure that the timer callback is not invoked while it is in the
63
+ // process of being reset, which means that attempting to increase the
64
+ // deadline may result in the timer being called twice.
65
+ //
66
+ // Note: Must be called while holding the call combiner.
67
+ void grpc_deadline_state_reset(grpc_call_element* elem,
68
+ grpc_millis new_deadline);
69
+
70
+ // To be called from the client-side filter's start_transport_stream_op_batch()
71
+ // method. Ensures that the deadline timer is cancelled when the call
72
+ // is completed.
73
+ //
74
+ // Note: It is the caller's responsibility to chain to the next filter if
75
+ // necessary after this function returns.
76
+ //
77
+ // Note: Must be called while holding the call combiner.
78
+ void grpc_deadline_state_client_start_transport_stream_op_batch(
79
+ grpc_call_element* elem, grpc_transport_stream_op_batch* op);
80
+
81
+ // Should deadline checking be performed (according to channel args)
82
+ bool grpc_deadline_checking_enabled(const grpc_channel_args* args);
83
+
84
+ // Deadline filters for direct client channels and server channels.
85
+ // Note: Deadlines for non-direct client channels are handled by the
86
+ // client_channel filter.
87
+ extern const grpc_channel_filter grpc_client_deadline_filter;
88
+ extern const grpc_channel_filter grpc_server_deadline_filter;
89
+
90
+ #endif /* GRPC_CORE_EXT_FILTERS_DEADLINE_DEADLINE_FILTER_H */
videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/http/client/http_client_filter.h ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright 2015 gRPC authors.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ *
16
+ */
17
+
18
+ #ifndef GRPC_CORE_EXT_FILTERS_HTTP_CLIENT_HTTP_CLIENT_FILTER_H
19
+ #define GRPC_CORE_EXT_FILTERS_HTTP_CLIENT_HTTP_CLIENT_FILTER_H
20
+
21
+ #include <grpc/support/port_platform.h>
22
+
23
+ #include "src/core/lib/channel/channel_stack.h"
24
+
25
+ /* Processes metadata on the client side for HTTP2 transports */
26
+ extern const grpc_channel_filter grpc_http_client_filter;
27
+
28
+ /* Channel arg to determine maximum size of payload eligible for GET request */
29
+ #define GRPC_ARG_MAX_PAYLOAD_SIZE_FOR_GET "grpc.max_payload_size_for_get"
30
+
31
+ #endif /* GRPC_CORE_EXT_FILTERS_HTTP_CLIENT_HTTP_CLIENT_FILTER_H */
videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/http/client_authority_filter.h ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ *
3
+ * Copyright 2018 gRPC authors.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ *
17
+ */
18
+
19
+ #ifndef GRPC_CORE_EXT_FILTERS_HTTP_CLIENT_AUTHORITY_FILTER_H
20
+ #define GRPC_CORE_EXT_FILTERS_HTTP_CLIENT_AUTHORITY_FILTER_H
21
+
22
+ #include <grpc/support/port_platform.h>
23
+
24
+ #include <grpc/impl/codegen/compression_types.h>
25
+
26
+ #include "src/core/lib/channel/channel_stack.h"
27
+
28
+ /// Filter responsible for setting the authority header, if not already set. It
29
+ /// uses the value of the GRPC_ARG_DEFAULT_AUTHORITY channel arg if the initial
30
+ /// metadata doesn't already contain an authority value.
31
+
32
+ extern const grpc_channel_filter grpc_client_authority_filter;
33
+
34
+ #endif /* GRPC_CORE_EXT_FILTERS_HTTP_CLIENT_AUTHORITY_FILTER_H */
videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/http/message_compress/message_compress_filter.h ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ *
3
+ * Copyright 2015 gRPC authors.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ *
17
+ */
18
+
19
+ #ifndef GRPC_CORE_EXT_FILTERS_HTTP_MESSAGE_COMPRESS_MESSAGE_COMPRESS_FILTER_H
20
+ #define GRPC_CORE_EXT_FILTERS_HTTP_MESSAGE_COMPRESS_MESSAGE_COMPRESS_FILTER_H
21
+
22
+ #include <grpc/support/port_platform.h>
23
+
24
+ #include <grpc/impl/codegen/compression_types.h>
25
+
26
+ #include "src/core/lib/channel/channel_stack.h"
27
+
28
+ /** Compression filter for outgoing data.
29
+ *
30
+ * See <grpc/compression.h> for the available compression settings.
31
+ *
32
+ * Compression settings may come from:
33
+ * - Channel configuration, as established at channel creation time.
34
+ * - The metadata accompanying the outgoing data to be compressed. This is
35
+ * taken as a request only. We may choose not to honor it. The metadata key
36
+ * is given by \a GRPC_COMPRESSION_REQUEST_ALGORITHM_MD_KEY.
37
+ *
38
+ * Compression can be disabled for concrete messages (for instance in order to
39
+ * prevent CRIME/BEAST type attacks) by having the GRPC_WRITE_NO_COMPRESS set in
40
+ * the BEGIN_MESSAGE flags.
41
+ *
42
+ * The attempted compression mechanism is added to the resulting initial
43
+ * metadata under the'grpc-encoding' key.
44
+ *
45
+ * If compression is actually performed, BEGIN_MESSAGE's flag is modified to
46
+ * incorporate GRPC_WRITE_INTERNAL_COMPRESS. Otherwise, and regardless of the
47
+ * aforementioned 'grpc-encoding' metadata value, data will pass through
48
+ * uncompressed. */
49
+
50
+ extern const grpc_channel_filter grpc_message_compress_filter;
51
+
52
+ #endif /* GRPC_CORE_EXT_FILTERS_HTTP_MESSAGE_COMPRESS_MESSAGE_COMPRESS_FILTER_H \
53
+ */
videochat2/lib/python3.10/site-packages/tensorflow/include/external/com_github_grpc_grpc/src/core/ext/filters/http/server/http_server_filter.h ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ *
3
+ * Copyright 2015 gRPC authors.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ *
17
+ */
18
+
19
+ #ifndef GRPC_CORE_EXT_FILTERS_HTTP_SERVER_HTTP_SERVER_FILTER_H
20
+ #define GRPC_CORE_EXT_FILTERS_HTTP_SERVER_HTTP_SERVER_FILTER_H
21
+
22
+ #include <grpc/support/port_platform.h>
23
+
24
+ #include "src/core/lib/channel/channel_stack.h"
25
+
26
+ /* Processes metadata on the server side for HTTP2 transports */
27
+ extern const grpc_channel_filter grpc_http_server_filter;
28
+
29
+ #endif /* GRPC_CORE_EXT_FILTERS_HTTP_SERVER_HTTP_SERVER_FILTER_H */