| 12965 | |
| 12966 | |
| 12967 | Try<Nothing> Slave::update( |
| 12968 | const SlaveInfo& _info, |
| 12969 | const string& _version, |
| 12970 | const vector<SlaveInfo::Capability>& _capabilities, |
| 12971 | const Resources& _checkpointedResources, |
| 12972 | const Option<UUID>& _resourceVersion) |
| 12973 | { |
| 12974 | Try<Resources> resources = applyCheckpointedResources( |
| 12975 | _info.resources(), |
| 12976 | _checkpointedResources); |
| 12977 | |
| 12978 | // This should be validated during slave recovery. |
| 12979 | if (resources.isError()) { |
| 12980 | return Error(resources.error()); |
| 12981 | } |
| 12982 | |
| 12983 | version = _version; |
| 12984 | capabilities = protobuf::slave::Capabilities(_capabilities); |
| 12985 | info = _info; |
| 12986 | checkpointedResources = _checkpointedResources; |
| 12987 | |
| 12988 | // There is a short window here where `totalResources` can have an old value, |
| 12989 | // but it should be relatively short because the agent will send |
| 12990 | // an `UpdateSlaveMessage` with the new total resources immediately after |
| 12991 | // reregistering in this case. |
| 12992 | totalResources = resources.get(); |
| 12993 | |
| 12994 | resourceVersion = _resourceVersion; |
| 12995 | |
| 12996 | return Nothing(); |
| 12997 | } |
| 12998 | |
| 12999 | } // namespace master { |
| 13000 | } // namespace internal { |
no test coverage detected