if (stats().cx_active_.value() >= cluster().resourceManager(priority).maxConnectionsPerHost()) {
static DetectorHostMonitorNullImpl* null_outlier_detector = new DetectorHostMonitorNullImpl();
const std::string& hostnameForHealthChecks() const override { return health_checks_hostname_; }
const MetadataConstSharedPtr localityMetadata() const override { return locality_metadata_; }
absl::optional<MonotonicTime> lastHcPassTime() const override { return last_hc_pass_time_; }
SharedConstAddressVector addressListOrNull() const override { return address_list_or_null_; }
bool healthFlagGet(HealthFlag flag) const override { return health_flags_ & enumToInt(flag); }
void setEdsHealthStatus(envoy::config::core::v3::HealthStatus eds_health_status) override {
// TODO(wbpcode): should we store the EDS health status to health_flags_ to get unified status or
// flag access? May be we could refactor HealthFlag to contain all these statuses and flags in the
// 3. If has_local_locality is true, then the locality of all hosts in the first HostVector bucket
HealthyHostVectorConstSharedPtr healthyHostsPtr() const override { return healthy_hosts_; }
DegradedHostVectorConstSharedPtr degradedHostsPtr() const override { return degraded_hosts_; }
ExcludedHostVectorConstSharedPtr excludedHostsPtr() const override { return excluded_hosts_; }
LocalityWeightsConstSharedPtr localityWeights() const override { return locality_weights_; }
partitionHosts(HostVectorConstSharedPtr hosts, HostsPerLocalityConstSharedPtr hosts_per_locality);
virtual void runUpdateCallbacks(const HostVector& hosts_added, const HostVector& hosts_removed) {
virtual void runUpdateCallbacks(const HostVector& hosts_added, const HostVector& hosts_removed) {
// This is a matching vector to store the callback handles for host_sets_. It is kept separately
// that have been added/removed throughout the batch update, and ensures that we properly manage
* Specialized PrioritySetImpl designed for the main thread. It will update and maintain the read
class MainPrioritySetImpl : public PrioritySetImpl, public Logger::Loggable<Logger::Id::upstream> {
using TcpProtocolOptionsConfigImpl = Envoy::Extensions::Upstreams::Tcp::ProtocolOptionsConfigImpl;
float perUpstreamPreconnectRatio() const override { return per_upstream_preconnect_ratio_; }
OptRef<const envoy::config::core::v3::TypedExtensionConfig> upstreamConfig() const override {
uint32_t maxRequestsPerConnection() const override { return max_requests_per_connection_; }
TransportSocketMatcher& transportSocketMatcher() const override { return *socket_matcher_; }
ClusterConfigUpdateStats& configUpdateStats() const override { return config_update_stats_; }
UpstreamLocalAddressSelectorConstSharedPtr getUpstreamLocalAddressSelector() const override {
bool drainConnectionsOnHostRemoval() const override { return drain_connections_on_host_removal_; }
Http::FilterChainUtility::createFilterChainForFactories(callbacks, http_filter_factories_);
ClusterInfoImpl(Init::Manager& info, Server::Configuration::ServerFactoryContext& server_context,
getRetryBudgetParams(const envoy::config::cluster::v3::CircuitBreakers::Thresholds& thresholds);
const std::unique_ptr<const envoy::config::cluster::v3::Cluster::CustomClusterType> cluster_type_;
// network_filter_config_provider_manager_ should be maintained in the ClusterManager object as
std::shared_ptr<Http::UpstreamFilterConfigProviderManager> http_filter_config_provider_manager_;
* creation since the health checker assumes that the cluster has already been fully initialized
const Outlier::Detector* outlierDetector() const override { return outlier_detector_.get(); }
void setDropCategory(absl::string_view drop_category) override { drop_category_ = drop_category; }
* Manages PriorityState of a cluster. PriorityState is a per-priority binding of a set of hosts
* with its corresponding locality weight map. This is useful to store priorities/hosts/localities
// Initializes the PriorityState vector based on the priority specified in locality_lb_endpoint.