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

Method set

src/common/resource_quantities.cpp:554–574  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

552
553
554void ResourceLimits::set(
555 const std::string& name, const Value::Scalar& scalar)
556{
557 // Find the location to insert while maintaining
558 // alphabetical ordering. Don't bother binary searching
559 // since we don't expect a large number of limits.
560 auto it = limits.begin();
561 for (; it != limits.end(); ++it) {
562 if (it->first == name) {
563 // Overwrite if it exists.
564 it->second = scalar;
565 return;
566 }
567
568 if (it->first > name) {
569 break;
570 }
571 }
572
573 it = limits.insert(it, std::make_pair(name, scalar));
574}
575
576
577ostream& operator<<(

Callers 14

___nestedCommandCheckMethod · 0.45
operator==Function · 0.45
resources.cppFile · 0.45
parseMethod · 0.45
validateMethod · 0.45
isEmptyMethod · 0.45
foreachFunction · 0.45
containsFunction · 0.45
foreachFunction · 0.45
completeMethod · 0.45
foreachMethod · 0.45
foreachFunction · 0.45

Calls 3

insertMethod · 0.80
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected