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

Method garbageCollect

src/slave/slave.cpp:8541–8560  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8539
8540
8541Future<Nothing> Slave::garbageCollect(const string& path)
8542{
8543 Try<long> mtime = os::stat::mtime(path);
8544 if (mtime.isError()) {
8545 LOG(ERROR) << "Failed to find the mtime of '" << path
8546 << "': " << mtime.error();
8547 return Failure(mtime.error());
8548 }
8549
8550 // It is unsafe for testing to use unix time directly, we must use
8551 // Time::create to convert into a Time object that reflects the
8552 // possibly advanced state of the libprocess Clock.
8553 Try<Time> time = Time::create(mtime.get());
8554 CHECK_SOME(time);
8555
8556 // GC based on the modification time.
8557 Duration delay = flags.gc_delay - (Clock::now() - time.get());
8558
8559 return gc->schedule(delay, path);
8560}
8561
8562
8563void Slave::forwardOversubscribed()

Callers 3

recoverExecutorMethod · 0.45
foreachvalueFunction · 0.45
completeTaskMethod · 0.45

Calls 7

FailureClass · 0.85
errorMethod · 0.65
mtimeFunction · 0.50
createFunction · 0.50
isErrorMethod · 0.45
getMethod · 0.45
scheduleMethod · 0.45

Tested by

no test coverage detected