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

Method _update

src/master/registrar.cpp:517–560  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

515
516
517void RegistrarProcess::_update(
518 const Future<Option<Variable>>& store,
519 const Owned<Registry>& updatedRegistry,
520 deque<Owned<RegistryOperation>> applied)
521{
522 updating = false;
523
524 // Abort if the storage operation did not succeed.
525 if (!store.isReady() || store->isNone()) {
526 string message = "Failed to update registry: ";
527
528 if (store.isFailed()) {
529 message += store.failure();
530 } else if (store.isDiscarded()) {
531 message += "discarded";
532 } else {
533 message += "version mismatch";
534 }
535
536 fail(&applied, message);
537 abort(message);
538
539 return;
540 }
541
542 Duration elapsed = metrics.state_store.stop();
543
544 LOG(INFO) << "Successfully updated the registry in " << elapsed;
545
546 variable = store->get();
547 registry->Swap(updatedRegistry.get());
548
549 // Remove the operations.
550 while (!applied.empty()) {
551 Owned<RegistryOperation> operation = applied.front();
552 applied.pop_front();
553
554 operation->set();
555 }
556
557 if (!operations.empty()) {
558 update();
559 }
560}
561
562
563void RegistrarProcess::abort(const string& message)

Callers

nothing calls this directly

Calls 12

isReadyMethod · 0.80
isFailedMethod · 0.80
failureMethod · 0.80
isDiscardedMethod · 0.80
SwapMethod · 0.80
failFunction · 0.70
stopMethod · 0.65
updateFunction · 0.50
isNoneMethod · 0.45
getMethod · 0.45
emptyMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected