| 2172 | } |
| 2173 | |
| 2174 | void AdmissionController::PoolStats::UpdateRemoteStats( |
| 2175 | const string& host_id, TPoolStats* host_stats) { |
| 2176 | DCHECK_NE(host_id, parent_->host_id_); // Shouldn't be updating for local host. |
| 2177 | RemoteStatsMap::iterator it = remote_stats_.find(host_id); |
| 2178 | if (VLOG_ROW_IS_ON) { |
| 2179 | stringstream ss; |
| 2180 | ss << "Stats update for pool=" << name_ << " backend=" << host_id; |
| 2181 | if (host_stats == nullptr) ss << " topic deletion"; |
| 2182 | if (it != remote_stats_.end()) ss << " previous: " << DebugPoolStats(it->second); |
| 2183 | if (host_stats != nullptr) ss << " new: " << DebugPoolStats(*host_stats); |
| 2184 | VLOG_ROW << ss.str(); |
| 2185 | } |
| 2186 | if (host_stats == nullptr) { |
| 2187 | if (it != remote_stats_.end()) { |
| 2188 | remote_stats_.erase(it); |
| 2189 | } else { |
| 2190 | VLOG_QUERY << "Attempted to remove non-existent remote stats for host=" << host_id; |
| 2191 | } |
| 2192 | } else { |
| 2193 | remote_stats_[host_id] = *host_stats; |
| 2194 | } |
| 2195 | } |
| 2196 | |
| 2197 | void AdmissionController::HandleTopicUpdates( |
| 2198 | const vector<TTopicItem>& topic_updates, set<string>& pool_stats_removed_nodes) { |
no test coverage detected