selectors->subset_keys_.emplace(std::make_pair(key, std::make_shared<SubsetSelectorMap>()));
LoadBalancerContextWrapper context_no_metadata_fallback = removeMetadataFallbackList(context);
} // TODO(MarcinFalkowski): optimization: stop iteration when lexically after 'fallback_list'
// Find a host from the subsets. Sets host_chosen to false and returns nullptr if the context has
// no metadata match criteria, if there is no matching subset, or if the matching subset contains
// no hosts (ignoring health). Otherwise, host_chosen is true and the returns HostConstSharedPtr
// (tracked in subsets). If ever a criterion's key or value is not found, there is no subset for
void SubsetLoadBalancer::updateFallbackSubset(uint32_t priority, const HostVector& all_hosts) {
auto update_func = [priority, &all_hosts](LbSubsetPtr& subset, const HostPredicate& predicate) {
void SubsetLoadBalancer::initLbSubsetEntryOnce(LbSubsetEntryPtr& entry, bool single_host_subset) {
// Iterates all the hosts of specified priority, looking up an LbSubsetEntryPtr for each and add
// hosts to related entry. Because the metadata of host can be updated inlined, we must evaluate
// Given the latest all hosts, update all subsets for this priority level, creating new subsets as
// Iterates over subset_keys looking up values from the given host's metadata. Each key-value pair
const auto& filter_it = metadata.filter_metadata().find(Config::MetadataFilters::get().ENVOY_LB);
std::string SubsetLoadBalancer::describeMetadata(const SubsetLoadBalancer::SubsetMetadata& kvs) {
// Initialize a new HostSubsetImpl and LoadBalancer from the SubsetLoadBalancer, filtering hosts
locality_weight_aware_(locality_weight_aware), scale_locality_weight_(scale_locality_weight) {
// underlying HostSet. The hosts_added Hosts and hosts_removed Hosts have been filtered to match
wrapped->metadataMatchCriteria()->filterMatchCriteria(filtered_metadata_match_criteria_names);