[misc] add `final` on a bunch of classes that should not have subclasses (#36212)

Closes #36212

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36212 from markdroth:subclass_final 7626ccd691
PiperOrigin-RevId: 620990528
pull/36217/head
Mark D. Roth 8 months ago committed by Copybara-Service
parent 899aed0156
commit 17a4a55da4
  1. 2
      src/core/client_channel/client_channel_channelz.h
  2. 38
      src/core/client_channel/client_channel_filter.cc
  3. 9
      src/core/client_channel/client_channel_filter.h
  4. 2
      src/core/client_channel/client_channel_internal.h
  5. 7
      src/core/client_channel/client_channel_service_config.h
  6. 2
      src/core/client_channel/config_selector.h
  7. 2
      src/core/client_channel/dynamic_filters.h
  8. 2
      src/core/client_channel/http_proxy_mapper.h
  9. 2
      src/core/client_channel/retry_filter.h
  10. 2
      src/core/client_channel/retry_filter_legacy_call_data.cc
  11. 6
      src/core/client_channel/retry_filter_legacy_call_data.h
  12. 6
      src/core/client_channel/retry_service_config.h
  13. 5
      src/core/client_channel/retry_throttle.h
  14. 2
      src/core/client_channel/subchannel.cc
  15. 8
      src/core/client_channel/subchannel.h
  16. 2
      src/core/client_channel/subchannel_pool_interface.h
  17. 4
      src/core/client_channel/subchannel_stream_client.h
  18. 5
      src/core/ext/xds/certificate_provider_store.h
  19. 4
      src/core/ext/xds/file_watcher_certificate_provider_factory.h
  20. 2
      src/core/ext/xds/xds_api.h
  21. 3
      src/core/ext/xds/xds_audit_logger_registry.cc
  22. 2
      src/core/ext/xds/xds_audit_logger_registry.h
  23. 2
      src/core/ext/xds/xds_bootstrap_grpc.cc
  24. 8
      src/core/ext/xds/xds_bootstrap_grpc.h
  25. 4
      src/core/ext/xds/xds_certificate_provider.cc
  26. 2
      src/core/ext/xds/xds_certificate_provider.h
  27. 3
      src/core/ext/xds/xds_channel_stack_modifier.h
  28. 20
      src/core/ext/xds/xds_client.cc
  29. 2
      src/core/ext/xds/xds_client.h
  30. 2
      src/core/ext/xds/xds_client_grpc.cc
  31. 2
      src/core/ext/xds/xds_client_grpc.h
  32. 7
      src/core/ext/xds/xds_client_stats.h
  33. 4
      src/core/ext/xds/xds_cluster_specifier_plugin.h
  34. 4
      src/core/ext/xds/xds_endpoint.h
  35. 4
      src/core/ext/xds/xds_health_status.h
  36. 2
      src/core/ext/xds/xds_http_fault_filter.h
  37. 4
      src/core/ext/xds/xds_http_filters.h
  38. 2
      src/core/ext/xds/xds_http_rbac_filter.h
  39. 2
      src/core/ext/xds/xds_http_stateful_session_filter.h
  40. 10
      src/core/ext/xds/xds_lb_policy_registry.cc
  41. 2
      src/core/ext/xds/xds_lb_policy_registry.h
  42. 2
      src/core/ext/xds/xds_listener.h
  43. 2
      src/core/ext/xds/xds_route_config.h
  44. 2
      src/core/ext/xds/xds_routing.h
  45. 22
      src/core/ext/xds/xds_server_config_fetcher.cc
  46. 2
      src/core/ext/xds/xds_transport_grpc.cc
  47. 6
      src/core/ext/xds/xds_transport_grpc.h
  48. 12
      src/core/lib/channel/channelz.h
  49. 2
      src/core/lib/channel/channelz_registry.h
  50. 4
      src/core/lib/surface/legacy_channel.cc
  51. 2
      src/core/lib/surface/legacy_channel.h
  52. 2
      src/core/load_balancing/address_filtering.cc
  53. 2
      src/core/load_balancing/address_filtering.h
  54. 2
      src/core/load_balancing/child_policy_handler.cc
  55. 2
      src/core/load_balancing/endpoint_list.cc
  56. 4
      src/core/load_balancing/grpclb/client_load_reporting_filter.h
  57. 31
      src/core/load_balancing/grpclb/grpclb.cc
  58. 2
      src/core/load_balancing/grpclb/grpclb_client_stats.h
  59. 6
      src/core/load_balancing/health_check_client.cc
  60. 6
      src/core/load_balancing/health_check_client_internal.h
  61. 4
      src/core/load_balancing/lb_policy.h
  62. 4
      src/core/load_balancing/lb_policy_registry.h
  63. 6
      src/core/load_balancing/oob_backend_metric.cc
  64. 4
      src/core/load_balancing/oob_backend_metric_internal.h
  65. 22
      src/core/load_balancing/outlier_detection/outlier_detection.cc
  66. 18
      src/core/load_balancing/pick_first/pick_first.cc
  67. 15
      src/core/load_balancing/priority/priority.cc
  68. 16
      src/core/load_balancing/ring_hash/ring_hash.cc
  69. 2
      src/core/load_balancing/ring_hash/ring_hash.h
  70. 26
      src/core/load_balancing/rls/rls.cc
  71. 12
      src/core/load_balancing/round_robin/round_robin.cc
  72. 2
      src/core/load_balancing/weighted_round_robin/static_stride_scheduler.h
  73. 18
      src/core/load_balancing/weighted_round_robin/weighted_round_robin.cc
  74. 14
      src/core/load_balancing/weighted_target/weighted_target.cc
  75. 8
      src/core/load_balancing/xds/cds.cc
  76. 18
      src/core/load_balancing/xds/xds_cluster_impl.cc
  77. 12
      src/core/load_balancing/xds/xds_cluster_manager.cc
  78. 23
      src/core/load_balancing/xds/xds_override_host.cc
  79. 2
      src/core/load_balancing/xds/xds_override_host.h
  80. 6
      src/core/load_balancing/xds/xds_wrr_locality.cc
  81. 4
      src/core/resolver/binder/binder_resolver.cc
  82. 15
      src/core/resolver/dns/c_ares/dns_resolver_ares.cc
  83. 4
      src/core/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc
  84. 6
      src/core/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc
  85. 2
      src/core/resolver/dns/c_ares/grpc_ares_wrapper.cc
  86. 4
      src/core/resolver/dns/event_engine/event_engine_client_channel_resolver.cc
  87. 4
      src/core/resolver/dns/event_engine/event_engine_client_channel_resolver.h
  88. 6
      src/core/resolver/dns/native/dns_resolver.cc
  89. 8
      src/core/resolver/endpoint_addresses.h
  90. 4
      src/core/resolver/fake/fake_resolver.cc
  91. 2
      src/core/resolver/fake/fake_resolver.h
  92. 7
      src/core/resolver/google_c2p/google_c2p_resolver.cc
  93. 4
      src/core/resolver/resolver_registry.h
  94. 12
      src/core/resolver/sockaddr/sockaddr_resolver.cc
  95. 14
      src/core/resolver/xds/xds_dependency_manager.cc
  96. 4
      src/core/resolver/xds/xds_dependency_manager.h
  97. 18
      src/core/resolver/xds/xds_resolver.cc
  98. 2
      src/core/resolver/xds/xds_resolver_attributes.h
  99. 2
      src/core/service_config/service_config_channel_arg_filter.cc
  100. 2
      src/core/service_config/service_config_parser.h

@ -41,7 +41,7 @@
namespace grpc_core {
namespace channelz {
class SubchannelNode : public BaseNode {
class SubchannelNode final : public BaseNode {
public:
SubchannelNode(std::string target_address, size_t channel_tracer_max_nodes);
~SubchannelNode() override;

@ -191,7 +191,7 @@ class ClientChannelFilter::CallData {
RefCountedPtr<DynamicFilters> dynamic_filters_;
};
class ClientChannelFilter::FilterBasedCallData
class ClientChannelFilter::FilterBasedCallData final
: public ClientChannelFilter::CallData {
public:
static grpc_error_handle Init(grpc_call_element* elem,
@ -311,7 +311,7 @@ class ClientChannelFilter::FilterBasedCallData
grpc_error_handle cancel_error_;
};
class ClientChannelFilter::PromiseBasedCallData
class ClientChannelFilter::PromiseBasedCallData final
: public ClientChannelFilter::CallData {
public:
explicit PromiseBasedCallData(ClientChannelFilter* chand) : chand_(chand) {}
@ -451,7 +451,7 @@ ClientChannelServiceConfigCallData* GetServiceConfigCallData(
context[GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA].value);
}
class DynamicTerminationFilter {
class DynamicTerminationFilter final {
public:
class CallData;
@ -496,7 +496,7 @@ class DynamicTerminationFilter {
ClientChannelFilter* chand_;
};
class DynamicTerminationFilter::CallData {
class DynamicTerminationFilter::CallData final {
public:
static grpc_error_handle Init(grpc_call_element* elem,
const grpc_call_element_args* args) {
@ -593,7 +593,7 @@ const grpc_channel_filter DynamicTerminationFilter::kFilterVtable = {
// ClientChannelFilter::ResolverResultHandler
//
class ClientChannelFilter::ResolverResultHandler
class ClientChannelFilter::ResolverResultHandler final
: public Resolver::ResultHandler {
public:
explicit ResolverResultHandler(ClientChannelFilter* chand) : chand_(chand) {
@ -628,7 +628,8 @@ class ClientChannelFilter::ResolverResultHandler
// underlying subchannel is shared between channels, this wrapper will only
// be used within one channel, so it will always be synchronized by the
// control plane work_serializer.
class ClientChannelFilter::SubchannelWrapper : public SubchannelInterface {
class ClientChannelFilter::SubchannelWrapper final
: public SubchannelInterface {
public:
SubchannelWrapper(ClientChannelFilter* chand,
RefCountedPtr<Subchannel> subchannel)
@ -771,7 +772,8 @@ class ClientChannelFilter::SubchannelWrapper : public SubchannelInterface {
// This class handles things like hopping into the WorkSerializer
// before passing notifications to the LB policy and propagating
// keepalive information betwen subchannels.
class WatcherWrapper : public Subchannel::ConnectivityStateWatcherInterface {
class WatcherWrapper final
: public Subchannel::ConnectivityStateWatcherInterface {
public:
WatcherWrapper(
std::unique_ptr<SubchannelInterface::ConnectivityStateWatcherInterface>
@ -1024,7 +1026,7 @@ void ClientChannelFilter::ExternalConnectivityWatcher::RemoveWatcherLocked() {
// ClientChannelFilter::ConnectivityWatcherAdder
//
class ClientChannelFilter::ConnectivityWatcherAdder {
class ClientChannelFilter::ConnectivityWatcherAdder final {
public:
ConnectivityWatcherAdder(
ClientChannelFilter* chand, grpc_connectivity_state initial_state,
@ -1057,7 +1059,7 @@ class ClientChannelFilter::ConnectivityWatcherAdder {
// ClientChannelFilter::ConnectivityWatcherRemover
//
class ClientChannelFilter::ConnectivityWatcherRemover {
class ClientChannelFilter::ConnectivityWatcherRemover final {
public:
ConnectivityWatcherRemover(ClientChannelFilter* chand,
AsyncConnectivityStateWatcherInterface* watcher)
@ -1087,7 +1089,7 @@ class ClientChannelFilter::ConnectivityWatcherRemover {
// ClientChannelFilter::ClientChannelControlHelper
//
class ClientChannelFilter::ClientChannelControlHelper
class ClientChannelFilter::ClientChannelControlHelper final
: public LoadBalancingPolicy::ChannelControlHelper {
public:
explicit ClientChannelControlHelper(ClientChannelFilter* chand)
@ -2478,7 +2480,8 @@ void ClientChannelFilter::FilterBasedCallData::PendingBatchesResume() {
// A class to handle the call combiner cancellation callback for a
// queued pick.
class ClientChannelFilter::FilterBasedCallData::ResolverQueuedCallCanceller {
class ClientChannelFilter::FilterBasedCallData::ResolverQueuedCallCanceller
final {
public:
explicit ResolverQueuedCallCanceller(FilterBasedCallData* calld)
: calld_(calld) {
@ -2599,7 +2602,7 @@ void ClientChannelFilter::FilterBasedCallData::
// ClientChannelFilter::LoadBalancedCall::LbCallState
//
class ClientChannelFilter::LoadBalancedCall::LbCallState
class ClientChannelFilter::LoadBalancedCall::LbCallState final
: public ClientChannelLbCallState {
public:
explicit LbCallState(LoadBalancedCall* lb_call) : lb_call_(lb_call) {}
@ -2621,7 +2624,7 @@ class ClientChannelFilter::LoadBalancedCall::LbCallState
// ClientChannelFilter::LoadBalancedCall::Metadata
//
class ClientChannelFilter::LoadBalancedCall::Metadata
class ClientChannelFilter::LoadBalancedCall::Metadata final
: public LoadBalancingPolicy::MetadataInterface {
public:
explicit Metadata(grpc_metadata_batch* batch) : batch_(batch) {}
@ -2661,7 +2664,7 @@ class ClientChannelFilter::LoadBalancedCall::Metadata
}
private:
class Encoder {
class Encoder final {
public:
void Encode(const Slice& key, const Slice& value) {
out_.emplace_back(std::string(key.as_string_view()),
@ -2714,7 +2717,7 @@ ClientChannelFilter::LoadBalancedCall::LbCallState::GetCallAttemptTracer()
// ClientChannelFilter::LoadBalancedCall::BackendMetricAccessor
//
class ClientChannelFilter::LoadBalancedCall::BackendMetricAccessor
class ClientChannelFilter::LoadBalancedCall::BackendMetricAccessor final
: public LoadBalancingPolicy::BackendMetricAccessor {
public:
BackendMetricAccessor(LoadBalancedCall* lb_call,
@ -2735,7 +2738,7 @@ class ClientChannelFilter::LoadBalancedCall::BackendMetricAccessor
}
private:
class BackendMetricAllocator : public BackendMetricAllocatorInterface {
class BackendMetricAllocator final : public BackendMetricAllocatorInterface {
public:
explicit BackendMetricAllocator(Arena* arena) : arena_(arena) {}
@ -3390,7 +3393,8 @@ void ClientChannelFilter::FilterBasedLoadBalancedCall::
// because there may be multiple LB picks happening in parallel.
// Instead, we will probably need to maintain a list in the CallData
// object of pending LB picks to be cancelled when the closure runs.
class ClientChannelFilter::FilterBasedLoadBalancedCall::LbQueuedCallCanceller {
class ClientChannelFilter::FilterBasedLoadBalancedCall::LbQueuedCallCanceller
final {
public:
explicit LbQueuedCallCanceller(
RefCountedPtr<FilterBasedLoadBalancedCall> lb_call)

@ -101,7 +101,7 @@
namespace grpc_core {
class ClientChannelFilter {
class ClientChannelFilter final {
public:
static const grpc_channel_filter kFilterVtableWithPromises;
static const grpc_channel_filter kFilterVtableWithoutPromises;
@ -184,7 +184,8 @@ class ClientChannelFilter {
// Represents a pending connectivity callback from an external caller
// via grpc_client_channel_watch_connectivity_state().
class ExternalConnectivityWatcher : public ConnectivityStateWatcherInterface {
class ExternalConnectivityWatcher final
: public ConnectivityStateWatcherInterface {
public:
ExternalConnectivityWatcher(ClientChannelFilter* chand,
grpc_polling_entity pollent,
@ -469,7 +470,7 @@ class ClientChannelFilter::LoadBalancedCall
grpc_call_context_element* const call_context_;
};
class ClientChannelFilter::FilterBasedLoadBalancedCall
class ClientChannelFilter::FilterBasedLoadBalancedCall final
: public ClientChannelFilter::LoadBalancedCall {
public:
// If on_call_destruction_complete is non-null, then it will be
@ -595,7 +596,7 @@ class ClientChannelFilter::FilterBasedLoadBalancedCall
grpc_transport_stream_op_batch* pending_batches_[MAX_PENDING_BATCHES] = {};
};
class ClientChannelFilter::PromiseBasedLoadBalancedCall
class ClientChannelFilter::PromiseBasedLoadBalancedCall final
: public ClientChannelFilter::LoadBalancedCall {
public:
PromiseBasedLoadBalancedCall(ClientChannelFilter* chand,

@ -54,7 +54,7 @@ class ClientChannelLbCallState : public LoadBalancingPolicy::CallState {
};
// Internal type for ServiceConfigCallData. Handles call commits.
class ClientChannelServiceConfigCallData : public ServiceConfigCallData {
class ClientChannelServiceConfigCallData final : public ServiceConfigCallData {
public:
ClientChannelServiceConfigCallData(Arena* arena,
grpc_call_context_element* call_context)

@ -41,7 +41,7 @@
namespace grpc_core {
namespace internal {
class ClientChannelGlobalParsedConfig
class ClientChannelGlobalParsedConfig final
: public ServiceConfigParser::ParsedConfig {
public:
RefCountedPtr<LoadBalancingPolicy::Config> parsed_lb_config() const {
@ -72,7 +72,7 @@ class ClientChannelGlobalParsedConfig
HealthCheckConfig health_check_config_;
};
class ClientChannelMethodParsedConfig
class ClientChannelMethodParsedConfig final
: public ServiceConfigParser::ParsedConfig {
public:
Duration timeout() const { return timeout_; }
@ -86,7 +86,8 @@ class ClientChannelMethodParsedConfig
absl::optional<bool> wait_for_ready_;
};
class ClientChannelServiceConfigParser : public ServiceConfigParser::Parser {
class ClientChannelServiceConfigParser final
: public ServiceConfigParser::Parser {
public:
absl::string_view name() const override { return parser_name(); }

@ -90,7 +90,7 @@ class ConfigSelector : public RefCounted<ConfigSelector> {
};
// Default ConfigSelector that gets the MethodConfig from the service config.
class DefaultConfigSelector : public ConfigSelector {
class DefaultConfigSelector final : public ConfigSelector {
public:
explicit DefaultConfigSelector(RefCountedPtr<ServiceConfig> service_config)
: service_config_(std::move(service_config)) {

@ -42,7 +42,7 @@
namespace grpc_core {
class DynamicFilters : public RefCounted<DynamicFilters> {
class DynamicFilters final : public RefCounted<DynamicFilters> {
public:
// Implements the interface of RefCounted<>.
class Call {

@ -33,7 +33,7 @@
namespace grpc_core {
class HttpProxyMapper : public ProxyMapperInterface {
class HttpProxyMapper final : public ProxyMapperInterface {
public:
static constexpr char const* kAddressProxyEnvVar = "GRPC_ADDRESS_HTTP_PROXY";
static constexpr char const* kAddressProxyEnabledAddressesEnvVar =

@ -48,7 +48,7 @@ extern grpc_core::TraceFlag grpc_retry_trace;
namespace grpc_core {
class RetryFilter {
class RetryFilter final {
public:
static const grpc_channel_filter kVtable;

@ -72,7 +72,7 @@ namespace grpc_core {
// those refs are not released until the LB call stack is destroyed.
// When this object is destroyed, it will invoke the
// on_call_stack_destruction closure from the surface.
class RetryFilter::LegacyCallData::CallStackDestructionBarrier
class RetryFilter::LegacyCallData::CallStackDestructionBarrier final
: public RefCounted<CallStackDestructionBarrier, PolymorphicRefCount,
UnrefCallDtor> {
public:

@ -54,7 +54,7 @@
namespace grpc_core {
class RetryFilter::LegacyCallData {
class RetryFilter::LegacyCallData final {
public:
static grpc_error_handle Init(grpc_call_element* elem,
const grpc_call_element_args* args);
@ -78,7 +78,7 @@ class RetryFilter::LegacyCallData {
};
// State associated with each call attempt.
class CallAttempt : public RefCounted<CallAttempt> {
class CallAttempt final : public RefCounted<CallAttempt> {
public:
CallAttempt(LegacyCallData* calld, bool is_transparent_retry);
~CallAttempt() override;
@ -102,7 +102,7 @@ class RetryFilter::LegacyCallData {
// structures needed to populate the ops in the batch.
// We allocate one struct on the arena for each attempt at starting a
// batch on a given LB call.
class BatchData
class BatchData final
: public RefCounted<BatchData, PolymorphicRefCount, UnrefCallDtor> {
public:
BatchData(RefCountedPtr<CallAttempt> call_attempt, int refcount,

@ -40,7 +40,7 @@
namespace grpc_core {
namespace internal {
class RetryGlobalConfig : public ServiceConfigParser::ParsedConfig {
class RetryGlobalConfig final : public ServiceConfigParser::ParsedConfig {
public:
uintptr_t max_milli_tokens() const { return max_milli_tokens_; }
uintptr_t milli_token_ratio() const { return milli_token_ratio_; }
@ -54,7 +54,7 @@ class RetryGlobalConfig : public ServiceConfigParser::ParsedConfig {
uintptr_t milli_token_ratio_ = 0;
};
class RetryMethodConfig : public ServiceConfigParser::ParsedConfig {
class RetryMethodConfig final : public ServiceConfigParser::ParsedConfig {
public:
int max_attempts() const { return max_attempts_; }
Duration initial_backoff() const { return initial_backoff_; }
@ -80,7 +80,7 @@ class RetryMethodConfig : public ServiceConfigParser::ParsedConfig {
absl::optional<Duration> per_attempt_recv_timeout_;
};
class RetryServiceConfigParser : public ServiceConfigParser::Parser {
class RetryServiceConfigParser final : public ServiceConfigParser::Parser {
public:
absl::string_view name() const override { return parser_name(); }

@ -38,7 +38,8 @@ namespace grpc_core {
namespace internal {
/// Tracks retry throttling data for an individual server name.
class ServerRetryThrottleData : public RefCounted<ServerRetryThrottleData> {
class ServerRetryThrottleData final
: public RefCounted<ServerRetryThrottleData> {
public:
ServerRetryThrottleData(uintptr_t max_milli_tokens,
uintptr_t milli_token_ratio,
@ -68,7 +69,7 @@ class ServerRetryThrottleData : public RefCounted<ServerRetryThrottleData> {
};
/// Global map of server name to retry throttle data.
class ServerRetryThrottleMap {
class ServerRetryThrottleMap final {
public:
static ServerRetryThrottleMap* Get();

@ -328,7 +328,7 @@ void SubchannelCall::IncrementRefCount(const DebugLocation& /*location*/,
// Subchannel::ConnectedSubchannelStateWatcher
//
class Subchannel::ConnectedSubchannelStateWatcher
class Subchannel::ConnectedSubchannelStateWatcher final
: public AsyncConnectivityStateWatcherInterface {
public:
// Must be instantiated while holding c->mu.

@ -65,7 +65,7 @@ namespace grpc_core {
class SubchannelCall;
class ConnectedSubchannel : public RefCounted<ConnectedSubchannel> {
class ConnectedSubchannel final : public RefCounted<ConnectedSubchannel> {
public:
ConnectedSubchannel(
grpc_channel_stack* channel_stack, const ChannelArgs& args,
@ -96,7 +96,7 @@ class ConnectedSubchannel : public RefCounted<ConnectedSubchannel> {
};
// Implements the interface of RefCounted<>.
class SubchannelCall {
class SubchannelCall final {
public:
struct Args {
RefCountedPtr<ConnectedSubchannel> connected_subchannel;
@ -166,7 +166,7 @@ class SubchannelCall {
// different from the SubchannelInterface that is exposed to LB policy
// implementations. The client channel provides an adaptor class
// (SubchannelWrapper) that "converts" between the two.
class Subchannel : public DualRefCounted<Subchannel> {
class Subchannel final : public DualRefCounted<Subchannel> {
public:
// TODO(roth): Once we remove pollset_set, consider whether this can
// just use the normal AsyncConnectivityStateWatcherInterface API.
@ -279,7 +279,7 @@ class Subchannel : public DualRefCounted<Subchannel> {
// A linked list of ConnectivityStateWatcherInterfaces that are monitoring
// the subchannel's state.
class ConnectivityStateWatcherList {
class ConnectivityStateWatcherList final {
public:
explicit ConnectivityStateWatcherList(Subchannel* subchannel)
: subchannel_(subchannel) {}

@ -39,7 +39,7 @@ class Subchannel;
extern TraceFlag grpc_subchannel_pool_trace;
// A key that can uniquely identify a subchannel.
class SubchannelKey {
class SubchannelKey final {
public:
SubchannelKey(const grpc_resolved_address& address, const ChannelArgs& args);

@ -61,7 +61,7 @@ namespace grpc_core {
//
// Currently, this assumes server-side streaming, but it could be extended
// to support full bidi streaming if there is a need in the future.
class SubchannelStreamClient
class SubchannelStreamClient final
: public InternallyRefCounted<SubchannelStreamClient> {
public:
// Interface implemented by caller. Thread safety is provided for the
@ -112,7 +112,7 @@ class SubchannelStreamClient
private:
// Contains a call to the backend and all the data related to the call.
class CallState : public Orphanable {
class CallState final : public Orphanable {
public:
CallState(RefCountedPtr<SubchannelStreamClient> client,
grpc_pollset_set* interested_parties);

@ -46,7 +46,7 @@
namespace grpc_core {
// Map for xDS based grpc_tls_certificate_provider instances.
class CertificateProviderStore
class CertificateProviderStore final
: public InternallyRefCounted<CertificateProviderStore> {
public:
struct PluginDefinition {
@ -77,7 +77,8 @@ class CertificateProviderStore
private:
// A thin wrapper around `grpc_tls_certificate_provider` which allows removing
// the entry from the CertificateProviderStore when the refcount reaches zero.
class CertificateProviderWrapper : public grpc_tls_certificate_provider {
class CertificateProviderWrapper final
: public grpc_tls_certificate_provider {
public:
CertificateProviderWrapper(
RefCountedPtr<grpc_tls_certificate_provider> certificate_provider,

@ -37,10 +37,10 @@
namespace grpc_core {
class FileWatcherCertificateProviderFactory
class FileWatcherCertificateProviderFactory final
: public CertificateProviderFactory {
public:
class Config : public CertificateProviderFactory::Config {
class Config final : public CertificateProviderFactory::Config {
public:
absl::string_view name() const override;

@ -48,7 +48,7 @@ class XdsClient;
// - ADS request/response handling
// - LRS request/response handling
// - CSDS response generation
class XdsApi {
class XdsApi final {
public:
// Interface defined by caller and passed to ParseAdsResponse().
class AdsResponseParserInterface {

@ -39,7 +39,8 @@ namespace {
using experimental::AuditLoggerRegistry;
class StdoutLoggerConfigFactory : public XdsAuditLoggerRegistry::ConfigFactory {
class StdoutLoggerConfigFactory final
: public XdsAuditLoggerRegistry::ConfigFactory {
public:
Json::Object ConvertXdsAuditLoggerConfig(
const XdsResourceType::DecodeContext& /*context*/,

@ -33,7 +33,7 @@ namespace grpc_core {
// A registry that maintains a set of converters that are able to map xDS
// RBAC audit logger configuration to gRPC's JSON format.
class XdsAuditLoggerRegistry {
class XdsAuditLoggerRegistry final {
public:
class ConfigFactory {
public:

@ -254,7 +254,7 @@ absl::StatusOr<std::unique_ptr<GrpcXdsBootstrap>> GrpcXdsBootstrap::Create(
"Failed to parse bootstrap JSON string: ", json.status().ToString()));
}
// Validate JSON.
class XdsJsonArgs : public JsonArgs {
class XdsJsonArgs final : public JsonArgs {
public:
bool IsEnabled(absl::string_view key) const override {
if (key == "federation") return XdsFederationEnabled();

@ -44,9 +44,9 @@
namespace grpc_core {
class GrpcXdsBootstrap : public XdsBootstrap {
class GrpcXdsBootstrap final : public XdsBootstrap {
public:
class GrpcNode : public Node {
class GrpcNode final : public Node {
public:
const std::string& id() const override { return id_; }
const std::string& cluster() const override { return cluster_; }
@ -76,7 +76,7 @@ class GrpcXdsBootstrap : public XdsBootstrap {
Json::Object metadata_;
};
class GrpcXdsServer : public XdsServer {
class GrpcXdsServer final : public XdsServer {
public:
const std::string& server_uri() const override { return server_uri_; }
@ -102,7 +102,7 @@ class GrpcXdsBootstrap : public XdsBootstrap {
std::set<std::string> server_features_;
};
class GrpcAuthority : public Authority {
class GrpcAuthority final : public Authority {
public:
std::vector<const XdsServer*> servers() const override {
std::vector<const XdsServer*> servers;

@ -35,7 +35,7 @@ namespace grpc_core {
namespace {
class RootCertificatesWatcher
class RootCertificatesWatcher final
: public grpc_tls_certificate_distributor::TlsCertificatesWatcherInterface {
public:
// Takes a ref to \a parent instead of a raw pointer since the watcher is
@ -68,7 +68,7 @@ class RootCertificatesWatcher
RefCountedPtr<grpc_tls_certificate_distributor> parent_;
};
class IdentityCertificatesWatcher
class IdentityCertificatesWatcher final
: public grpc_tls_certificate_distributor::TlsCertificatesWatcherInterface {
public:
// Takes a ref to \a parent instead of a raw pointer since the watcher is

@ -42,7 +42,7 @@
namespace grpc_core {
class XdsCertificateProvider : public grpc_tls_certificate_provider {
class XdsCertificateProvider final : public grpc_tls_certificate_provider {
public:
// ctor for client side
XdsCertificateProvider(

@ -39,7 +39,8 @@ namespace grpc_core {
// XdsChannelStackModifier allows for inserting xDS HTTP filters into the
// channel stack. It is registered to mutate the `ChannelStackBuilder` object
// via ChannelInit::Builder::RegisterPostProcessor.
class XdsChannelStackModifier : public RefCounted<XdsChannelStackModifier> {
class XdsChannelStackModifier final
: public RefCounted<XdsChannelStackModifier> {
public:
explicit XdsChannelStackModifier(
std::vector<const grpc_channel_filter*> filters)

@ -76,7 +76,7 @@ TraceFlag grpc_xds_client_refcount_trace(false, "xds_client_refcount");
// An xds call wrapper that can restart a call upon failure. Holds a ref to
// the xds channel. The template parameter is the kind of wrapped xds call.
template <typename T>
class XdsClient::XdsChannel::RetryableCall
class XdsClient::XdsChannel::RetryableCall final
: public InternallyRefCounted<RetryableCall<T>> {
public:
explicit RetryableCall(WeakRefCountedPtr<XdsChannel> xds_channel);
@ -114,7 +114,8 @@ class XdsClient::XdsChannel::RetryableCall
};
// Contains an ADS call to the xds server.
class XdsClient::XdsChannel::AdsCall : public InternallyRefCounted<AdsCall> {
class XdsClient::XdsChannel::AdsCall final
: public InternallyRefCounted<AdsCall> {
public:
// The ctor and dtor should not be used directly.
explicit AdsCall(RefCountedPtr<RetryableCall<AdsCall>> retryable_call);
@ -140,7 +141,7 @@ class XdsClient::XdsChannel::AdsCall : public InternallyRefCounted<AdsCall> {
private:
class AdsReadDelayHandle;
class AdsResponseParser : public XdsApi::AdsResponseParserInterface {
class AdsResponseParser final : public XdsApi::AdsResponseParserInterface {
public:
struct Result {
const XdsResourceType* type;
@ -178,7 +179,7 @@ class XdsClient::XdsChannel::AdsCall : public InternallyRefCounted<AdsCall> {
Result result_;
};
class ResourceTimer : public InternallyRefCounted<ResourceTimer> {
class ResourceTimer final : public InternallyRefCounted<ResourceTimer> {
public:
ResourceTimer(const XdsResourceType* type, const XdsResourceName& name)
: type_(type), name_(name) {}
@ -291,7 +292,7 @@ class XdsClient::XdsChannel::AdsCall : public InternallyRefCounted<AdsCall> {
ABSL_GUARDED_BY(&XdsClient::mu_);
};
class StreamEventHandler
class StreamEventHandler final
: public XdsTransportFactory::XdsTransport::StreamingCall::EventHandler {
public:
explicit StreamEventHandler(RefCountedPtr<AdsCall> ads_call)
@ -354,7 +355,8 @@ class XdsClient::XdsChannel::AdsCall : public InternallyRefCounted<AdsCall> {
};
// Contains an LRS call to the xds server.
class XdsClient::XdsChannel::LrsCall : public InternallyRefCounted<LrsCall> {
class XdsClient::XdsChannel::LrsCall final
: public InternallyRefCounted<LrsCall> {
public:
// The ctor and dtor should not be used directly.
explicit LrsCall(RefCountedPtr<RetryableCall<LrsCall>> retryable_call);
@ -367,7 +369,7 @@ class XdsClient::XdsChannel::LrsCall : public InternallyRefCounted<LrsCall> {
bool seen_response() const { return seen_response_; }
private:
class StreamEventHandler
class StreamEventHandler final
: public XdsTransportFactory::XdsTransport::StreamingCall::EventHandler {
public:
explicit StreamEventHandler(RefCountedPtr<LrsCall> lrs_call)
@ -386,7 +388,7 @@ class XdsClient::XdsChannel::LrsCall : public InternallyRefCounted<LrsCall> {
};
// A repeating timer for a particular duration.
class Timer : public InternallyRefCounted<Timer> {
class Timer final : public InternallyRefCounted<Timer> {
public:
explicit Timer(RefCountedPtr<LrsCall> lrs_call)
: lrs_call_(std::move(lrs_call)) {}
@ -700,7 +702,7 @@ void XdsClient::XdsChannel::RetryableCall<T>::OnRetryTimer() {
// XdsClient::XdsChannel::AdsCall::AdsReadDelayHandle
//
class XdsClient::XdsChannel::AdsCall::AdsReadDelayHandle
class XdsClient::XdsChannel::AdsCall::AdsReadDelayHandle final
: public XdsClient::ReadDelayHandle {
public:
explicit AdsReadDelayHandle(RefCountedPtr<AdsCall> ads_call)

@ -208,7 +208,7 @@ class XdsClient : public DualRefCounted<XdsClient> {
// Contains a channel to the xds server and all the data related to the
// channel. Holds a ref to the xds client object.
class XdsChannel : public DualRefCounted<XdsChannel> {
class XdsChannel final : public DualRefCounted<XdsChannel> {
public:
template <typename T>
class RetryableCall;

@ -140,7 +140,7 @@ const auto kMetricResources =
// GrpcXdsClient::MetricsReporter
//
class GrpcXdsClient::MetricsReporter : public XdsMetricsReporter {
class GrpcXdsClient::MetricsReporter final : public XdsMetricsReporter {
public:
explicit MetricsReporter(GrpcXdsClient& xds_client)
: xds_client_(xds_client) {}

@ -40,7 +40,7 @@
namespace grpc_core {
class GrpcXdsClient : public XdsClient {
class GrpcXdsClient final : public XdsClient {
public:
// The key to pass to GetOrCreate() for gRPC servers.
static constexpr absl::string_view kServerKey = "#server";

@ -45,7 +45,7 @@ namespace grpc_core {
class XdsClient;
// Locality name.
class XdsLocalityName : public RefCounted<XdsLocalityName> {
class XdsLocalityName final : public RefCounted<XdsLocalityName> {
public:
struct Less {
bool operator()(const XdsLocalityName* lhs,
@ -115,7 +115,7 @@ class XdsLocalityName : public RefCounted<XdsLocalityName> {
};
// Drop stats for an xds cluster.
class XdsClusterDropStats : public RefCounted<XdsClusterDropStats> {
class XdsClusterDropStats final : public RefCounted<XdsClusterDropStats> {
public:
// The total number of requests dropped for any reason is the sum of
// uncategorized_drops, and dropped_requests map.
@ -169,7 +169,8 @@ class XdsClusterDropStats : public RefCounted<XdsClusterDropStats> {
};
// Locality stats for an xds cluster.
class XdsClusterLocalityStats : public RefCounted<XdsClusterLocalityStats> {
class XdsClusterLocalityStats final
: public RefCounted<XdsClusterLocalityStats> {
public:
struct BackendMetric {
uint64_t num_requests_finished_with_metric = 0;

@ -49,7 +49,7 @@ class XdsClusterSpecifierPluginImpl {
ValidationErrors* errors) const = 0;
};
class XdsRouteLookupClusterSpecifierPlugin
class XdsRouteLookupClusterSpecifierPlugin final
: public XdsClusterSpecifierPluginImpl {
absl::string_view ConfigProtoName() const override;
@ -60,7 +60,7 @@ class XdsRouteLookupClusterSpecifierPlugin
ValidationErrors* errors) const override;
};
class XdsClusterSpecifierPluginRegistry {
class XdsClusterSpecifierPluginRegistry final {
public:
XdsClusterSpecifierPluginRegistry();

@ -71,7 +71,7 @@ struct XdsEndpointResource : public XdsResourceType::ResourceData {
// 1. to initialize in the control plane combiner;
// 2. to use in the data plane combiner.
// So no additional synchronization is needed.
class DropConfig : public RefCounted<DropConfig> {
class DropConfig final : public RefCounted<DropConfig> {
public:
struct DropCategory {
bool operator==(const DropCategory& other) const {
@ -130,7 +130,7 @@ struct XdsEndpointResource : public XdsResourceType::ResourceData {
std::string ToString() const;
};
class XdsEndpointResourceType
class XdsEndpointResourceType final
: public XdsResourceTypeImpl<XdsEndpointResourceType, XdsEndpointResource> {
public:
absl::string_view type_url() const override {

@ -34,7 +34,7 @@
namespace grpc_core {
class XdsHealthStatus {
class XdsHealthStatus final {
public:
enum HealthStatus { kUnknown, kHealthy, kDraining };
@ -56,7 +56,7 @@ class XdsHealthStatus {
HealthStatus status_;
};
class XdsHealthStatusSet {
class XdsHealthStatusSet final {
public:
XdsHealthStatusSet() = default;

@ -33,7 +33,7 @@
namespace grpc_core {
class XdsHttpFaultFilter : public XdsHttpFilterImpl {
class XdsHttpFaultFilter final : public XdsHttpFilterImpl {
public:
absl::string_view ConfigProtoName() const override;
absl::string_view OverrideConfigProtoName() const override;

@ -124,7 +124,7 @@ class XdsHttpFilterImpl {
virtual bool IsTerminalFilter() const { return false; }
};
class XdsHttpRouterFilter : public XdsHttpFilterImpl {
class XdsHttpRouterFilter final : public XdsHttpFilterImpl {
public:
absl::string_view ConfigProtoName() const override;
absl::string_view OverrideConfigProtoName() const override;
@ -147,7 +147,7 @@ class XdsHttpRouterFilter : public XdsHttpFilterImpl {
bool IsTerminalFilter() const override { return true; }
};
class XdsHttpFilterRegistry {
class XdsHttpFilterRegistry final {
public:
explicit XdsHttpFilterRegistry(bool register_builtins = true);

@ -33,7 +33,7 @@
namespace grpc_core {
class XdsHttpRbacFilter : public XdsHttpFilterImpl {
class XdsHttpRbacFilter final : public XdsHttpFilterImpl {
public:
absl::string_view ConfigProtoName() const override;
absl::string_view OverrideConfigProtoName() const override;

@ -33,7 +33,7 @@
namespace grpc_core {
class XdsHttpStatefulSessionFilter : public XdsHttpFilterImpl {
class XdsHttpStatefulSessionFilter final : public XdsHttpFilterImpl {
public:
absl::string_view ConfigProtoName() const override;
absl::string_view OverrideConfigProtoName() const override;

@ -46,7 +46,7 @@ namespace grpc_core {
namespace {
class RoundRobinLbPolicyConfigFactory
class RoundRobinLbPolicyConfigFactory final
: public XdsLbPolicyRegistry::ConfigFactory {
public:
Json::Object ConvertXdsLbPolicyConfig(
@ -64,7 +64,7 @@ class RoundRobinLbPolicyConfigFactory
}
};
class ClientSideWeightedRoundRobinLbPolicyConfigFactory
class ClientSideWeightedRoundRobinLbPolicyConfigFactory final
: public XdsLbPolicyRegistry::ConfigFactory {
public:
Json::Object ConvertXdsLbPolicyConfig(
@ -151,7 +151,7 @@ class ClientSideWeightedRoundRobinLbPolicyConfigFactory
}
};
class RingHashLbPolicyConfigFactory
class RingHashLbPolicyConfigFactory final
: public XdsLbPolicyRegistry::ConfigFactory {
public:
Json::Object ConvertXdsLbPolicyConfig(
@ -216,7 +216,7 @@ class RingHashLbPolicyConfigFactory
}
};
class WrrLocalityLbPolicyConfigFactory
class WrrLocalityLbPolicyConfigFactory final
: public XdsLbPolicyRegistry::ConfigFactory {
public:
Json::Object ConvertXdsLbPolicyConfig(
@ -255,7 +255,7 @@ class WrrLocalityLbPolicyConfigFactory
}
};
class PickFirstLbPolicyConfigFactory
class PickFirstLbPolicyConfigFactory final
: public XdsLbPolicyRegistry::ConfigFactory {
public:
Json::Object ConvertXdsLbPolicyConfig(

@ -33,7 +33,7 @@ namespace grpc_core {
// A registry that maintans a set of converters that are able to map xDS
// loadbalancing policy configurations to gRPC's JSON format.
class XdsLbPolicyRegistry {
class XdsLbPolicyRegistry final {
public:
class ConfigFactory {
public:

@ -207,7 +207,7 @@ struct XdsListenerResource : public XdsResourceType::ResourceData {
std::string ToString() const;
};
class XdsListenerResourceType
class XdsListenerResourceType final
: public XdsResourceTypeImpl<XdsListenerResourceType, XdsListenerResource> {
public:
absl::string_view type_url() const override {

@ -227,7 +227,7 @@ struct XdsRouteConfigResource : public XdsResourceType::ResourceData {
ValidationErrors* errors);
};
class XdsRouteConfigResourceType
class XdsRouteConfigResourceType final
: public XdsResourceTypeImpl<XdsRouteConfigResourceType,
XdsRouteConfigResource> {
public:

@ -39,7 +39,7 @@
namespace grpc_core {
class XdsRouting {
class XdsRouting final {
public:
class VirtualHostListIterator {
public:

@ -99,7 +99,7 @@ TraceFlag grpc_xds_server_config_fetcher_trace(false,
// A server config fetcher that fetches the information for configuring server
// listeners from the xDS control plane.
class XdsServerConfigFetcher : public grpc_server_config_fetcher {
class XdsServerConfigFetcher final : public grpc_server_config_fetcher {
public:
XdsServerConfigFetcher(RefCountedPtr<GrpcXdsClient> xds_client,
grpc_server_xds_status_notifier notifier);
@ -140,7 +140,7 @@ class XdsServerConfigFetcher : public grpc_server_config_fetcher {
// continues to be used. If there isn't any previous good update or if the
// update received was a fatal error (resource does not exist), the server
// listener is made to stop listening.
class XdsServerConfigFetcher::ListenerWatcher
class XdsServerConfigFetcher::ListenerWatcher final
: public XdsListenerResourceType::WatcherInterface {
public:
ListenerWatcher(RefCountedPtr<GrpcXdsClient> xds_client,
@ -200,7 +200,7 @@ class XdsServerConfigFetcher::ListenerWatcher
// appropriate filter chain from the xDS Listener resource and injects channel
// args that configure the right mTLS certs and cause the right set of HTTP
// filters to be injected.
class XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager
class XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager final
: public grpc_server_config_fetcher::ConnectionManager {
public:
FilterChainMatchManager(RefCountedPtr<GrpcXdsClient> xds_client,
@ -280,7 +280,8 @@ class XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager
// with the latest updates and new connections do not need to wait for the RDS
// resources to be fetched.
class XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
RouteConfigWatcher : public XdsRouteConfigResourceType::WatcherInterface {
RouteConfigWatcher final
: public XdsRouteConfigResourceType::WatcherInterface {
public:
RouteConfigWatcher(
std::string resource_name,
@ -316,7 +317,7 @@ class XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
// DynamicXdsServerConfigSelectorProvider to parse the RDS update and get
// per-call configuration based on incoming metadata.
class XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
XdsServerConfigSelector : public ServerConfigSelector {
XdsServerConfigSelector final : public ServerConfigSelector {
public:
static absl::StatusOr<RefCountedPtr<XdsServerConfigSelector>> Create(
const XdsHttpFilterRegistry& http_filter_registry,
@ -340,7 +341,7 @@ class XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
RefCountedPtr<ServiceConfig> method_config;
};
class RouteListIterator : public XdsRouting::RouteListIterator {
class RouteListIterator final : public XdsRouting::RouteListIterator {
public:
explicit RouteListIterator(const std::vector<Route>* routes)
: routes_(routes) {}
@ -360,7 +361,8 @@ class XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
std::vector<Route> routes;
};
class VirtualHostListIterator : public XdsRouting::VirtualHostListIterator {
class VirtualHostListIterator final
: public XdsRouting::VirtualHostListIterator {
public:
explicit VirtualHostListIterator(
const std::vector<VirtualHost>* virtual_hosts)
@ -383,7 +385,7 @@ class XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
// An XdsServerConfigSelectorProvider implementation for when the
// RouteConfiguration is available inline.
class XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
StaticXdsServerConfigSelectorProvider
StaticXdsServerConfigSelectorProvider final
: public ServerConfigSelectorProvider {
public:
StaticXdsServerConfigSelectorProvider(
@ -434,7 +436,7 @@ class XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
// An XdsServerConfigSelectorProvider implementation for when the
// RouteConfiguration is to be fetched separately via RDS.
class XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
DynamicXdsServerConfigSelectorProvider
DynamicXdsServerConfigSelectorProvider final
: public ServerConfigSelectorProvider {
public:
DynamicXdsServerConfigSelectorProvider(
@ -480,7 +482,7 @@ class XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
// A watcher implementation for updating the RDS resource used by
// DynamicXdsServerConfigSelectorProvider
class XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
DynamicXdsServerConfigSelectorProvider::RouteConfigWatcher
DynamicXdsServerConfigSelectorProvider::RouteConfigWatcher final
: public XdsRouteConfigResourceType::WatcherInterface {
public:
explicit RouteConfigWatcher(

@ -227,7 +227,7 @@ void GrpcXdsTransportFactory::GrpcXdsTransport::GrpcStreamingCall::
// GrpcXdsTransportFactory::GrpcXdsTransport::StateWatcher
//
class GrpcXdsTransportFactory::GrpcXdsTransport::StateWatcher
class GrpcXdsTransportFactory::GrpcXdsTransport::StateWatcher final
: public AsyncConnectivityStateWatcherInterface {
public:
explicit StateWatcher(

@ -41,7 +41,7 @@
namespace grpc_core {
class GrpcXdsTransportFactory : public XdsTransportFactory {
class GrpcXdsTransportFactory final : public XdsTransportFactory {
public:
class GrpcXdsTransport;
@ -62,7 +62,7 @@ class GrpcXdsTransportFactory : public XdsTransportFactory {
grpc_pollset_set* interested_parties_;
};
class GrpcXdsTransportFactory::GrpcXdsTransport
class GrpcXdsTransportFactory::GrpcXdsTransport final
: public XdsTransportFactory::XdsTransport {
public:
class GrpcStreamingCall;
@ -88,7 +88,7 @@ class GrpcXdsTransportFactory::GrpcXdsTransport
StateWatcher* watcher_;
};
class GrpcXdsTransportFactory::GrpcXdsTransport::GrpcStreamingCall
class GrpcXdsTransportFactory::GrpcXdsTransport::GrpcStreamingCall final
: public XdsTransportFactory::XdsTransport::StreamingCall {
public:
GrpcStreamingCall(RefCountedPtr<GrpcXdsTransportFactory> factory,

@ -120,7 +120,7 @@ class BaseNode : public RefCounted<BaseNode> {
// - track calls_{started,succeeded,failed}
// - track last_call_started_timestamp
// - perform rendering of the above items
class CallCountingHelper {
class CallCountingHelper final {
public:
void RecordCallStarted();
void RecordCallFailed();
@ -139,7 +139,7 @@ class CallCountingHelper {
std::atomic<gpr_cycle_counter> last_call_started_cycle_{0};
};
class PerCpuCallCountingHelper {
class PerCpuCallCountingHelper final {
public:
void RecordCallStarted();
void RecordCallFailed();
@ -183,7 +183,7 @@ class PerCpuCallCountingHelper {
};
// Handles channelz bookkeeping for channels
class ChannelNode : public BaseNode {
class ChannelNode final : public BaseNode {
public:
ChannelNode(std::string target, size_t channel_tracer_max_nodes,
bool is_internal_channel);
@ -247,7 +247,7 @@ class ChannelNode : public BaseNode {
};
// Handles channelz bookkeeping for servers
class ServerNode : public BaseNode {
class ServerNode final : public BaseNode {
public:
explicit ServerNode(size_t channel_tracer_max_nodes);
@ -291,7 +291,7 @@ class ServerNode : public BaseNode {
#define GRPC_ARG_CHANNELZ_SECURITY "grpc.internal.channelz_security"
// Handles channelz bookkeeping for sockets
class SocketNode : public BaseNode {
class SocketNode final : public BaseNode {
public:
struct Security : public RefCounted<Security> {
struct Tls {
@ -367,7 +367,7 @@ class SocketNode : public BaseNode {
};
// Handles channelz bookkeeping for listen sockets
class ListenSocketNode : public BaseNode {
class ListenSocketNode final : public BaseNode {
public:
ListenSocketNode(std::string local_addr, std::string name);
~ListenSocketNode() override {}

@ -36,7 +36,7 @@ namespace channelz {
// singleton registry object to track all objects that are needed to support
// channelz bookkeeping. All objects share globally distributed uuids.
class ChannelzRegistry {
class ChannelzRegistry final {
public:
static void Register(BaseNode* node) {
return Default()->InternalRegister(node);

@ -214,7 +214,7 @@ bool LegacyChannel::SupportsConnectivityWatcher() const {
}
// A fire-and-forget object to handle external connectivity state watches.
class LegacyChannel::StateWatcher : public DualRefCounted<StateWatcher> {
class LegacyChannel::StateWatcher final : public DualRefCounted<StateWatcher> {
public:
StateWatcher(RefCountedPtr<LegacyChannel> channel, grpc_completion_queue* cq,
void* tag, grpc_connectivity_state last_observed_state,
@ -254,7 +254,7 @@ class LegacyChannel::StateWatcher : public DualRefCounted<StateWatcher> {
private:
// A fire-and-forget object used to delay starting the timer until the
// ClientChannelFilter actually starts the watch.
class WatcherTimerInitState {
class WatcherTimerInitState final {
public:
WatcherTimerInitState(StateWatcher* state_watcher, Timestamp deadline)
: state_watcher_(state_watcher), deadline_(deadline) {

@ -44,7 +44,7 @@
namespace grpc_core {
class LegacyChannel : public Channel {
class LegacyChannel final : public Channel {
public:
static absl::StatusOr<OrphanablePtr<Channel>> Create(
std::string target, ChannelArgs args,

@ -47,7 +47,7 @@ int HierarchicalPathArg::ChannelArgsCompare(const HierarchicalPathArg* a,
namespace {
class HierarchicalAddressIterator : public EndpointAddressesIterator {
class HierarchicalAddressIterator final : public EndpointAddressesIterator {
public:
HierarchicalAddressIterator(
std::shared_ptr<EndpointAddressesIterator> parent_it,

@ -87,7 +87,7 @@ namespace grpc_core {
// An address channel arg containing the hierarchical path
// to be associated with the address.
class HierarchicalPathArg : public RefCounted<HierarchicalPathArg> {
class HierarchicalPathArg final : public RefCounted<HierarchicalPathArg> {
public:
explicit HierarchicalPathArg(std::vector<RefCountedStringValue> path)
: path_(std::move(path)) {}

@ -44,7 +44,7 @@ namespace grpc_core {
// ChildPolicyHandler::Helper
//
class ChildPolicyHandler::Helper
class ChildPolicyHandler::Helper final
: public LoadBalancingPolicy::ParentOwningDelegatingChannelControlHelper<
ChildPolicyHandler> {
public:

@ -51,7 +51,7 @@ namespace grpc_core {
// EndpointList::Endpoint::Helper
//
class EndpointList::Endpoint::Helper
class EndpointList::Endpoint::Helper final
: public LoadBalancingPolicy::DelegatingChannelControlHelper {
public:
explicit Helper(RefCountedPtr<Endpoint> endpoint)

@ -30,7 +30,8 @@
#include "src/core/lib/transport/transport.h"
namespace grpc_core {
class ClientLoadReportingFilter : public ChannelFilter {
class ClientLoadReportingFilter final : public ChannelFilter {
public:
static const grpc_channel_filter kFilter;
@ -41,6 +42,7 @@ class ClientLoadReportingFilter : public ChannelFilter {
ArenaPromise<ServerMetadataHandle> MakeCallPromise(
CallArgs call_args, NextPromiseFactory next_promise_factory) override;
};
} // namespace grpc_core
#endif // GRPC_SRC_CORE_LOAD_BALANCING_GRPCLB_CLIENT_LOAD_REPORTING_FILTER_H

@ -165,7 +165,7 @@ using ::grpc_event_engine::experimental::EventEngine;
constexpr absl::string_view kGrpclb = "grpclb";
class GrpcLbConfig : public LoadBalancingPolicy::Config {
class GrpcLbConfig final : public LoadBalancingPolicy::Config {
public:
GrpcLbConfig() = default;
@ -222,7 +222,7 @@ class GrpcLbConfig : public LoadBalancingPolicy::Config {
std::string service_name_;
};
class GrpcLb : public LoadBalancingPolicy {
class GrpcLb final : public LoadBalancingPolicy {
public:
explicit GrpcLb(Args args);
@ -233,7 +233,8 @@ class GrpcLb : public LoadBalancingPolicy {
private:
/// Contains a call to the LB server and all the data related to the call.
class BalancerCallState : public InternallyRefCounted<BalancerCallState> {
class BalancerCallState final
: public InternallyRefCounted<BalancerCallState> {
public:
explicit BalancerCallState(
RefCountedPtr<LoadBalancingPolicy> parent_grpclb_policy);
@ -307,7 +308,7 @@ class GrpcLb : public LoadBalancingPolicy {
grpc_closure client_load_report_done_closure_;
};
class SubchannelWrapper : public DelegatingSubchannel {
class SubchannelWrapper final : public DelegatingSubchannel {
public:
SubchannelWrapper(RefCountedPtr<SubchannelInterface> subchannel,
RefCountedPtr<GrpcLb> lb_policy, std::string lb_token,
@ -343,7 +344,8 @@ class GrpcLb : public LoadBalancingPolicy {
RefCountedPtr<GrpcLbClientStats> client_stats_;
};
class TokenAndClientStatsArg : public RefCounted<TokenAndClientStatsArg> {
class TokenAndClientStatsArg final
: public RefCounted<TokenAndClientStatsArg> {
public:
TokenAndClientStatsArg(std::string lb_token,
RefCountedPtr<GrpcLbClientStats> client_stats)
@ -371,7 +373,7 @@ class GrpcLb : public LoadBalancingPolicy {
RefCountedPtr<GrpcLbClientStats> client_stats_;
};
class Serverlist : public RefCounted<Serverlist> {
class Serverlist final : public RefCounted<Serverlist> {
public:
// Takes ownership of serverlist.
explicit Serverlist(std::vector<GrpcLbServer> serverlist)
@ -408,7 +410,7 @@ class GrpcLb : public LoadBalancingPolicy {
std::atomic<size_t> drop_index_{0};
};
class Picker : public SubchannelPicker {
class Picker final : public SubchannelPicker {
public:
Picker(RefCountedPtr<Serverlist> serverlist,
RefCountedPtr<SubchannelPicker> child_picker,
@ -424,7 +426,7 @@ class GrpcLb : public LoadBalancingPolicy {
// in the case where the subchannel call is never actually started,
// since the client load reporting filter will not be able to do it
// in that case.
class SubchannelCallTracker : public SubchannelCallTrackerInterface {
class SubchannelCallTracker final : public SubchannelCallTrackerInterface {
public:
SubchannelCallTracker(
RefCountedPtr<GrpcLbClientStats> client_stats,
@ -460,7 +462,8 @@ class GrpcLb : public LoadBalancingPolicy {
RefCountedPtr<GrpcLbClientStats> client_stats_;
};
class Helper : public ParentOwningDelegatingChannelControlHelper<GrpcLb> {
class Helper final
: public ParentOwningDelegatingChannelControlHelper<GrpcLb> {
public:
explicit Helper(RefCountedPtr<GrpcLb> parent)
: ParentOwningDelegatingChannelControlHelper(std::move(parent)) {}
@ -473,7 +476,7 @@ class GrpcLb : public LoadBalancingPolicy {
void RequestReresolution() override;
};
class StateWatcher : public AsyncConnectivityStateWatcherInterface {
class StateWatcher final : public AsyncConnectivityStateWatcherInterface {
public:
explicit StateWatcher(RefCountedPtr<GrpcLb> parent)
: AsyncConnectivityStateWatcherInterface(parent->work_serializer()),
@ -647,7 +650,8 @@ void ParseServer(const GrpcLbServer& server, grpc_resolved_address* addr) {
}
}
class GrpcLb::Serverlist::AddressIterator : public EndpointAddressesIterator {
class GrpcLb::Serverlist::AddressIterator final
: public EndpointAddressesIterator {
public:
AddressIterator(RefCountedPtr<Serverlist> serverlist,
RefCountedPtr<GrpcLbClientStats> client_stats)
@ -1526,7 +1530,8 @@ void GrpcLb::ResetBackoffLocked() {
}
// Endpoint iterator wrapper to add null LB token attribute.
class GrpcLb::NullLbTokenEndpointIterator : public EndpointAddressesIterator {
class GrpcLb::NullLbTokenEndpointIterator final
: public EndpointAddressesIterator {
public:
explicit NullLbTokenEndpointIterator(
std::shared_ptr<EndpointAddressesIterator> parent_it)
@ -1892,7 +1897,7 @@ void GrpcLb::OnSubchannelCacheTimerLocked() {
// factory
//
class GrpcLbFactory : public LoadBalancingPolicyFactory {
class GrpcLbFactory final : public LoadBalancingPolicyFactory {
public:
OrphanablePtr<LoadBalancingPolicy> CreateLoadBalancingPolicy(
LoadBalancingPolicy::Args args) const override {

@ -37,7 +37,7 @@
namespace grpc_core {
class GrpcLbClientStats : public RefCounted<GrpcLbClientStats> {
class GrpcLbClientStats final : public RefCounted<GrpcLbClientStats> {
public:
struct DropTokenCount {
UniquePtr<char> token;

@ -71,7 +71,7 @@ TraceFlag grpc_health_check_client_trace(false, "health_check_client");
namespace {
// A fire-and-forget class to asynchronously drain a WorkSerializer queue.
class AsyncWorkSerializerDrainer {
class AsyncWorkSerializerDrainer final {
public:
explicit AsyncWorkSerializerDrainer(
std::shared_ptr<WorkSerializer> work_serializer)
@ -212,7 +212,7 @@ void HealthProducer::HealthChecker::OnHealthWatchStatusChange(
// HealthProducer::HealthChecker::HealthStreamEventHandler
//
class HealthProducer::HealthChecker::HealthStreamEventHandler
class HealthProducer::HealthChecker::HealthStreamEventHandler final
: public SubchannelStreamClient::CallEventHandler {
public:
explicit HealthStreamEventHandler(RefCountedPtr<HealthChecker> health_checker)
@ -321,7 +321,7 @@ class HealthProducer::HealthChecker::HealthStreamEventHandler
// HealthProducer::ConnectivityWatcher
//
class HealthProducer::ConnectivityWatcher
class HealthProducer::ConnectivityWatcher final
: public Subchannel::ConnectivityStateWatcherInterface {
public:
explicit ConnectivityWatcher(WeakRefCountedPtr<HealthProducer> producer)

@ -52,7 +52,7 @@ class HealthWatcher;
// health watch call for each health check service name that is being
// watched and reports the resulting connectivity state to all
// registered watchers.
class HealthProducer : public Subchannel::DataProducerInterface {
class HealthProducer final : public Subchannel::DataProducerInterface {
public:
HealthProducer() : interested_parties_(grpc_pollset_set_create()) {}
~HealthProducer() override { grpc_pollset_set_destroy(interested_parties_); }
@ -77,7 +77,7 @@ class HealthProducer : public Subchannel::DataProducerInterface {
// Health checker for a given health check service name. Contains the
// health check client and the list of watchers.
class HealthChecker : public InternallyRefCounted<HealthChecker> {
class HealthChecker final : public InternallyRefCounted<HealthChecker> {
public:
HealthChecker(WeakRefCountedPtr<HealthProducer> producer,
absl::string_view health_check_service_name);
@ -155,7 +155,7 @@ class HealthProducer : public Subchannel::DataProducerInterface {
};
// A data watcher that handles health checking.
class HealthWatcher : public InternalSubchannelDataWatcherInterface {
class HealthWatcher final : public InternalSubchannelDataWatcherInterface {
public:
HealthWatcher(
std::shared_ptr<WorkSerializer> work_serializer,

@ -430,7 +430,7 @@ class LoadBalancingPolicy : public InternallyRefCounted<LoadBalancingPolicy> {
// A picker that returns PickResult::Queue for all picks.
// Also calls the parent LB policy's ExitIdleLocked() method when the
// first pick is seen.
class QueuePicker : public SubchannelPicker {
class QueuePicker final : public SubchannelPicker {
public:
explicit QueuePicker(RefCountedPtr<LoadBalancingPolicy> parent)
: parent_(std::move(parent)) {}
@ -445,7 +445,7 @@ class LoadBalancingPolicy : public InternallyRefCounted<LoadBalancingPolicy> {
};
// A picker that returns PickResult::Fail for all picks.
class TransientFailurePicker : public SubchannelPicker {
class TransientFailurePicker final : public SubchannelPicker {
public:
explicit TransientFailurePicker(absl::Status status) : status_(status) {}

@ -33,12 +33,12 @@
namespace grpc_core {
class LoadBalancingPolicyRegistry {
class LoadBalancingPolicyRegistry final {
public:
/// Methods used to create and populate the LoadBalancingPolicyRegistry.
/// NOT THREAD SAFE -- to be used only during global gRPC
/// initialization and shutdown.
class Builder {
class Builder final {
public:
/// Registers an LB policy factory. The factory will be used to create an
/// LB policy whose name matches that of the factory.

@ -66,7 +66,7 @@ TraceFlag grpc_orca_client_trace(false, "orca_client");
// OrcaProducer::ConnectivityWatcher
//
class OrcaProducer::ConnectivityWatcher
class OrcaProducer::ConnectivityWatcher final
: public Subchannel::ConnectivityStateWatcherInterface {
public:
explicit ConnectivityWatcher(WeakRefCountedPtr<OrcaProducer> producer)
@ -97,7 +97,7 @@ class OrcaProducer::ConnectivityWatcher
// OrcaProducer::OrcaStreamEventHandler
//
class OrcaProducer::OrcaStreamEventHandler
class OrcaProducer::OrcaStreamEventHandler final
: public SubchannelStreamClient::CallEventHandler {
public:
OrcaStreamEventHandler(WeakRefCountedPtr<OrcaProducer> producer,
@ -168,7 +168,7 @@ class OrcaProducer::OrcaStreamEventHandler
// notifications, which avoids lock inversion problems due to
// acquiring producer_->mu_ while holding the lock from inside of
// SubchannelStreamClient.
class BackendMetricAllocator : public BackendMetricAllocatorInterface {
class BackendMetricAllocator final : public BackendMetricAllocatorInterface {
public:
explicit BackendMetricAllocator(WeakRefCountedPtr<OrcaProducer> producer)
: producer_(std::move(producer)) {}

@ -46,7 +46,7 @@ class OrcaWatcher;
// This producer is registered with a subchannel. It creates a
// streaming ORCA call and reports the resulting backend metrics to all
// registered watchers.
class OrcaProducer : public Subchannel::DataProducerInterface {
class OrcaProducer final : public Subchannel::DataProducerInterface {
public:
void Start(RefCountedPtr<Subchannel> subchannel);
@ -92,7 +92,7 @@ class OrcaProducer : public Subchannel::DataProducerInterface {
// This watcher is returned to the LB policy and added to the
// client channel SubchannelWrapper.
class OrcaWatcher : public InternalSubchannelDataWatcherInterface {
class OrcaWatcher final : public InternalSubchannelDataWatcherInterface {
public:
OrcaWatcher(Duration report_interval,
std::unique_ptr<OobBackendMetricWatcher> watcher)

@ -85,7 +85,7 @@ constexpr absl::string_view kOutlierDetection =
"outlier_detection_experimental";
// Config for xDS Cluster Impl LB policy.
class OutlierDetectionLbConfig : public LoadBalancingPolicy::Config {
class OutlierDetectionLbConfig final : public LoadBalancingPolicy::Config {
public:
OutlierDetectionLbConfig(
OutlierDetectionConfig outlier_detection_config,
@ -114,7 +114,7 @@ class OutlierDetectionLbConfig : public LoadBalancingPolicy::Config {
};
// xDS Cluster Impl LB policy.
class OutlierDetectionLb : public LoadBalancingPolicy {
class OutlierDetectionLb final : public LoadBalancingPolicy {
public:
explicit OutlierDetectionLb(Args args);
@ -128,7 +128,7 @@ class OutlierDetectionLb : public LoadBalancingPolicy {
class SubchannelState;
class EndpointState;
class SubchannelWrapper : public DelegatingSubchannel {
class SubchannelWrapper final : public DelegatingSubchannel {
public:
SubchannelWrapper(std::shared_ptr<WorkSerializer> work_serializer,
RefCountedPtr<SubchannelState> subchannel_state,
@ -158,7 +158,7 @@ class OutlierDetectionLb : public LoadBalancingPolicy {
}
private:
class WatcherWrapper
class WatcherWrapper final
: public SubchannelInterface::ConnectivityStateWatcherInterface {
public:
WatcherWrapper(std::shared_ptr<
@ -234,7 +234,7 @@ class OutlierDetectionLb : public LoadBalancingPolicy {
WatcherWrapper* watcher_wrapper_ = nullptr;
};
class SubchannelState : public RefCounted<SubchannelState> {
class SubchannelState final : public RefCounted<SubchannelState> {
public:
void AddSubchannel(SubchannelWrapper* wrapper) {
subchannels_.insert(wrapper);
@ -277,7 +277,7 @@ class OutlierDetectionLb : public LoadBalancingPolicy {
RefCountedPtr<EndpointState> endpoint_state_ ABSL_GUARDED_BY(mu_);
};
class EndpointState : public RefCounted<EndpointState> {
class EndpointState final : public RefCounted<EndpointState> {
public:
explicit EndpointState(std::set<SubchannelState*> subchannels)
: subchannels_(std::move(subchannels)) {
@ -371,7 +371,7 @@ class OutlierDetectionLb : public LoadBalancingPolicy {
};
// A picker that wraps the picker from the child to perform outlier detection.
class Picker : public SubchannelPicker {
class Picker final : public SubchannelPicker {
public:
Picker(OutlierDetectionLb* outlier_detection_lb,
RefCountedPtr<SubchannelPicker> picker, bool counting_enabled);
@ -384,7 +384,7 @@ class OutlierDetectionLb : public LoadBalancingPolicy {
bool counting_enabled_;
};
class Helper
class Helper final
: public ParentOwningDelegatingChannelControlHelper<OutlierDetectionLb> {
public:
explicit Helper(RefCountedPtr<OutlierDetectionLb> outlier_detection_policy)
@ -398,7 +398,7 @@ class OutlierDetectionLb : public LoadBalancingPolicy {
RefCountedPtr<SubchannelPicker> picker) override;
};
class EjectionTimer : public InternallyRefCounted<EjectionTimer> {
class EjectionTimer final : public InternallyRefCounted<EjectionTimer> {
public:
EjectionTimer(RefCountedPtr<OutlierDetectionLb> parent,
Timestamp start_time);
@ -483,7 +483,7 @@ void OutlierDetectionLb::SubchannelWrapper::CancelDataWatcher(
// OutlierDetectionLb::Picker::SubchannelCallTracker
//
class OutlierDetectionLb::Picker::SubchannelCallTracker
class OutlierDetectionLb::Picker::SubchannelCallTracker final
: public LoadBalancingPolicy::SubchannelCallTrackerInterface {
public:
SubchannelCallTracker(
@ -1068,7 +1068,7 @@ void OutlierDetectionLb::EjectionTimer::OnTimerLocked() {
// factory
//
class OutlierDetectionLbFactory : public LoadBalancingPolicyFactory {
class OutlierDetectionLbFactory final : public LoadBalancingPolicyFactory {
public:
OrphanablePtr<LoadBalancingPolicy> CreateLoadBalancingPolicy(
LoadBalancingPolicy::Args args) const override {

@ -97,7 +97,7 @@ const auto kMetricConnectionAttemptsFailed =
"EXPERIMENTAL. Number of failed connection attempts.",
"{attempt}", {kMetricLabelTarget}, {}, false);
class PickFirstConfig : public LoadBalancingPolicy::Config {
class PickFirstConfig final : public LoadBalancingPolicy::Config {
public:
absl::string_view name() const override { return kPickFirst; }
bool shuffle_addresses() const { return shuffle_addresses_; }
@ -115,7 +115,7 @@ class PickFirstConfig : public LoadBalancingPolicy::Config {
bool shuffle_addresses_ = false;
};
class PickFirst : public LoadBalancingPolicy {
class PickFirst final : public LoadBalancingPolicy {
public:
explicit PickFirst(Args args);
@ -128,9 +128,9 @@ class PickFirst : public LoadBalancingPolicy {
private:
~PickFirst() override;
class SubchannelList : public InternallyRefCounted<SubchannelList> {
class SubchannelList final : public InternallyRefCounted<SubchannelList> {
public:
class SubchannelData {
class SubchannelData final {
public:
SubchannelData(SubchannelList* subchannel_list, size_t index,
RefCountedPtr<SubchannelInterface> subchannel);
@ -162,7 +162,7 @@ class PickFirst : public LoadBalancingPolicy {
private:
// Watcher for subchannel connectivity state.
class Watcher
class Watcher final
: public SubchannelInterface::ConnectivityStateWatcherInterface {
public:
Watcher(RefCountedPtr<SubchannelList> subchannel_list, size_t index)
@ -287,7 +287,7 @@ class PickFirst : public LoadBalancingPolicy {
absl::Status last_failure_;
};
class HealthWatcher
class HealthWatcher final
: public SubchannelInterface::ConnectivityStateWatcherInterface {
public:
explicit HealthWatcher(RefCountedPtr<PickFirst> policy)
@ -308,7 +308,7 @@ class PickFirst : public LoadBalancingPolicy {
RefCountedPtr<PickFirst> policy_;
};
class Picker : public SubchannelPicker {
class Picker final : public SubchannelPicker {
public:
explicit Picker(RefCountedPtr<SubchannelInterface> subchannel)
: subchannel_(std::move(subchannel)) {}
@ -467,7 +467,7 @@ absl::string_view GetAddressFamily(const grpc_resolved_address& address) {
// An endpoint list iterator that returns only entries for a specific
// address family, as indicated by the URI scheme.
class AddressFamilyIterator {
class AddressFamilyIterator final {
public:
AddressFamilyIterator(absl::string_view scheme, size_t index)
: scheme_(scheme), index_(index) {}
@ -1128,7 +1128,7 @@ void PickFirst::SubchannelList::MaybeFinishHappyEyeballsPass() {
// factory
//
class PickFirstFactory : public LoadBalancingPolicyFactory {
class PickFirstFactory final : public LoadBalancingPolicyFactory {
public:
OrphanablePtr<LoadBalancingPolicy> CreateLoadBalancingPolicy(
LoadBalancingPolicy::Args args) const override {

@ -83,7 +83,7 @@ constexpr Duration kChildRetentionInterval = Duration::Minutes(15);
constexpr Duration kDefaultChildFailoverTimeout = Duration::Seconds(10);
// Config for priority LB policy.
class PriorityLbConfig : public LoadBalancingPolicy::Config {
class PriorityLbConfig final : public LoadBalancingPolicy::Config {
public:
struct PriorityLbChild {
RefCountedPtr<LoadBalancingPolicy::Config> config;
@ -119,7 +119,7 @@ class PriorityLbConfig : public LoadBalancingPolicy::Config {
};
// priority LB policy.
class PriorityLb : public LoadBalancingPolicy {
class PriorityLb final : public LoadBalancingPolicy {
public:
explicit PriorityLb(Args args);
@ -131,7 +131,7 @@ class PriorityLb : public LoadBalancingPolicy {
private:
// Each ChildPriority holds a ref to the PriorityLb.
class ChildPriority : public InternallyRefCounted<ChildPriority> {
class ChildPriority final : public InternallyRefCounted<ChildPriority> {
public:
ChildPriority(RefCountedPtr<PriorityLb> priority_policy, std::string name);
@ -163,7 +163,7 @@ class PriorityLb : public LoadBalancingPolicy {
bool FailoverTimerPending() const { return failover_timer_ != nullptr; }
private:
class Helper : public DelegatingChannelControlHelper {
class Helper final : public DelegatingChannelControlHelper {
public:
explicit Helper(RefCountedPtr<ChildPriority> priority)
: priority_(std::move(priority)) {}
@ -183,7 +183,8 @@ class PriorityLb : public LoadBalancingPolicy {
RefCountedPtr<ChildPriority> priority_;
};
class DeactivationTimer : public InternallyRefCounted<DeactivationTimer> {
class DeactivationTimer final
: public InternallyRefCounted<DeactivationTimer> {
public:
explicit DeactivationTimer(RefCountedPtr<ChildPriority> child_priority);
@ -196,7 +197,7 @@ class PriorityLb : public LoadBalancingPolicy {
absl::optional<EventEngine::TaskHandle> timer_handle_;
};
class FailoverTimer : public InternallyRefCounted<FailoverTimer> {
class FailoverTimer final : public InternallyRefCounted<FailoverTimer> {
public:
explicit FailoverTimer(RefCountedPtr<ChildPriority> child_priority);
@ -874,7 +875,7 @@ void PriorityLbConfig::JsonPostLoad(const Json& /*json*/, const JsonArgs&,
}
}
class PriorityLbFactory : public LoadBalancingPolicyFactory {
class PriorityLbFactory final : public LoadBalancingPolicyFactory {
public:
OrphanablePtr<LoadBalancingPolicy> CreateLoadBalancingPolicy(
LoadBalancingPolicy::Args args) const override {

@ -114,7 +114,7 @@ namespace {
constexpr absl::string_view kRingHash = "ring_hash_experimental";
class RingHashLbConfig : public LoadBalancingPolicy::Config {
class RingHashLbConfig final : public LoadBalancingPolicy::Config {
public:
RingHashLbConfig(size_t min_ring_size, size_t max_ring_size)
: min_ring_size_(min_ring_size), max_ring_size_(max_ring_size) {}
@ -133,7 +133,7 @@ class RingHashLbConfig : public LoadBalancingPolicy::Config {
constexpr size_t kRingSizeCapDefault = 4096;
class RingHash : public LoadBalancingPolicy {
class RingHash final : public LoadBalancingPolicy {
public:
explicit RingHash(Args args);
@ -144,7 +144,7 @@ class RingHash : public LoadBalancingPolicy {
private:
// A ring computed based on a config and address list.
class Ring : public RefCounted<Ring> {
class Ring final : public RefCounted<Ring> {
public:
struct RingEntry {
uint64_t hash;
@ -160,7 +160,7 @@ class RingHash : public LoadBalancingPolicy {
};
// State for a particular endpoint. Delegates to a pick_first child policy.
class RingHashEndpoint : public InternallyRefCounted<RingHashEndpoint> {
class RingHashEndpoint final : public InternallyRefCounted<RingHashEndpoint> {
public:
// index is the index into RingHash::endpoints_ of this endpoint.
RingHashEndpoint(RefCountedPtr<RingHash> ring_hash, size_t index)
@ -216,7 +216,7 @@ class RingHash : public LoadBalancingPolicy {
RefCountedPtr<SubchannelPicker> picker_;
};
class Picker : public SubchannelPicker {
class Picker final : public SubchannelPicker {
public:
explicit Picker(RefCountedPtr<RingHash> ring_hash)
: ring_hash_(std::move(ring_hash)),
@ -232,7 +232,7 @@ class RingHash : public LoadBalancingPolicy {
private:
// A fire-and-forget class that schedules endpoint connection attempts
// on the control plane WorkSerializer.
class EndpointConnectionAttempter {
class EndpointConnectionAttempter final {
public:
EndpointConnectionAttempter(RefCountedPtr<RingHash> ring_hash,
RefCountedPtr<RingHashEndpoint> endpoint)
@ -462,7 +462,7 @@ RingHash::Ring::Ring(RingHash* ring_hash, RingHashLbConfig* config) {
// RingHash::RingHashEndpoint::Helper
//
class RingHash::RingHashEndpoint::Helper
class RingHash::RingHashEndpoint::Helper final
: public LoadBalancingPolicy::DelegatingChannelControlHelper {
public:
explicit Helper(RefCountedPtr<RingHashEndpoint> endpoint)
@ -849,7 +849,7 @@ void RingHash::UpdateAggregatedConnectivityStateLocked(
// factory
//
class RingHashFactory : public LoadBalancingPolicyFactory {
class RingHashFactory final : public LoadBalancingPolicyFactory {
public:
OrphanablePtr<LoadBalancingPolicy> CreateLoadBalancingPolicy(
LoadBalancingPolicy::Args args) const override {

@ -30,7 +30,7 @@
namespace grpc_core {
class RequestHashAttribute
class RequestHashAttribute final
: public ServiceConfigCallData::CallAttributeInterface {
public:
static UniqueTypeName TypeName();

@ -188,7 +188,7 @@ const Duration kCacheCleanupTimerInterval = Duration::Minutes(1);
const int64_t kMaxCacheSizeBytes = 5 * 1024 * 1024;
// Parsed RLS LB policy configuration.
class RlsLbConfig : public LoadBalancingPolicy::Config {
class RlsLbConfig final : public LoadBalancingPolicy::Config {
public:
struct KeyBuilder {
std::map<std::string /*key*/, std::vector<std::string /*header*/>>
@ -267,7 +267,7 @@ class RlsLbConfig : public LoadBalancingPolicy::Config {
};
// RLS LB policy.
class RlsLb : public LoadBalancingPolicy {
class RlsLb final : public LoadBalancingPolicy {
public:
explicit RlsLb(Args args);
@ -323,7 +323,7 @@ class RlsLb : public LoadBalancingPolicy {
};
// Wraps a child policy for a given RLS target.
class ChildPolicyWrapper : public DualRefCounted<ChildPolicyWrapper> {
class ChildPolicyWrapper final : public DualRefCounted<ChildPolicyWrapper> {
public:
ChildPolicyWrapper(RefCountedPtr<RlsLb> lb_policy, std::string target);
@ -374,7 +374,7 @@ class RlsLb : public LoadBalancingPolicy {
private:
// ChannelControlHelper object that allows the child policy to update state
// with the wrapper.
class ChildPolicyHelper : public DelegatingChannelControlHelper {
class ChildPolicyHelper final : public DelegatingChannelControlHelper {
public:
explicit ChildPolicyHelper(WeakRefCountedPtr<ChildPolicyWrapper> wrapper)
: wrapper_(std::move(wrapper)) {}
@ -415,7 +415,7 @@ class RlsLb : public LoadBalancingPolicy {
// A picker that uses the cache and the request map in the LB policy
// (synchronized via a mutex) to determine how to route requests.
class Picker : public LoadBalancingPolicy::SubchannelPicker {
class Picker final : public LoadBalancingPolicy::SubchannelPicker {
public:
explicit Picker(RefCountedPtr<RlsLb> lb_policy);
@ -432,11 +432,11 @@ class RlsLb : public LoadBalancingPolicy {
};
// An LRU cache with adjustable size.
class Cache {
class Cache final {
public:
using Iterator = std::list<RequestKey>::iterator;
class Entry : public InternallyRefCounted<Entry> {
class Entry final : public InternallyRefCounted<Entry> {
public:
Entry(RefCountedPtr<RlsLb> lb_policy, const RequestKey& key);
@ -508,7 +508,7 @@ class RlsLb : public LoadBalancingPolicy {
void MarkUsed() ABSL_EXCLUSIVE_LOCKS_REQUIRED(&RlsLb::mu_);
private:
class BackoffTimer : public InternallyRefCounted<BackoffTimer> {
class BackoffTimer final : public InternallyRefCounted<BackoffTimer> {
public:
BackoffTimer(RefCountedPtr<Entry> entry, Timestamp backoff_time);
@ -607,7 +607,7 @@ class RlsLb : public LoadBalancingPolicy {
// Channel for communicating with the RLS server.
// Contains throttling logic for RLS requests.
class RlsChannel : public InternallyRefCounted<RlsChannel> {
class RlsChannel final : public InternallyRefCounted<RlsChannel> {
public:
explicit RlsChannel(RefCountedPtr<RlsLb> lb_policy);
@ -637,7 +637,7 @@ class RlsLb : public LoadBalancingPolicy {
private:
// Watches the state of the RLS channel. Notifies the LB policy when
// the channel was previously in TRANSIENT_FAILURE and then becomes READY.
class StateWatcher : public AsyncConnectivityStateWatcherInterface {
class StateWatcher final : public AsyncConnectivityStateWatcherInterface {
public:
explicit StateWatcher(RefCountedPtr<RlsChannel> rls_channel)
: AsyncConnectivityStateWatcherInterface(
@ -653,7 +653,7 @@ class RlsLb : public LoadBalancingPolicy {
};
// Throttle state for RLS requests.
class Throttle {
class Throttle final {
public:
explicit Throttle(
Duration window_size = kDefaultThrottleWindowSize,
@ -691,7 +691,7 @@ class RlsLb : public LoadBalancingPolicy {
};
// A pending RLS request. Instances will be tracked in request_map_.
class RlsRequest : public InternallyRefCounted<RlsRequest> {
class RlsRequest final : public InternallyRefCounted<RlsRequest> {
public:
// Asynchronously starts a call on rls_channel for key.
// Stores backoff_state, which will be transferred to the data cache
@ -2574,7 +2574,7 @@ void RlsLbConfig::JsonPostLoad(const Json& json, const JsonArgs&,
}
}
class RlsLbFactory : public LoadBalancingPolicyFactory {
class RlsLbFactory final : public LoadBalancingPolicyFactory {
public:
absl::string_view name() const override { return kRls; }

@ -59,7 +59,7 @@ namespace {
constexpr absl::string_view kRoundRobin = "round_robin";
class RoundRobin : public LoadBalancingPolicy {
class RoundRobin final : public LoadBalancingPolicy {
public:
explicit RoundRobin(Args args);
@ -69,7 +69,7 @@ class RoundRobin : public LoadBalancingPolicy {
void ResetBackoffLocked() override;
private:
class RoundRobinEndpointList : public EndpointList {
class RoundRobinEndpointList final : public EndpointList {
public:
RoundRobinEndpointList(RefCountedPtr<RoundRobin> round_robin,
EndpointAddressesIterator* endpoints,
@ -88,7 +88,7 @@ class RoundRobin : public LoadBalancingPolicy {
}
private:
class RoundRobinEndpoint : public Endpoint {
class RoundRobinEndpoint final : public Endpoint {
public:
RoundRobinEndpoint(RefCountedPtr<EndpointList> endpoint_list,
const EndpointAddresses& addresses,
@ -135,7 +135,7 @@ class RoundRobin : public LoadBalancingPolicy {
absl::Status last_failure_;
};
class Picker : public SubchannelPicker {
class Picker final : public SubchannelPicker {
public:
Picker(RoundRobin* parent,
std::vector<RefCountedPtr<LoadBalancingPolicy::SubchannelPicker>>
@ -431,12 +431,12 @@ void RoundRobin::RoundRobinEndpointList::
// factory
//
class RoundRobinConfig : public LoadBalancingPolicy::Config {
class RoundRobinConfig final : public LoadBalancingPolicy::Config {
public:
absl::string_view name() const override { return kRoundRobin; }
};
class RoundRobinFactory : public LoadBalancingPolicyFactory {
class RoundRobinFactory final : public LoadBalancingPolicyFactory {
public:
OrphanablePtr<LoadBalancingPolicy> CreateLoadBalancingPolicy(
LoadBalancingPolicy::Args args) const override {

@ -39,7 +39,7 @@ namespace grpc_core {
// Construction is O(|weights|). Picking is O(1) if weights are similar, or
// O(|weights|) if the mean of the non-zero weights is a small fraction of the
// max. Stores two bytes per weight.
class StaticStrideScheduler {
class StaticStrideScheduler final {
public:
// Constructs and returns a new StaticStrideScheduler, or nullopt if all
// wieghts are zero or |weights| <= 1. All weights must be >=0.

@ -118,7 +118,7 @@ const auto kMetricEndpointWeights =
"{weight}", {kMetricLabelTarget}, {kMetricLabelLocality}, false);
// Config for WRR policy.
class WeightedRoundRobinConfig : public LoadBalancingPolicy::Config {
class WeightedRoundRobinConfig final : public LoadBalancingPolicy::Config {
public:
WeightedRoundRobinConfig() = default;
@ -179,7 +179,7 @@ class WeightedRoundRobinConfig : public LoadBalancingPolicy::Config {
};
// WRR LB policy
class WeightedRoundRobin : public LoadBalancingPolicy {
class WeightedRoundRobin final : public LoadBalancingPolicy {
public:
explicit WeightedRoundRobin(Args args);
@ -190,7 +190,7 @@ class WeightedRoundRobin : public LoadBalancingPolicy {
private:
// Represents the weight for a given address.
class EndpointWeight : public RefCounted<EndpointWeight> {
class EndpointWeight final : public RefCounted<EndpointWeight> {
public:
EndpointWeight(RefCountedPtr<WeightedRoundRobin> wrr,
EndpointAddressSet key)
@ -216,9 +216,9 @@ class WeightedRoundRobin : public LoadBalancingPolicy {
Timestamp last_update_time_ ABSL_GUARDED_BY(&mu_) = Timestamp::InfPast();
};
class WrrEndpointList : public EndpointList {
class WrrEndpointList final : public EndpointList {
public:
class WrrEndpoint : public Endpoint {
class WrrEndpoint final : public Endpoint {
public:
WrrEndpoint(RefCountedPtr<EndpointList> endpoint_list,
const EndpointAddresses& addresses, const ChannelArgs& args,
@ -232,7 +232,7 @@ class WeightedRoundRobin : public LoadBalancingPolicy {
RefCountedPtr<EndpointWeight> weight() const { return weight_; }
private:
class OobWatcher : public OobBackendMetricWatcher {
class OobWatcher final : public OobBackendMetricWatcher {
public:
OobWatcher(RefCountedPtr<EndpointWeight> weight,
float error_utilization_penalty)
@ -309,7 +309,7 @@ class WeightedRoundRobin : public LoadBalancingPolicy {
// A picker that performs WRR picks with weights based on
// endpoint-reported utilization and QPS.
class Picker : public SubchannelPicker {
class Picker final : public SubchannelPicker {
public:
Picker(RefCountedPtr<WeightedRoundRobin> wrr,
WrrEndpointList* endpoint_list);
@ -320,7 +320,7 @@ class WeightedRoundRobin : public LoadBalancingPolicy {
private:
// A call tracker that collects per-call endpoint utilization reports.
class SubchannelCallTracker : public SubchannelCallTrackerInterface {
class SubchannelCallTracker final : public SubchannelCallTrackerInterface {
public:
SubchannelCallTracker(
RefCountedPtr<EndpointWeight> weight, float error_utilization_penalty,
@ -997,7 +997,7 @@ void WeightedRoundRobin::WrrEndpointList::
// factory
//
class WeightedRoundRobinFactory : public LoadBalancingPolicyFactory {
class WeightedRoundRobinFactory final : public LoadBalancingPolicyFactory {
public:
OrphanablePtr<LoadBalancingPolicy> CreateLoadBalancingPolicy(
LoadBalancingPolicy::Args args) const override {

@ -83,7 +83,7 @@ constexpr absl::string_view kWeightedTarget = "weighted_target_experimental";
constexpr Duration kChildRetentionInterval = Duration::Minutes(15);
// Config for weighted_target LB policy.
class WeightedTargetLbConfig : public LoadBalancingPolicy::Config {
class WeightedTargetLbConfig final : public LoadBalancingPolicy::Config {
public:
struct ChildConfig {
uint32_t weight;
@ -115,7 +115,7 @@ class WeightedTargetLbConfig : public LoadBalancingPolicy::Config {
};
// weighted_target LB policy.
class WeightedTargetLb : public LoadBalancingPolicy {
class WeightedTargetLb final : public LoadBalancingPolicy {
public:
explicit WeightedTargetLb(Args args);
@ -127,7 +127,7 @@ class WeightedTargetLb : public LoadBalancingPolicy {
private:
// Picks a child using stateless WRR and then delegates to that
// child's picker.
class WeightedPicker : public SubchannelPicker {
class WeightedPicker final : public SubchannelPicker {
public:
// Maintains a weighted list of pickers from each child that is in
// ready state. The first element in the pair represents the end of a
@ -151,7 +151,7 @@ class WeightedTargetLb : public LoadBalancingPolicy {
};
// Each WeightedChild holds a ref to its parent WeightedTargetLb.
class WeightedChild : public InternallyRefCounted<WeightedChild> {
class WeightedChild final : public InternallyRefCounted<WeightedChild> {
public:
WeightedChild(RefCountedPtr<WeightedTargetLb> weighted_target_policy,
const std::string& name);
@ -173,7 +173,7 @@ class WeightedTargetLb : public LoadBalancingPolicy {
RefCountedPtr<SubchannelPicker> picker() const { return picker_; }
private:
class Helper : public DelegatingChannelControlHelper {
class Helper final : public DelegatingChannelControlHelper {
public:
explicit Helper(RefCountedPtr<WeightedChild> weighted_child)
: weighted_child_(std::move(weighted_child)) {}
@ -193,7 +193,7 @@ class WeightedTargetLb : public LoadBalancingPolicy {
RefCountedPtr<WeightedChild> weighted_child_;
};
class DelayedRemovalTimer
class DelayedRemovalTimer final
: public InternallyRefCounted<DelayedRemovalTimer> {
public:
explicit DelayedRemovalTimer(RefCountedPtr<WeightedChild> weighted_child);
@ -732,7 +732,7 @@ const JsonLoaderInterface* WeightedTargetLbConfig::JsonLoader(const JsonArgs&) {
return loader;
}
class WeightedTargetLbFactory : public LoadBalancingPolicyFactory {
class WeightedTargetLbFactory final : public LoadBalancingPolicyFactory {
public:
OrphanablePtr<LoadBalancingPolicy> CreateLoadBalancingPolicy(
LoadBalancingPolicy::Args args) const override {

@ -85,7 +85,7 @@ using XdsConfig = XdsDependencyManager::XdsConfig;
constexpr absl::string_view kCds = "cds_experimental";
// Config for this LB policy.
class CdsLbConfig : public LoadBalancingPolicy::Config {
class CdsLbConfig final : public LoadBalancingPolicy::Config {
public:
CdsLbConfig() = default;
@ -115,7 +115,7 @@ class CdsLbConfig : public LoadBalancingPolicy::Config {
};
// CDS LB policy.
class CdsLb : public LoadBalancingPolicy {
class CdsLb final : public LoadBalancingPolicy {
public:
explicit CdsLb(Args args);
@ -232,7 +232,7 @@ std::string MakeChildPolicyName(absl::string_view cluster,
"}");
}
class PriorityEndpointIterator : public EndpointAddressesIterator {
class PriorityEndpointIterator final : public EndpointAddressesIterator {
public:
PriorityEndpointIterator(
std::string cluster_name,
@ -731,7 +731,7 @@ void CdsLb::ReportTransientFailure(absl::Status status) {
// factory
//
class CdsLbFactory : public LoadBalancingPolicyFactory {
class CdsLbFactory final : public LoadBalancingPolicyFactory {
public:
OrphanablePtr<LoadBalancingPolicy> CreateLoadBalancingPolicy(
LoadBalancingPolicy::Args args) const override {

@ -86,12 +86,12 @@ using XdsConfig = XdsDependencyManager::XdsConfig;
// global circuit breaker atomic map
//
class CircuitBreakerCallCounterMap {
class CircuitBreakerCallCounterMap final {
public:
using Key =
std::pair<std::string /*cluster*/, std::string /*eds_service_name*/>;
class CallCounter : public RefCounted<CallCounter> {
class CallCounter final : public RefCounted<CallCounter> {
public:
explicit CallCounter(Key key) : key_(std::move(key)) {}
~CallCounter() override;
@ -152,7 +152,7 @@ CircuitBreakerCallCounterMap::CallCounter::~CallCounter() {
constexpr absl::string_view kXdsClusterImpl = "xds_cluster_impl_experimental";
// Config for xDS Cluster Impl LB policy.
class XdsClusterImplLbConfig : public LoadBalancingPolicy::Config {
class XdsClusterImplLbConfig final : public LoadBalancingPolicy::Config {
public:
XdsClusterImplLbConfig() = default;
@ -179,7 +179,7 @@ class XdsClusterImplLbConfig : public LoadBalancingPolicy::Config {
};
// xDS Cluster Impl LB policy.
class XdsClusterImplLb : public LoadBalancingPolicy {
class XdsClusterImplLb final : public LoadBalancingPolicy {
public:
XdsClusterImplLb(RefCountedPtr<GrpcXdsClient> xds_client, Args args);
@ -190,7 +190,7 @@ class XdsClusterImplLb : public LoadBalancingPolicy {
void ResetBackoffLocked() override;
private:
class StatsSubchannelWrapper : public DelegatingSubchannel {
class StatsSubchannelWrapper final : public DelegatingSubchannel {
public:
// If load reporting is enabled and we have an XdsClusterLocalityStats
// object, that object already contains the locality labels. We
@ -235,7 +235,7 @@ class XdsClusterImplLb : public LoadBalancingPolicy {
};
// A picker that wraps the picker from the child to perform drops.
class Picker : public SubchannelPicker {
class Picker final : public SubchannelPicker {
public:
Picker(XdsClusterImplLb* xds_cluster_impl_lb,
RefCountedPtr<SubchannelPicker> picker);
@ -253,7 +253,7 @@ class XdsClusterImplLb : public LoadBalancingPolicy {
RefCountedPtr<SubchannelPicker> picker_;
};
class Helper
class Helper final
: public ParentOwningDelegatingChannelControlHelper<XdsClusterImplLb> {
public:
explicit Helper(RefCountedPtr<XdsClusterImplLb> xds_cluster_impl_policy)
@ -315,7 +315,7 @@ class XdsClusterImplLb : public LoadBalancingPolicy {
// XdsClusterImplLb::Picker::SubchannelCallTracker
//
class XdsClusterImplLb::Picker::SubchannelCallTracker
class XdsClusterImplLb::Picker::SubchannelCallTracker final
: public LoadBalancingPolicy::SubchannelCallTrackerInterface {
public:
SubchannelCallTracker(
@ -866,7 +866,7 @@ void XdsClusterImplLbConfig::JsonPostLoad(const Json& json, const JsonArgs&,
}
}
class XdsClusterImplLbFactory : public LoadBalancingPolicyFactory {
class XdsClusterImplLbFactory final : public LoadBalancingPolicyFactory {
public:
OrphanablePtr<LoadBalancingPolicy> CreateLoadBalancingPolicy(
LoadBalancingPolicy::Args args) const override {

@ -75,7 +75,7 @@ constexpr absl::string_view kXdsClusterManager =
"xds_cluster_manager_experimental";
// Config for xds_cluster_manager LB policy.
class XdsClusterManagerLbConfig : public LoadBalancingPolicy::Config {
class XdsClusterManagerLbConfig final : public LoadBalancingPolicy::Config {
public:
struct Child {
RefCountedPtr<LoadBalancingPolicy::Config> config;
@ -108,7 +108,7 @@ class XdsClusterManagerLbConfig : public LoadBalancingPolicy::Config {
};
// xds_cluster_manager LB policy.
class XdsClusterManagerLb : public LoadBalancingPolicy {
class XdsClusterManagerLb final : public LoadBalancingPolicy {
public:
explicit XdsClusterManagerLb(Args args);
@ -121,7 +121,7 @@ class XdsClusterManagerLb : public LoadBalancingPolicy {
private:
// Picks a child using prefix or path matching and then delegates to that
// child's picker.
class ClusterPicker : public SubchannelPicker {
class ClusterPicker final : public SubchannelPicker {
public:
// Maintains a map of cluster names to pickers.
using ClusterMap = std::map<std::string /*cluster_name*/,
@ -139,7 +139,7 @@ class XdsClusterManagerLb : public LoadBalancingPolicy {
};
// Each ClusterChild holds a ref to its parent XdsClusterManagerLb.
class ClusterChild : public InternallyRefCounted<ClusterChild> {
class ClusterChild final : public InternallyRefCounted<ClusterChild> {
public:
ClusterChild(RefCountedPtr<XdsClusterManagerLb> xds_cluster_manager_policy,
const std::string& name);
@ -162,7 +162,7 @@ class XdsClusterManagerLb : public LoadBalancingPolicy {
RefCountedPtr<SubchannelPicker> picker() const { return picker_; }
private:
class Helper : public DelegatingChannelControlHelper {
class Helper final : public DelegatingChannelControlHelper {
public:
explicit Helper(RefCountedPtr<ClusterChild> xds_cluster_manager_child)
: xds_cluster_manager_child_(std::move(xds_cluster_manager_child)) {}
@ -625,7 +625,7 @@ const JsonLoaderInterface* XdsClusterManagerLbConfig::JsonLoader(
return loader;
}
class XdsClusterManagerLbFactory : public LoadBalancingPolicyFactory {
class XdsClusterManagerLbFactory final : public LoadBalancingPolicyFactory {
public:
OrphanablePtr<LoadBalancingPolicy> CreateLoadBalancingPolicy(
LoadBalancingPolicy::Args args) const override {

@ -111,7 +111,7 @@ struct PtrLessThan {
// xds_override_host LB policy
//
class XdsOverrideHostLb : public LoadBalancingPolicy {
class XdsOverrideHostLb final : public LoadBalancingPolicy {
public:
explicit XdsOverrideHostLb(Args args);
@ -126,7 +126,7 @@ class XdsOverrideHostLb : public LoadBalancingPolicy {
private:
class SubchannelEntry;
class SubchannelWrapper : public DelegatingSubchannel {
class SubchannelWrapper final : public DelegatingSubchannel {
public:
SubchannelWrapper(RefCountedPtr<SubchannelInterface> subchannel,
RefCountedPtr<XdsOverrideHostLb> policy);
@ -163,7 +163,8 @@ class XdsOverrideHostLb : public LoadBalancingPolicy {
}
private:
class ConnectivityStateWatcher : public ConnectivityStateWatcherInterface {
class ConnectivityStateWatcher final
: public ConnectivityStateWatcherInterface {
public:
explicit ConnectivityStateWatcher(
WeakRefCountedPtr<SubchannelWrapper> subchannel)
@ -210,7 +211,7 @@ class XdsOverrideHostLb : public LoadBalancingPolicy {
// avoid that, any method that may result in releasing a ref to the
// SubchannelWrapper will instead return that ref to the caller, who is
// responsible for releasing the ref after releasing the lock.
class SubchannelEntry : public RefCounted<SubchannelEntry> {
class SubchannelEntry final : public RefCounted<SubchannelEntry> {
public:
bool HasOwnedSubchannel() const
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsOverrideHostLb::mu_) {
@ -313,7 +314,7 @@ class XdsOverrideHostLb : public LoadBalancingPolicy {
// A picker that wraps the picker from the child for cases when cookie is
// present.
class Picker : public SubchannelPicker {
class Picker final : public SubchannelPicker {
public:
Picker(RefCountedPtr<XdsOverrideHostLb> xds_override_host_lb,
RefCountedPtr<SubchannelPicker> picker,
@ -322,7 +323,7 @@ class XdsOverrideHostLb : public LoadBalancingPolicy {
PickResult Pick(PickArgs args) override;
private:
class SubchannelConnectionRequester {
class SubchannelConnectionRequester final {
public:
explicit SubchannelConnectionRequester(
RefCountedPtr<SubchannelWrapper> subchannel)
@ -348,7 +349,7 @@ class XdsOverrideHostLb : public LoadBalancingPolicy {
grpc_closure closure_;
};
class SubchannelCreationRequester {
class SubchannelCreationRequester final {
public:
SubchannelCreationRequester(RefCountedPtr<XdsOverrideHostLb> policy,
absl::string_view address)
@ -383,7 +384,7 @@ class XdsOverrideHostLb : public LoadBalancingPolicy {
XdsHealthStatusSet override_host_health_status_set_;
};
class Helper
class Helper final
: public ParentOwningDelegatingChannelControlHelper<XdsOverrideHostLb> {
public:
explicit Helper(RefCountedPtr<XdsOverrideHostLb> xds_override_host_policy)
@ -397,7 +398,7 @@ class XdsOverrideHostLb : public LoadBalancingPolicy {
RefCountedPtr<SubchannelPicker> picker) override;
};
class IdleTimer : public InternallyRefCounted<IdleTimer> {
class IdleTimer final : public InternallyRefCounted<IdleTimer> {
public:
IdleTimer(RefCountedPtr<XdsOverrideHostLb> policy, Duration duration);
@ -729,7 +730,7 @@ XdsHealthStatus GetEndpointHealthStatus(const EndpointAddresses& endpoint) {
}
// Wraps the endpoint iterator and filters out endpoints in state DRAINING.
class ChildEndpointIterator : public EndpointAddressesIterator {
class ChildEndpointIterator final : public EndpointAddressesIterator {
public:
explicit ChildEndpointIterator(
std::shared_ptr<EndpointAddressesIterator> parent_it)
@ -1251,7 +1252,7 @@ void XdsOverrideHostLb::SubchannelEntry::OnSubchannelWrapperOrphan(
// factory
//
class XdsOverrideHostLbFactory : public LoadBalancingPolicyFactory {
class XdsOverrideHostLbFactory final : public LoadBalancingPolicyFactory {
public:
OrphanablePtr<LoadBalancingPolicy> CreateLoadBalancingPolicy(
LoadBalancingPolicy::Args args) const override {

@ -31,7 +31,7 @@
namespace grpc_core {
// Config for stateful session LB policy.
class XdsOverrideHostLbConfig : public LoadBalancingPolicy::Config {
class XdsOverrideHostLbConfig final : public LoadBalancingPolicy::Config {
public:
XdsOverrideHostLbConfig() = default;

@ -61,7 +61,7 @@ namespace {
constexpr absl::string_view kXdsWrrLocality = "xds_wrr_locality_experimental";
// Config for xds_wrr_locality LB policy.
class XdsWrrLocalityLbConfig : public LoadBalancingPolicy::Config {
class XdsWrrLocalityLbConfig final : public LoadBalancingPolicy::Config {
public:
XdsWrrLocalityLbConfig() = default;
@ -106,7 +106,7 @@ class XdsWrrLocalityLbConfig : public LoadBalancingPolicy::Config {
};
// xds_wrr_locality LB policy.
class XdsWrrLocalityLb : public LoadBalancingPolicy {
class XdsWrrLocalityLb final : public LoadBalancingPolicy {
public:
explicit XdsWrrLocalityLb(Args args);
@ -273,7 +273,7 @@ OrphanablePtr<LoadBalancingPolicy> XdsWrrLocalityLb::CreateChildPolicyLocked(
// factory
//
class XdsWrrLocalityLbFactory : public LoadBalancingPolicyFactory {
class XdsWrrLocalityLbFactory final : public LoadBalancingPolicyFactory {
public:
OrphanablePtr<LoadBalancingPolicy> CreateLoadBalancingPolicy(
LoadBalancingPolicy::Args args) const override {

@ -57,7 +57,7 @@
namespace grpc_core {
namespace {
class BinderResolver : public Resolver {
class BinderResolver final : public Resolver {
public:
BinderResolver(EndpointAddressesList addresses, ResolverArgs args)
: result_handler_(std::move(args.result_handler)),
@ -80,7 +80,7 @@ class BinderResolver : public Resolver {
ChannelArgs channel_args_;
};
class BinderResolverFactory : public ResolverFactory {
class BinderResolverFactory final : public ResolverFactory {
public:
absl::string_view scheme() const override { return "binder"; }

@ -82,7 +82,7 @@ namespace grpc_core {
namespace {
class AresClientChannelDNSResolver : public PollingResolver {
class AresClientChannelDNSResolver final : public PollingResolver {
public:
AresClientChannelDNSResolver(ResolverArgs args,
Duration min_time_between_resolutions);
@ -90,7 +90,8 @@ class AresClientChannelDNSResolver : public PollingResolver {
OrphanablePtr<Orphanable> StartRequest() override;
private:
class AresRequestWrapper : public InternallyRefCounted<AresRequestWrapper> {
class AresRequestWrapper final
: public InternallyRefCounted<AresRequestWrapper> {
public:
explicit AresRequestWrapper(
RefCountedPtr<AresClientChannelDNSResolver> resolver)
@ -342,7 +343,7 @@ AresClientChannelDNSResolver::AresRequestWrapper::OnResolvedLocked(
// Factory
//
class AresClientChannelDNSResolverFactory : public ResolverFactory {
class AresClientChannelDNSResolverFactory final : public ResolverFactory {
public:
absl::string_view scheme() const override { return "dns"; }
@ -365,7 +366,7 @@ class AresClientChannelDNSResolverFactory : public ResolverFactory {
}
};
class AresDNSResolver : public DNSResolver {
class AresDNSResolver final : public DNSResolver {
public:
// Abstract class that centralizes common request handling logic via the
// template method pattern.
@ -485,7 +486,7 @@ class AresDNSResolver : public DNSResolver {
grpc_pollset_set* pollset_set_;
};
class AresHostnameRequest : public AresRequest {
class AresHostnameRequest final : public AresRequest {
public:
AresHostnameRequest(
absl::string_view name, absl::string_view default_port,
@ -538,7 +539,7 @@ class AresDNSResolver : public DNSResolver {
std::unique_ptr<EndpointAddressesList> addresses_;
};
class AresSRVRequest : public AresRequest {
class AresSRVRequest final : public AresRequest {
public:
AresSRVRequest(
absl::string_view name, absl::string_view name_server, Duration timeout,
@ -586,7 +587,7 @@ class AresDNSResolver : public DNSResolver {
std::unique_ptr<EndpointAddressesList> balancer_addresses_;
};
class AresTXTRequest : public AresRequest {
class AresTXTRequest final : public AresRequest {
public:
AresTXTRequest(absl::string_view name, absl::string_view name_server,
Duration timeout, grpc_pollset_set* interested_parties,

@ -51,7 +51,7 @@
namespace grpc_core {
class GrpcPolledFdPosix : public GrpcPolledFd {
class GrpcPolledFdPosix final : public GrpcPolledFd {
public:
GrpcPolledFdPosix(ares_socket_t as, grpc_pollset_set* driver_pollset_set)
: name_(absl::StrCat("c-ares fd: ", static_cast<int>(as))), as_(as) {
@ -105,7 +105,7 @@ class GrpcPolledFdPosix : public GrpcPolledFd {
grpc_pollset_set* driver_pollset_set_ ABSL_GUARDED_BY(&grpc_ares_request::mu);
};
class GrpcPolledFdFactoryPosix : public GrpcPolledFdFactory {
class GrpcPolledFdFactoryPosix final : public GrpcPolledFdFactory {
public:
~GrpcPolledFdFactoryPosix() override {
for (auto& fd : owned_fds_) {

@ -70,7 +70,7 @@ namespace {
// c-ares should read, it must do so by calling SetWSAError() on the
// WSAErrorContext instance passed to it. A WSAErrorContext must only be
// instantiated at the top of the virtual socket function callstack.
class WSAErrorContext {
class WSAErrorContext final {
public:
explicit WSAErrorContext(){};
@ -99,7 +99,7 @@ class WSAErrorContext {
// from c-ares and are used with the grpc windows poller, and it, e.g.,
// manufactures virtual socket error codes when it e.g. needs to tell the c-ares
// library to wait for an async read.
class GrpcPolledFdWindows : public GrpcPolledFd {
class GrpcPolledFdWindows final : public GrpcPolledFd {
public:
enum WriteState {
WRITE_IDLE,
@ -694,7 +694,7 @@ class GrpcPolledFdWindows : public GrpcPolledFd {
absl::AnyInvocable<void()> on_shutdown_locked_;
};
class GrpcPolledFdFactoryWindows : public GrpcPolledFdFactory {
class GrpcPolledFdFactoryWindows final : public GrpcPolledFdFactory {
public:
explicit GrpcPolledFdFactoryWindows(Mutex* mu) : mu_(mu) {}

@ -166,7 +166,7 @@ static void grpc_ares_request_unref_locked(grpc_ares_request* r)
// organize per-query and per-resolution information in such a way
// that doesn't involve allocating a number of different data
// structures.
class GrpcAresQuery {
class GrpcAresQuery final {
public:
explicit GrpcAresQuery(grpc_ares_request* r, const std::string& name)
: r_(r), name_(name) {

@ -92,7 +92,7 @@ TraceFlag grpc_event_engine_client_channel_resolver_trace(
// ----------------------------------------------------------------------------
// EventEngineClientChannelDNSResolver
// ----------------------------------------------------------------------------
class EventEngineClientChannelDNSResolver : public PollingResolver {
class EventEngineClientChannelDNSResolver final : public PollingResolver {
public:
EventEngineClientChannelDNSResolver(ResolverArgs args,
Duration min_time_between_resolutions);
@ -102,7 +102,7 @@ class EventEngineClientChannelDNSResolver : public PollingResolver {
// ----------------------------------------------------------------------------
// EventEngineDNSRequestWrapper declaration
// ----------------------------------------------------------------------------
class EventEngineDNSRequestWrapper
class EventEngineDNSRequestWrapper final
: public InternallyRefCounted<EventEngineDNSRequestWrapper> {
public:
EventEngineDNSRequestWrapper(

@ -23,7 +23,9 @@
#include "src/core/lib/uri/uri_parser.h"
namespace grpc_core {
class EventEngineClientChannelDNSResolverFactory : public ResolverFactory {
class EventEngineClientChannelDNSResolverFactory final
: public ResolverFactory {
public:
absl::string_view scheme() const override { return "dns"; }
bool IsValidUri(const URI& uri) const override;

@ -59,7 +59,7 @@ namespace {
TraceFlag grpc_trace_dns_resolver(false, "dns_resolver");
class NativeClientChannelDNSResolver : public PollingResolver {
class NativeClientChannelDNSResolver final : public PollingResolver {
public:
NativeClientChannelDNSResolver(ResolverArgs args,
Duration min_time_between_resolutions);
@ -71,7 +71,7 @@ class NativeClientChannelDNSResolver : public PollingResolver {
// No-op request class, used so that the PollingResolver code knows
// when there is a request in flight, even if the request is not
// actually cancellable.
class Request : public Orphanable {
class Request final : public Orphanable {
public:
Request() = default;
@ -145,7 +145,7 @@ void NativeClientChannelDNSResolver::OnResolved(
// Factory
//
class NativeClientChannelDNSResolverFactory : public ResolverFactory {
class NativeClientChannelDNSResolverFactory final : public ResolverFactory {
public:
absl::string_view scheme() const override { return "dns"; }

@ -45,7 +45,7 @@ namespace grpc_core {
// A list of addresses for a given endpoint with an associated set of channel
// args. Any args present here will be merged into the channel args when a
// subchannel is created for each address.
class EndpointAddresses {
class EndpointAddresses final {
public:
// For backward compatibility.
// TODO(roth): Remove when callers have been updated.
@ -102,7 +102,7 @@ struct ResolvedAddressLessThan {
const grpc_resolved_address& addr2) const;
};
class EndpointAddressSet {
class EndpointAddressSet final {
public:
explicit EndpointAddressSet(
const std::vector<grpc_resolved_address>& addresses)
@ -128,7 +128,7 @@ class EndpointAddressesIterator {
};
// Iterator over a fixed list of endpoints.
class EndpointAddressesListIterator : public EndpointAddressesIterator {
class EndpointAddressesListIterator final : public EndpointAddressesIterator {
public:
explicit EndpointAddressesListIterator(EndpointAddressesList endpoints)
: endpoints_(std::move(endpoints)) {}
@ -145,7 +145,7 @@ class EndpointAddressesListIterator : public EndpointAddressesIterator {
};
// Iterator that returns only a single endpoint.
class SingleEndpointIterator : public EndpointAddressesIterator {
class SingleEndpointIterator final : public EndpointAddressesIterator {
public:
explicit SingleEndpointIterator(EndpointAddresses endpoint)
: endpoint_(std::move(endpoint)) {}

@ -42,7 +42,7 @@ namespace grpc_core {
// This cannot be in an anonymous namespace, because it is a friend of
// FakeResolverResponseGenerator.
class FakeResolver : public Resolver {
class FakeResolver final : public Resolver {
public:
explicit FakeResolver(ResolverArgs args);
@ -232,7 +232,7 @@ const grpc_arg_pointer_vtable
namespace {
class FakeResolverFactory : public ResolverFactory {
class FakeResolverFactory final : public ResolverFactory {
public:
absl::string_view scheme() const override { return "fake"; }

@ -49,7 +49,7 @@ class FakeResolver;
// instead of RefCounted, but external refs are currently needed to
// encode this in channel args. Once channel_args are converted to C++,
// see if we can find a way to fix this.
class FakeResolverResponseGenerator
class FakeResolverResponseGenerator final
: public RefCounted<FakeResolverResponseGenerator> {
public:
static const grpc_arg_pointer_vtable kChannelArgPointerVtable;

@ -59,7 +59,7 @@ namespace {
const char* kC2PAuthority = "traffic-director-c2p.xds.googleapis.com";
class GoogleCloud2ProdResolver : public Resolver {
class GoogleCloud2ProdResolver final : public Resolver {
public:
explicit GoogleCloud2ProdResolver(ResolverArgs args);
@ -276,7 +276,7 @@ void GoogleCloud2ProdResolver::StartXdsResolver() {
// Factory
//
class GoogleCloud2ProdResolverFactory : public ResolverFactory {
class GoogleCloud2ProdResolverFactory final : public ResolverFactory {
public:
absl::string_view scheme() const override { return "google-c2p"; }
@ -296,7 +296,8 @@ class GoogleCloud2ProdResolverFactory : public ResolverFactory {
// TODO(apolcyn): remove this class after user code has updated to the
// stable "google-c2p" URI scheme.
class ExperimentalGoogleCloud2ProdResolverFactory : public ResolverFactory {
class ExperimentalGoogleCloud2ProdResolverFactory final
: public ResolverFactory {
public:
absl::string_view scheme() const override {
return "google-c2p-experimental";

@ -35,7 +35,7 @@
namespace grpc_core {
class ResolverRegistry {
class ResolverRegistry final {
private:
// Forward declaration needed to use this in Builder.
struct State {
@ -47,7 +47,7 @@ class ResolverRegistry {
/// Methods used to create and populate the ResolverRegistry.
/// NOT THREAD SAFE -- to be used only during global gRPC
/// initialization and shutdown.
class Builder {
class Builder final {
public:
Builder();

@ -42,7 +42,7 @@ namespace grpc_core {
namespace {
class SockaddrResolver : public Resolver {
class SockaddrResolver final : public Resolver {
public:
SockaddrResolver(EndpointAddressesList addresses, ResolverArgs args);
@ -110,7 +110,7 @@ OrphanablePtr<Resolver> CreateSockaddrResolver(
std::move(args));
}
class IPv4ResolverFactory : public ResolverFactory {
class IPv4ResolverFactory final : public ResolverFactory {
public:
absl::string_view scheme() const override { return "ipv4"; }
@ -123,7 +123,7 @@ class IPv4ResolverFactory : public ResolverFactory {
}
};
class IPv6ResolverFactory : public ResolverFactory {
class IPv6ResolverFactory final : public ResolverFactory {
public:
absl::string_view scheme() const override { return "ipv6"; }
@ -137,7 +137,7 @@ class IPv6ResolverFactory : public ResolverFactory {
};
#ifdef GRPC_HAVE_UNIX_SOCKET
class UnixResolverFactory : public ResolverFactory {
class UnixResolverFactory final : public ResolverFactory {
public:
absl::string_view scheme() const override { return "unix"; }
@ -150,7 +150,7 @@ class UnixResolverFactory : public ResolverFactory {
}
};
class UnixAbstractResolverFactory : public ResolverFactory {
class UnixAbstractResolverFactory final : public ResolverFactory {
public:
absl::string_view scheme() const override { return "unix-abstract"; }
@ -165,7 +165,7 @@ class UnixAbstractResolverFactory : public ResolverFactory {
#endif // GRPC_HAVE_UNIX_SOCKET
#ifdef GRPC_HAVE_VSOCK
class VSockResolverFactory : public ResolverFactory {
class VSockResolverFactory final : public ResolverFactory {
public:
absl::string_view scheme() const override { return "vsock"; }

@ -105,7 +105,7 @@ std::string XdsDependencyManager::XdsConfig::ToString() const {
// XdsDependencyManager::ListenerWatcher
//
class XdsDependencyManager::ListenerWatcher
class XdsDependencyManager::ListenerWatcher final
: public XdsListenerResourceType::WatcherInterface {
public:
explicit ListenerWatcher(RefCountedPtr<XdsDependencyManager> dependency_mgr)
@ -154,7 +154,7 @@ class XdsDependencyManager::ListenerWatcher
// XdsDependencyManager::RouteConfigWatcher
//
class XdsDependencyManager::RouteConfigWatcher
class XdsDependencyManager::RouteConfigWatcher final
: public XdsRouteConfigResourceType::WatcherInterface {
public:
RouteConfigWatcher(RefCountedPtr<XdsDependencyManager> dependency_mgr,
@ -206,7 +206,7 @@ class XdsDependencyManager::RouteConfigWatcher
// XdsDependencyManager::ClusterWatcher
//
class XdsDependencyManager::ClusterWatcher
class XdsDependencyManager::ClusterWatcher final
: public XdsClusterResourceType::WatcherInterface {
public:
ClusterWatcher(RefCountedPtr<XdsDependencyManager> dependency_mgr,
@ -255,7 +255,7 @@ class XdsDependencyManager::ClusterWatcher
// XdsDependencyManager::EndpointWatcher
//
class XdsDependencyManager::EndpointWatcher
class XdsDependencyManager::EndpointWatcher final
: public XdsEndpointResourceType::WatcherInterface {
public:
EndpointWatcher(RefCountedPtr<XdsDependencyManager> dependency_mgr,
@ -306,7 +306,8 @@ class XdsDependencyManager::EndpointWatcher
// XdsDependencyManager::DnsResultHandler
//
class XdsDependencyManager::DnsResultHandler : public Resolver::ResultHandler {
class XdsDependencyManager::DnsResultHandler final
: public Resolver::ResultHandler {
public:
DnsResultHandler(RefCountedPtr<XdsDependencyManager> dependency_mgr,
std::string name)
@ -468,7 +469,8 @@ void XdsDependencyManager::OnListenerUpdate(
namespace {
class XdsVirtualHostListIterator : public XdsRouting::VirtualHostListIterator {
class XdsVirtualHostListIterator final
: public XdsRouting::VirtualHostListIterator {
public:
explicit XdsVirtualHostListIterator(
const std::vector<XdsRouteConfigResource::VirtualHost>* virtual_hosts)

@ -35,7 +35,7 @@ namespace grpc_core {
// Watches all xDS resources and handles dependencies between them.
// Reports updates only when all necessary resources have been obtained.
class XdsDependencyManager : public RefCounted<XdsDependencyManager>,
class XdsDependencyManager final : public RefCounted<XdsDependencyManager>,
public Orphanable {
public:
struct XdsConfig : public RefCounted<XdsConfig> {
@ -117,7 +117,7 @@ class XdsDependencyManager : public RefCounted<XdsDependencyManager>,
virtual void OnResourceDoesNotExist(std::string context) = 0;
};
class ClusterSubscription : public DualRefCounted<ClusterSubscription> {
class ClusterSubscription final : public DualRefCounted<ClusterSubscription> {
public:
ClusterSubscription(absl::string_view cluster_name,
RefCountedPtr<XdsDependencyManager> dependency_mgr)

@ -102,7 +102,7 @@ namespace {
// XdsResolver
//
class XdsResolver : public Resolver {
class XdsResolver final : public Resolver {
public:
XdsResolver(ResolverArgs args, std::string data_plane_authority)
: work_serializer_(std::move(args.work_serializer)),
@ -135,7 +135,7 @@ class XdsResolver : public Resolver {
}
private:
class XdsWatcher : public XdsDependencyManager::Watcher {
class XdsWatcher final : public XdsDependencyManager::Watcher {
public:
explicit XdsWatcher(RefCountedPtr<XdsResolver> resolver)
: resolver_(std::move(resolver)) {}
@ -163,7 +163,7 @@ class XdsResolver : public Resolver {
// the cluster by the ConfigSelector. The ref for each call is held
// until the call is committed. When the strong refs go away, we hop
// back into the WorkSerializer to remove the entry from the map.
class ClusterRef : public DualRefCounted<ClusterRef> {
class ClusterRef final : public DualRefCounted<ClusterRef> {
public:
ClusterRef(RefCountedPtr<XdsResolver> resolver,
RefCountedPtr<XdsDependencyManager::ClusterSubscription>
@ -196,7 +196,7 @@ class XdsResolver : public Resolver {
// XdsConfigSelector. A ref to this map will be taken by each call processed
// by the XdsConfigSelector, stored in a the call's call attributes, and later
// unreffed by the ClusterSelection filter.
class RouteConfigData : public RefCounted<RouteConfigData> {
class RouteConfigData final : public RefCounted<RouteConfigData> {
public:
struct RouteEntry {
struct ClusterWeightState {
@ -266,7 +266,7 @@ class XdsResolver : public Resolver {
std::vector<RouteEntry> routes_;
};
class XdsConfigSelector : public ConfigSelector {
class XdsConfigSelector final : public ConfigSelector {
public:
XdsConfigSelector(RefCountedPtr<XdsResolver> resolver,
RefCountedPtr<RouteConfigData> route_config_data);
@ -293,7 +293,7 @@ class XdsResolver : public Resolver {
std::vector<const grpc_channel_filter*> filters_;
};
class XdsRouteStateAttributeImpl : public XdsRouteStateAttribute {
class XdsRouteStateAttributeImpl final : public XdsRouteStateAttribute {
public:
explicit XdsRouteStateAttributeImpl(
RefCountedPtr<RouteConfigData> route_config_data,
@ -312,7 +312,7 @@ class XdsResolver : public Resolver {
RouteConfigData::RouteEntry* route_;
};
class ClusterSelectionFilter
class ClusterSelectionFilter final
: public ImplementChannelFilter<ClusterSelectionFilter> {
public:
const static grpc_channel_filter kFilter;
@ -398,7 +398,7 @@ const NoInterceptor XdsResolver::ClusterSelectionFilter::Call::OnFinalize;
// Implementation of XdsRouting::RouteListIterator for getting the matching
// route for a request.
class XdsResolver::RouteConfigData::RouteListIterator
class XdsResolver::RouteConfigData::RouteListIterator final
: public XdsRouting::RouteListIterator {
public:
explicit RouteListIterator(const RouteConfigData* route_table)
@ -1097,7 +1097,7 @@ void XdsResolver::MaybeRemoveUnusedClusters() {
// XdsResolverFactory
//
class XdsResolverFactory : public ResolverFactory {
class XdsResolverFactory final : public ResolverFactory {
public:
absl::string_view scheme() const override { return "xds"; }

@ -26,7 +26,7 @@
namespace grpc_core {
class XdsClusterAttribute
class XdsClusterAttribute final
: public ServiceConfigCallData::CallAttributeInterface {
public:
static UniqueTypeName TypeName() {

@ -54,7 +54,7 @@ namespace grpc_core {
namespace {
class ServiceConfigChannelArgFilter
class ServiceConfigChannelArgFilter final
: public ImplementChannelFilter<ServiceConfigChannelArgFilter> {
public:
static const grpc_channel_filter kFilter;

@ -68,7 +68,7 @@ class ServiceConfigParser {
using ServiceConfigParserList = std::vector<std::unique_ptr<Parser>>;
using ParsedConfigVector = std::vector<std::unique_ptr<ParsedConfig>>;
class Builder {
class Builder final {
public:
/// Globally register a service config parser. Each new service config
/// update will go through all the registered parser. Each parser is

Loading…
Cancel
Save