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

Method watched

src/log/consensus.cpp:483–519  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

481
482private:
483 void watched(const Future<size_t>& future)
484 {
485 if (!future.isReady()) {
486 promise.fail(
487 future.isFailed() ?
488 future.failure() :
489 "Not expecting discarded future");
490
491 terminate(self());
492 return;
493 }
494
495 CHECK_GE(future.get(), quorum);
496
497 request.set_proposal(proposal);
498 request.set_position(action.position());
499 request.set_type(action.type());
500 switch (action.type()) {
501 case Action::NOP:
502 CHECK(action.has_nop());
503 request.mutable_nop();
504 break;
505 case Action::APPEND:
506 CHECK(action.has_append());
507 request.mutable_append()->CopyFrom(action.append());
508 break;
509 case Action::TRUNCATE:
510 CHECK(action.has_truncate());
511 request.mutable_truncate()->CopyFrom(action.truncate());
512 break;
513 default:
514 LOG(FATAL) << "Unknown Action::Type " << action.type();
515 }
516
517 network->broadcast(protocol::write, request)
518 .onAny(defer(self(), &Self::broadcasted, lambda::_1));
519 }
520
521 void broadcasted(const Future<set<Future<WriteResponse>>>& future)
522 {

Callers

nothing calls this directly

Calls 13

deferFunction · 0.85
isReadyMethod · 0.80
isFailedMethod · 0.80
failureMethod · 0.80
typeMethod · 0.80
CopyFromMethod · 0.80
terminateFunction · 0.50
failMethod · 0.45
getMethod · 0.45
positionMethod · 0.45
appendMethod · 0.45
truncateMethod · 0.45

Tested by

no test coverage detected