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

Method initialize

src/log/log.cpp:104–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

102
103
104void LogProcess::initialize()
105{
106 if (group != nullptr) {
107 // Need to add our replica to the ZooKeeper group!
108 LOG(INFO) << "Attempting to join replica to ZooKeeper group";
109
110 membership = group->join(replica->pid())
111 .onFailed(defer(self(), &Self::failed, lambda::_1))
112 .onDiscarded(defer(self(), &Self::discarded));
113
114 // We save and pass the pid of the replica to the 'watch' function
115 // because the field member 'replica' is not available during
116 // recovery. We need the pid to renew the replicas membership.
117 group->watch()
118 .onReady(defer(self(), &Self::watch, replica->pid(), lambda::_1))
119 .onFailed(defer(self(), &Self::failed, lambda::_1))
120 .onDiscarded(defer(self(), &Self::discarded));
121 }
122
123 // Start the recovery.
124 recover();
125}
126
127
128void LogProcess::finalize()

Callers

nothing calls this directly

Calls 5

deferFunction · 0.85
recoverFunction · 0.70
joinMethod · 0.65
pidMethod · 0.45
watchMethod · 0.45

Tested by

no test coverage detected