MCPcopy Create free account
hub / github.com/apache/mesos / update

Method update

src/master/master.cpp:12967–12997  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12965
12966
12967Try<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 {

Callers 5

apiMethod · 0.45
weightsMethod · 0.45
___reregisterSlaveMethod · 0.45
updateFrameworkMethod · 0.45
statusUpdateMethod · 0.45

Calls 8

NothingClass · 0.85
errorMethod · 0.65
ErrorFunction · 0.50
CapabilitiesClass · 0.50
resourcesMethod · 0.45
isErrorMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected