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

Function enable

src/linux/cgroups.cpp:2500–2519  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2498
2499
2500Try<Nothing> enable(const string& hierarchy, const string& cgroup)
2501{
2502 Try<bool> enabled = killer::enabled(hierarchy, cgroup);
2503
2504 if (enabled.isError()) {
2505 return Error(enabled.error());
2506 }
2507
2508 if (!enabled.get()) {
2509 Try<Nothing> write = cgroups::write(
2510 hierarchy, cgroup, "memory.oom_control", "0");
2511
2512 if (write.isError()) {
2513 return Error("Could not write 'memory.oom_control' control file: " +
2514 write.error());
2515 }
2516 }
2517
2518 return Nothing();
2519}
2520
2521
2522Try<Nothing> disable(const string& hierarchy, const string& cgroup)

Callers 1

createMethod · 0.85

Calls 7

NothingClass · 0.85
enabledFunction · 0.70
writeFunction · 0.70
errorMethod · 0.65
ErrorFunction · 0.50
isErrorMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected