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

Method load

src/module/manager.cpp:359–395  ·  view source on GitHub ↗

We load the module manifests sequentially in an alphabetical order. If an error is encountered while processing a particular manifest, we do not load the remaining manifests and exit with the appropriate error message.

Source from the content-addressed store, hash-verified

357// error is encountered while processing a particular manifest, we do not load
358// the remaining manifests and exit with the appropriate error message.
359Try<Nothing> ModuleManager::load(const string& modulesDir)
360{
361 Try<list<string>> moduleManifests = os::ls(modulesDir);
362 if (moduleManifests.isError()) {
363 return Error(
364 "Error loading module manifests from '" + modulesDir + "' directory: " +
365 moduleManifests.error());
366 }
367
368 moduleManifests->sort();
369 foreach (const string& filename, moduleManifests.get()) {
370 const string filepath = path::join(modulesDir, filename);
371 VLOG(1) << "Processing module manifest from '" << filepath << "'";
372
373 Try<string> read = os::read(filepath);
374 if (read.isError()) {
375 return Error(
376 "Error reading module manifest file '" + filepath + "': " +
377 read.error());
378 }
379
380 Try<Modules> modules = flags::parse<Modules>(read.get());
381 if (modules.isError()) {
382 return Error(
383 "Error parsing module manifest file '" + filepath + "': " +
384 modules.error());
385 }
386
387 Try<Nothing> result = loadManifest(modules.get());
388 if (result.isError()) {
389 return Error(
390 "Error loading modules from '" + filepath + "': " + result.error());
391 }
392 }
393
394 return Nothing();
395}

Callers 15

MesosMethod · 0.45
__init__Method · 0.45
detectedMethod · 0.45
authenticateMethod · 0.45
_authenticateMethod · 0.45
registeredMethod · 0.45
reregisteredMethod · 0.45
resourceOffersMethod · 0.45
rescindOfferMethod · 0.45
statusUpdateMethod · 0.45
lostSlaveMethod · 0.45

Calls 6

NothingClass · 0.85
errorMethod · 0.65
lsFunction · 0.50
ErrorFunction · 0.50
isErrorMethod · 0.45
sortMethod · 0.45

Tested by 4

mainFunction · 0.36
mainFunction · 0.36
mainFunction · 0.36
mainFunction · 0.36