diff --git a/source/common/router/rds_impl.cc b/source/common/router/rds_impl.cc index 384de8c23385..776bfb4cb3bd 100644 --- a/source/common/router/rds_impl.cc +++ b/source/common/router/rds_impl.cc @@ -56,7 +56,7 @@ StaticRouteConfigProviderImpl::~StaticRouteConfigProviderImpl() { // initialization needs to be fixed. RdsRouteConfigSubscription::RdsRouteConfigSubscription( const envoy::config::filter::network::http_connection_manager::v2::Rds& rds, - const std::string& manager_identifier, Server::Configuration::FactoryContext& factory_context, + const uint64_t& manager_identifier, Server::Configuration::FactoryContext& factory_context, const std::string& stat_prefix, Envoy::Router::RouteConfigProviderManagerImpl& route_config_provider_manager) : route_config_name_(rds.route_config_name()), @@ -194,9 +194,7 @@ Router::RouteConfigProviderPtr RouteConfigProviderManagerImpl::createRdsRouteCon Server::Configuration::FactoryContext& factory_context, const std::string& stat_prefix) { // RdsRouteConfigSubscriptions are unique based on their serialized RDS config. - // TODO(htuch): Full serialization here gives large IDs, could get away with a - // strong hash instead. - const std::string manager_identifier = std::to_string(MessageUtil::hash(rds)); + const uint64_t manager_identifier = MessageUtil::hash(rds); RdsRouteConfigSubscriptionSharedPtr subscription; diff --git a/source/common/router/rds_impl.h b/source/common/router/rds_impl.h index 12918f6ffe34..3eeb16bad2f4 100644 --- a/source/common/router/rds_impl.h +++ b/source/common/router/rds_impl.h @@ -121,7 +121,7 @@ class RdsRouteConfigSubscription RdsRouteConfigSubscription( const envoy::config::filter::network::http_connection_manager::v2::Rds& rds, - const std::string& manager_identifier, Server::Configuration::FactoryContext& factory_context, + const uint64_t& manager_identifier, Server::Configuration::FactoryContext& factory_context, const std::string& stat_prefix, RouteConfigProviderManagerImpl& route_config_provider_manager); @@ -134,7 +134,7 @@ class RdsRouteConfigSubscription Stats::ScopePtr scope_; RdsStats stats_; RouteConfigProviderManagerImpl& route_config_provider_manager_; - const std::string manager_identifier_; + const uint64_t manager_identifier_; TimeSource& time_source_; SystemTime last_updated_; absl::optional config_info_; @@ -202,7 +202,9 @@ class RouteConfigProviderManagerImpl : public RouteConfigProviderManager, // TODO(jsedgwick) These two members are prime candidates for the owned-entry list/map // as in ConfigTracker. I.e. the ProviderImpls would have an EntryOwner for these lists // Then the lifetime management stuff is centralized and opaque. - std::unordered_map> + //std::unordered_map> + // route_config_subscriptions_; + std::unordered_map> route_config_subscriptions_; std::unordered_set static_route_config_providers_; Server::ConfigTracker::EntryOwnerPtr config_tracker_entry_;