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

Method initialize

src/launcher/executor.cpp:279–311  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

277
278protected:
279 void initialize() override
280 {
281 Option<string> value = os::getenv("MESOS_HTTP_COMMAND_EXECUTOR");
282
283 // We initialize the library here to ensure that callbacks are only invoked
284 // after the process has spawned.
285 if (value.isSome() && value.get() == "1") {
286 mesos.reset(new Mesos(
287 ContentType::PROTOBUF,
288 defer(self(), &Self::connected),
289 defer(self(), &Self::disconnected),
290 defer(self(), [this](queue<v1::executor::Event> events) {
291 while(!events.empty()) {
292 const v1::executor::Event& event = events.front();
293 received(devolve(event));
294
295 events.pop();
296 }
297 })));
298 } else {
299 mesos.reset(new V0ToV1Adapter(
300 defer(self(), &Self::connected),
301 defer(self(), &Self::disconnected),
302 defer(self(), [this](queue<v1::executor::Event> events) {
303 while(!events.empty()) {
304 const v1::executor::Event& event = events.front();
305 received(devolve(event));
306
307 events.pop();
308 }
309 })));
310 }
311 }
312
313 void taskCheckUpdated(
314 const TaskID& _taskId,

Callers

nothing calls this directly

Calls 7

deferFunction · 0.85
getenvFunction · 0.50
devolveFunction · 0.50
isSomeMethod · 0.45
getMethod · 0.45
resetMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected