| 173 | } |
| 174 | |
| 175 | bool ExecutorGroup::LookUpExecutorIp(const Hostname& hostname, IpAddr* ip) const { |
| 176 | // Check if hostname is already a valid IP address. |
| 177 | if (executor_map_.find(hostname) != executor_map_.end()) { |
| 178 | if (ip != nullptr) *ip = hostname; |
| 179 | return true; |
| 180 | } |
| 181 | auto it = executor_ip_map_.find(hostname); |
| 182 | if (it != executor_ip_map_.end()) { |
| 183 | if (ip != nullptr) *ip = it->second; |
| 184 | return true; |
| 185 | } |
| 186 | return false; |
| 187 | } |
| 188 | |
| 189 | const BackendDescriptorPB* ExecutorGroup::LookUpBackendDesc( |
| 190 | const NetworkAddressPB& host) const { |