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

Function convertLabelsToStringMap

src/common/protobuf_utils.cpp:684–701  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

682
683
684Try<Map<string, string>> convertLabelsToStringMap(const Labels& labels)
685{
686 Map<string, string> map;
687
688 foreach (const Label& label, labels.labels()) {
689 if (map.count(label.key())) {
690 return Error("Repeated key '" + label.key() + "' in labels");
691 }
692
693 if (!label.has_value()) {
694 return Error("Missing value for key '" + label.key() + "' in labels");
695 }
696
697 map[label.key()] = label.value();
698 }
699
700 return map;
701}
702
703
704void injectAllocationInfo(

Callers 2

applyCreateDiskMethod · 0.85
TESTFunction · 0.85

Calls

no outgoing calls

Tested by 1

TESTFunction · 0.68