Renamed a private member function in DRFSorter. Renamed `update(const string&)` to `updateShare(const string&)`. The sorter interface already includes two different member functions named `update` that do different things, so being a bit more explicit seems helpful.
Review: https://reviews.apache.org/r/56351 Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/dd33d26c Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/dd33d26c Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/dd33d26c Branch: refs/heads/master Commit: dd33d26cb002ed553f4eab77b4c492521f9d6e29 Parents: 7ddfce6 Author: Neil Conway <[email protected]> Authored: Mon Feb 6 14:09:30 2017 -0800 Committer: Neil Conway <[email protected]> Committed: Fri Feb 17 18:30:03 2017 -0800 ---------------------------------------------------------------------- src/master/allocator/sorter/drf/sorter.cpp | 10 +++++----- src/master/allocator/sorter/drf/sorter.hpp | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/dd33d26c/src/master/allocator/sorter/drf/sorter.cpp ---------------------------------------------------------------------- diff --git a/src/master/allocator/sorter/drf/sorter.cpp b/src/master/allocator/sorter/drf/sorter.cpp index cecf08b..ed54680 100644 --- a/src/master/allocator/sorter/drf/sorter.cpp +++ b/src/master/allocator/sorter/drf/sorter.cpp @@ -92,7 +92,7 @@ void DRFSorter::update(const string& name, double weight) // recalculate all the shares, so don't bother just // updating this client. if (!dirty) { - update(name); + updateShare(name); } } @@ -158,7 +158,7 @@ void DRFSorter::allocated( // an agent re-registers that is running tasks for a framework that // has not yet re-registered. if (it != clients.end()) { - // TODO(benh): Refactor 'update' to be able to reuse it here. + // TODO(benh): Refactor 'updateShare' to be able to reuse it here. Client client(*it); // Update the 'allocations' to reflect the allocator decision. @@ -189,7 +189,7 @@ void DRFSorter::allocated( // If the total resources have changed, we're going to recalculate // all the shares, so don't bother just updating this client. if (!dirty) { - update(name); + updateShare(name); } } @@ -325,7 +325,7 @@ void DRFSorter::unallocated( } if (!dirty) { - update(name); + updateShare(name); } } @@ -437,7 +437,7 @@ int DRFSorter::count() const } -void DRFSorter::update(const string& name) +void DRFSorter::updateShare(const string& name) { set<Client, DRFComparator>::iterator it = find(name); http://git-wip-us.apache.org/repos/asf/mesos/blob/dd33d26c/src/master/allocator/sorter/drf/sorter.hpp ---------------------------------------------------------------------- diff --git a/src/master/allocator/sorter/drf/sorter.hpp b/src/master/allocator/sorter/drf/sorter.hpp index 9063498..7632922 100644 --- a/src/master/allocator/sorter/drf/sorter.hpp +++ b/src/master/allocator/sorter/drf/sorter.hpp @@ -132,7 +132,7 @@ public: private: // Recalculates the share for the client and moves // it in 'clients' accordingly. - void update(const std::string& name); + void updateShare(const std::string& name); // Returns the dominant resource share for the client. double calculateShare(const std::string& name) const;
