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

Function createLabels

src/tests/hierarchical_allocator_tests.cpp:7675–7688  ·  view source on GitHub ↗

Returns the requested number of labels: [{" _1": " _1"}, ..., {" _ ":" _ "}]

Source from the content-addressed store, hash-verified

7673// Returns the requested number of labels:
7674// [{"<key>_1": "<value>_1"}, ..., {"<key>_<count>":"<value>_<count>"}]
7675static Labels createLabels(
7676 const string& key,
7677 const string& value,
7678 size_t count)
7679{
7680 Labels labels;
7681
7682 for (size_t i = 0; i < count; i++) {
7683 const string index = stringify(i);
7684 labels.add_labels()->CopyFrom(createLabel(key + index, value + index));
7685 }
7686
7687 return labels;
7688}
7689
7690
7691// TODO(neilc): Refactor to reduce code duplication with `DeclineOffers` test.

Callers 1

TEST_PFunction · 0.85

Calls 3

createLabelFunction · 0.85
CopyFromMethod · 0.80
stringifyFunction · 0.50

Tested by

no test coverage detected