Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
Resource Mgmt RI12 Sp 43
-
3
Description
In allocator and sorter, we need to do a lot of quantity calculations. Currently, we use the full Resources type with utilities like createScalarResourceQuantities(), even though we only care about quantities. Replace Resources with ResourceQuantities.
See:
https://github.com/apache/mesos/blob/386b1fe99bb9d10af2abaca4832bf584b6181799/src/master/allocator/sorter/drf/sorter.hpp#L444-L445
https://reviews.apache.org/r/70061/
With the addition of ResourceQuantities, callers can now just do ResourceQuantities.fromScalarResources(r.scalars()) instead of using Resources::createStrippedScalarQuantity(), which should actually be a bit more efficient since we only copy the shared pointers rather than construct new `Resource` objects.