| 1659 | } |
| 1660 | |
| 1661 | Status MasterSession::ListDevices(ListDevicesResponse* resp) const { |
| 1662 | if (worker_cache_) { |
| 1663 | // This is a ClusterSpec-propagated session, and thus env_->local_devices |
| 1664 | // are invalid. |
| 1665 | |
| 1666 | // Mark the "client_device" as the sole local device. |
| 1667 | const Device* client_device = devices_->client_device(); |
| 1668 | for (const Device* dev : devices_->devices()) { |
| 1669 | if (dev != client_device) { |
| 1670 | *(resp->add_remote_device()) = dev->attributes(); |
| 1671 | } |
| 1672 | } |
| 1673 | *(resp->add_local_device()) = client_device->attributes(); |
| 1674 | } else { |
| 1675 | for (Device* dev : env_->local_devices) { |
| 1676 | *(resp->add_local_device()) = dev->attributes(); |
| 1677 | } |
| 1678 | for (auto&& dev : *remote_devs_) { |
| 1679 | *(resp->add_local_device()) = dev->attributes(); |
| 1680 | } |
| 1681 | } |
| 1682 | return Status::OK(); |
| 1683 | } |
| 1684 | |
| 1685 | Status MasterSession::Extend(const ExtendSessionRequest* req, |
| 1686 | ExtendSessionResponse* resp) { |
nothing calls this directly
no test coverage detected