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

Method registered

src/python/executor/src/mesos/executor/proxy_executor.cpp:38–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36namespace python {
37
38void ProxyExecutor::registered(ExecutorDriver* driver,
39 const ExecutorInfo& executorInfo,
40 const FrameworkInfo& frameworkInfo,
41 const SlaveInfo& slaveInfo)
42{
43 InterpreterLock lock;
44
45 PyObject* executorInfoObj = nullptr;
46 PyObject* frameworkInfoObj = nullptr;
47 PyObject* slaveInfoObj = nullptr;
48 PyObject* res = nullptr;
49
50 executorInfoObj = createPythonProtobuf(executorInfo, "ExecutorInfo");
51 frameworkInfoObj = createPythonProtobuf(frameworkInfo, "FrameworkInfo");
52 slaveInfoObj = createPythonProtobuf(slaveInfo, "SlaveInfo");
53
54 if (executorInfoObj == nullptr ||
55 frameworkInfoObj == nullptr ||
56 slaveInfoObj == nullptr) {
57 goto cleanup; // createPythonProtobuf will have set an exception.
58 }
59
60 res = PyObject_CallMethod(impl->pythonExecutor,
61 (char*) "registered",
62 (char*) "OOOO",
63 impl,
64 executorInfoObj,
65 frameworkInfoObj,
66 slaveInfoObj);
67 if (res == nullptr) {
68 cerr << "Failed to call executor registered" << endl;
69 goto cleanup;
70 }
71
72cleanup:
73 if (PyErr_Occurred()) {
74 PyErr_Print();
75 driver->abort();
76 }
77 Py_XDECREF(executorInfoObj);
78 Py_XDECREF(frameworkInfoObj);
79 Py_XDECREF(slaveInfoObj);
80 Py_XDECREF(res);
81}
82
83
84void ProxyExecutor::reregistered(ExecutorDriver* driver,

Callers

nothing calls this directly

Calls 2

createPythonProtobufFunction · 0.85
abortMethod · 0.65

Tested by

no test coverage detected