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

Method frameworkMessage

src/python/scheduler/src/mesos/scheduler/proxy_scheduler.cpp:244–286  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

242
243
244void ProxyScheduler::frameworkMessage(SchedulerDriver* driver,
245 const ExecutorID& executorId,
246 const SlaveID& slaveId,
247 const string& data)
248{
249 InterpreterLock lock;
250
251 PyObject* eid = nullptr;
252 PyObject* sid = nullptr;
253 PyObject* res = nullptr;
254
255 eid = createPythonProtobuf(executorId, "ExecutorID");
256 if (eid == nullptr) {
257 goto cleanup; // createPythonProtobuf will have set an exception.
258 }
259
260 sid = createPythonProtobuf(slaveId, "SlaveID");
261 if (sid == nullptr) {
262 goto cleanup; // createPythonProtobuf will have set an exception.
263 }
264
265 res = PyObject_CallMethod(impl->pythonScheduler,
266 (char*) "frameworkMessage",
267 (char*) "OOOs#",
268 impl,
269 eid,
270 sid,
271 data.data(),
272 data.length());
273 if (res == nullptr) {
274 cerr << "Failed to call scheduler's frameworkMessage" << endl;
275 goto cleanup;
276 }
277
278cleanup:
279 if (PyErr_Occurred()) {
280 PyErr_Print();
281 driver->abort();
282 }
283 Py_XDECREF(eid);
284 Py_XDECREF(sid);
285 Py_XDECREF(res);
286}
287
288
289void ProxyScheduler::slaveLost(SchedulerDriver* driver, const SlaveID& slaveId)

Callers

nothing calls this directly

Calls 3

createPythonProtobufFunction · 0.85
dataMethod · 0.80
abortMethod · 0.65

Tested by

no test coverage detected