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

Method count

src/common/resources.cpp:1585–1598  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1583
1584
1585size_t Resources::count(const Resource& that) const
1586{
1587 foreach (
1588 const Resource_Unsafe& resource_,
1589 resourcesNoMutationWithoutExclusiveOwnership) {
1590 if (resource_->resource == that) {
1591 // Return 1 for non-shared resources because non-shared
1592 // Resource objects in Resources are unique.
1593 return resource_->isShared() ? CHECK_NOTNONE(resource_->sharedCount) : 1;
1594 }
1595 }
1596
1597 return 0;
1598}
1599
1600
1601void Resources::allocate(const string& role)

Callers 1

foreachFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected