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

Function detectOverlappingSetAndRangeResources

src/master/validation.cpp:1007–1021  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1005
1006
1007bool detectOverlappingSetAndRangeResources(
1008 const vector<Resources>& resources)
1009{
1010 // If the sum of quantities of each `Resources` is not equal to the quantities
1011 // of the sum of `Resources`, then there is some overlap in ranges or sets.
1012 ResourceQuantities totalQuantities;
1013 Resources totalResources;
1014
1015 foreach (const Resources& resources_, resources) {
1016 totalQuantities += ResourceQuantities::fromResources(resources_);
1017 totalResources += resources_;
1018 }
1019
1020 return totalQuantities != ResourceQuantities::fromResources(totalResources);
1021}
1022
1023namespace internal {
1024

Callers 3

TEST_FFunction · 0.85

Calls

no outgoing calls

Tested by 1

TEST_FFunction · 0.68