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

Function hierarchy

src/linux/cgroups.cpp:473–498  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

471
472
473Result<string> hierarchy(const string& subsystems)
474{
475 Result<string> hierarchy = None();
476 Try<set<string>> hierarchies = cgroups::hierarchies();
477 if (hierarchies.isError()) {
478 return Error(hierarchies.error());
479 }
480
481 foreach (const string& candidate, hierarchies.get()) {
482 if (subsystems.empty()) {
483 hierarchy = candidate;
484 break;
485 }
486
487 // Check and see if this candidate meets our subsystem requirements.
488 Try<bool> mounted = cgroups::mounted(candidate, subsystems);
489 if (mounted.isError()) {
490 return Error(mounted.error());
491 } else if (mounted.get()) {
492 hierarchy = candidate;
493 break;
494 }
495 }
496
497 return hierarchy;
498}
499
500
501Try<bool> enabled(const string& subsystems)

Callers 15

prepareFunction · 0.70
foreachFunction · 0.50
CfsFilterMethod · 0.50
TEST_FFunction · 0.50
foreachMethod · 0.50
TEST_PFunction · 0.50
TEST_FFunction · 0.50
foreachFunction · 0.50
TEST_FFunction · 0.50
__updateMethod · 0.50
cgroupsStatisticsMethod · 0.50
createMethod · 0.50

Calls 5

NoneClass · 0.85
hierarchiesFunction · 0.85
errorMethod · 0.65
ErrorFunction · 0.50
isErrorMethod · 0.45

Tested by 8

foreachFunction · 0.40
CfsFilterMethod · 0.40
TEST_FFunction · 0.40
foreachMethod · 0.40
TEST_PFunction · 0.40
TEST_FFunction · 0.40
foreachFunction · 0.40
TEST_FFunction · 0.40