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

Method contains

src/common/resources.cpp:1379–1396  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1377
1378
1379bool Resources::Resource_::contains(const Resource_& that) const
1380{
1381 // Both Resource_ objects should have the same sharedness.
1382 if (isShared() != that.isShared()) {
1383 return false;
1384 }
1385
1386 // Assuming the wrapped Resource objects are equal, the 'contains'
1387 // relationship is determined by the relationship of the counters
1388 // for shared resources.
1389 if (isShared()) {
1390 return sharedCount.get() >= that.sharedCount.get() &&
1391 resource == that.resource;
1392 }
1393
1394 // For non-shared resources just compare the protobufs.
1395 return mesos::contains(resource, that.resource);
1396}
1397
1398
1399Resources::Resource_& Resources::Resource_::operator+=(const Resource_& that)

Callers 15

foreachMethod · 0.45
foreachFunction · 0.45
foreachFunction · 0.45
operator==Method · 0.45
applyMethod · 0.45
approvedMethod · 0.45
foreachFunction · 0.45
authorizeEndpointFunction · 0.45
foreachFunction · 0.45
getServiceEndpointMethod · 0.45

Calls 6

containsFunction · 0.70
validateFunction · 0.70
Resource_Class · 0.50
isSharedMethod · 0.45
getMethod · 0.45
isNoneMethod · 0.45

Tested by

no test coverage detected