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

Function foreachpair

src/master/readonly_handler.cpp:235–253  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

233 // Model all of the executors of a framework.
234 writer->field("executors", [this](JSON::ArrayWriter* writer) {
235 foreachpair (
236 const SlaveID& slaveId,
237 const auto& executorsMap,
238 framework_->executors) {
239 foreachvalue (const ExecutorInfo& executor, executorsMap) {
240 writer->element([this,
241 &executor,
242 &slaveId](JSON::ObjectWriter* writer) {
243 // Skip unauthorized executors.
244 if (!approvers_->approved<VIEW_EXECUTOR>(
245 executor, framework_->info)) {
246 return;
247 }
248
249 json(writer, executor);
250 writer->field("slave_id", slaveId.value());
251 });
252 }
253 }
254 });
255
256 // Model all of the labels associated with a framework.

Callers

nothing calls this directly

Calls 4

fieldMethod · 0.80
elementMethod · 0.80
jsonFunction · 0.70
slavesMethod · 0.45

Tested by

no test coverage detected