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

Function validateResources

src/master/validation.cpp:1228–1255  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1226
1227
1228Option<Error> validateResources(const ExecutorInfo& executor)
1229{
1230 Option<Error> error = resource::validate(executor.resources());
1231 if (error.isSome()) {
1232 return Error("Executor uses invalid resources: " + error->message);
1233 }
1234
1235 const Resources& resources = executor.resources();
1236
1237 error = resource::validateUniquePersistenceID(resources);
1238 if (error.isSome()) {
1239 return Error(
1240 "Executor uses duplicate persistence ID: " + error->message);
1241 }
1242
1243 error = resource::validateAllocatedToSingleRole(resources);
1244 if (error.isSome()) {
1245 return Error("Invalid executor resources: " + error->message);
1246 }
1247
1248 error = resource::validateRevocableAndNonRevocableResources(resources);
1249 if (error.isSome()) {
1250 return Error("Executor mixes revocable and non-revocable resources: " +
1251 error->message);
1252 }
1253
1254 return None();
1255}
1256
1257
1258// Validates the `CommandInfo` contained within an `ExecutorInfo`.

Callers 1

TEST_FFunction · 0.85

Calls 9

NoneClass · 0.85
validateFunction · 0.70
ErrorFunction · 0.50
resourcesMethod · 0.45
isSomeMethod · 0.45
emptyMethod · 0.45

Tested by 1

TEST_FFunction · 0.68