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

Function model

src/common/http.cpp:453–477  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

451
452
453JSON::Object model(const Resources& resources)
454{
455 JSON::Object object;
456 object.values["cpus"] = 0;
457 object.values["gpus"] = 0;
458 object.values["mem"] = 0;
459 object.values["disk"] = 0;
460
461 // Model non-revocable resources.
462 Resources nonRevocable = resources.nonRevocable();
463
464 foreachpair (
465 const string& name, const Value::Type& type, nonRevocable.types()) {
466 object.values[name] = value(name, type, nonRevocable);
467 }
468
469 // Model revocable resources.
470 Resources revocable = resources.revocable();
471
472 foreachpair (const string& name, const Value::Type& type, revocable.types()) {
473 object.values[name + "_revocable"] = value(name, type, revocable);
474 }
475
476 return object;
477}
478
479
480JSON::Object model(const hashmap<string, Resources>& roleResources)

Callers 6

foreachpairFunction · 0.70
foreachFunction · 0.70
foreachFunction · 0.50
TEST_FFunction · 0.50
TEST_FFunction · 0.50
TESTFunction · 0.50

Calls 15

protobufFunction · 0.85
NanosecondsClass · 0.85
S_ISREGFunction · 0.85
S_ISDIRFunction · 0.85
S_ISCHRFunction · 0.85
S_ISBLKFunction · 0.85
S_ISFIFOFunction · 0.85
S_ISLNKFunction · 0.85
S_ISSOCKFunction · 0.85
formatFunction · 0.85
userMethod · 0.80
commandMethod · 0.80

Tested by 3

TEST_FFunction · 0.40
TEST_FFunction · 0.40
TESTFunction · 0.40