You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by mz...@apache.org on 2019/08/22 23:35:46 UTC
[mesos] branch master updated: Avoided copying the clientPath in
the sorter.
This is an automated email from the ASF dual-hosted git repository.
mzhu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git
The following commit(s) were added to refs/heads/master by this push:
new adb442f Avoided copying the clientPath in the sorter.
adb442f is described below
commit adb442fbb26d07216b1351f51e3a21366bb07bbc
Author: Meng Zhu <mz...@mesosphere.io>
AuthorDate: Tue Aug 20 17:40:41 2019 -0700
Avoided copying the clientPath in the sorter.
This patch made the clientPath method return a reference
instead of a value.
However this dose not avoid copies during the sorting where
copy construction of the clients map are unavoidable.
Review: https://reviews.apache.org/r/71333
---
src/master/allocator/mesos/sorter/drf/sorter.hpp | 2 +-
src/master/allocator/mesos/sorter/random/sorter.hpp | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/master/allocator/mesos/sorter/drf/sorter.hpp b/src/master/allocator/mesos/sorter/drf/sorter.hpp
index 5370860..f157ec6 100644
--- a/src/master/allocator/mesos/sorter/drf/sorter.hpp
+++ b/src/master/allocator/mesos/sorter/drf/sorter.hpp
@@ -264,7 +264,7 @@ struct DRFSorter::Node
// (virtual leaf), and "a/b". The `clientPath()` of "a/." is "a",
// because that is the name of the client associated with that
// virtual leaf node.
- std::string clientPath() const
+ const std::string& clientPath() const
{
if (name == ".") {
CHECK(kind == ACTIVE_LEAF || kind == INACTIVE_LEAF);
diff --git a/src/master/allocator/mesos/sorter/random/sorter.hpp b/src/master/allocator/mesos/sorter/random/sorter.hpp
index f18b014..8663ccd 100644
--- a/src/master/allocator/mesos/sorter/random/sorter.hpp
+++ b/src/master/allocator/mesos/sorter/random/sorter.hpp
@@ -287,7 +287,7 @@ struct RandomSorter::Node
// (virtual leaf), and "a/b". The `clientPath()` of "a/." is "a",
// because that is the name of the client associated with that
// virtual leaf node.
- std::string clientPath() const
+ const std::string& clientPath() const
{
if (name == ".") {
CHECK(kind == ACTIVE_LEAF || kind == INACTIVE_LEAF);