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

Method truncate

src/log/coordinator.cpp:326–343  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

324
325
326Future<Option<uint64_t>> CoordinatorProcess::truncate(uint64_t to)
327{
328 if (state == INITIAL || state == ELECTING) {
329 return None();
330 } else if (state == WRITING) {
331 return Failure("Coordinator is currently writing");
332 }
333
334 Action action;
335 action.set_position(index);
336 action.set_promised(proposal);
337 action.set_performed(proposal);
338 action.set_type(Action::TRUNCATE);
339 Action::Truncate* truncate = action.mutable_truncate();
340 truncate->set_to(to);
341
342 return write(action);
343}
344
345
346Future<Option<uint64_t>> CoordinatorProcess::write(const Action& action)

Callers

nothing calls this directly

Calls 4

NoneClass · 0.85
FailureClass · 0.85
writeFunction · 0.70
dispatchFunction · 0.50

Tested by

no test coverage detected