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

Method truncate

src/state/log.cpp:382–390  ·  view source on GitHub ↗

TODO(benh): Truncation could be optimized by saving the "oldest" snapshot and only doing a truncation if/when we update that snapshot. TODO(benh): Truncation is not enough to keep the log size small as the log could get very fragmented. We'll need a way to defragment the log as some state entries might not get set over a long period of time and their associated snapshots are causing the log to gro

Source from the content-addressed store, hash-verified

380// of time and their associated snapshots are causing the log to grow
381// very big.
382void LogStorageProcess::truncate()
383{
384 // We lock the truncation since it includes a call to
385 // Log::Writer::truncate which must be serialized with calls to
386 // Log::Writer::append.
387 mutex.lock()
388 .then(defer(self(), &Self::_truncate))
389 .onAny(lambda::bind(&Mutex::unlock, mutex));
390}
391
392
393Future<Nothing> LogStorageProcess::_truncate()

Callers 1

_truncateMethod · 0.45

Calls 4

deferFunction · 0.85
lockMethod · 0.80
bindFunction · 0.50
thenMethod · 0.45

Tested by

no test coverage detected