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

Function machines

src/master/maintenance.cpp:264–290  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

262
263
264Try<Nothing> machines(const RepeatedPtrField<MachineID>& ids)
265{
266 if (ids.size() <= 0) {
267 return Error("List of machines is empty");
268 }
269
270 // Verify that the machine has at least one non-empty field value.
271 hashset<MachineID> uniques;
272 foreach (const MachineID& id, ids) {
273 // Validate the single machine.
274 Try<Nothing> validId = validation::machine(id);
275 if (validId.isError()) {
276 return Error(validId.error());
277 }
278
279 // Check machine uniqueness.
280 if (uniques.contains(id)) {
281 return Error(
282 "Machine '" + stringify(JSON::protobuf(id)) +
283 "' appears more than once in the schedule");
284 }
285
286 uniques.insert(id);
287 }
288
289 return Nothing();
290}
291
292
293Try<Nothing> machine(const MachineID& id)

Callers 2

_startMaintenanceMethod · 0.85
_stopMaintenanceMethod · 0.85

Calls 3

NothingClass · 0.85
ErrorFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected