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/05 21:26:51 UTC

[mesos] branch master updated: Moved the sorter code under the `master/allocator/mesos/`.

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 2b4f908  Moved the sorter code under the `master/allocator/mesos/`.
2b4f908 is described below

commit 2b4f908158b0e646ee06359640a3862741336dac
Author: Meng Zhu <mz...@mesosphere.io>
AuthorDate: Thu Aug 1 11:07:49 2019 -0700

    Moved the sorter code under the `master/allocator/mesos/`.
    
    The sorter interface is designed and used by the built-in
    hierarchical allocator. It is not intended to be used
    by other allocators. This patch moves it under the built-in
    mesos allocator folder for structural clarity.
    
    Review: https://reviews.apache.org/r/71230
---
 docs/allocation-module.md                                |  2 +-
 src/CMakeLists.txt                                       |  6 +++---
 src/Makefile.am                                          | 16 ++++++++--------
 src/local/local.cpp                                      |  2 +-
 src/master/allocator/mesos/hierarchical.hpp              |  4 ++--
 src/master/allocator/{ => mesos}/sorter/drf/metrics.cpp  |  4 ++--
 src/master/allocator/{ => mesos}/sorter/drf/metrics.hpp  |  0
 src/master/allocator/{ => mesos}/sorter/drf/sorter.cpp   |  2 +-
 src/master/allocator/{ => mesos}/sorter/drf/sorter.hpp   |  4 ++--
 .../allocator/{ => mesos}/sorter/random/sorter.cpp       |  4 ++--
 .../allocator/{ => mesos}/sorter/random/sorter.hpp       |  2 +-
 src/master/allocator/{ => mesos}/sorter/random/utils.hpp |  0
 src/master/allocator/{ => mesos}/sorter/sorter.hpp       |  0
 src/tests/sorter_tests.cpp                               |  6 +++---
 14 files changed, 26 insertions(+), 26 deletions(-)

diff --git a/docs/allocation-module.md b/docs/allocation-module.md
index 81f9d0c..15e0b58 100644
--- a/docs/allocation-module.md
+++ b/docs/allocation-module.md
@@ -23,7 +23,7 @@ The default allocator is `HierarchicalDRFAllocatorProcess`, which lives in `$MES
 
 Additionally, the built-in hierarchical allocator can be extended without the need to reimplement the entirety of the allocation logic. This is possible through the use of the `Sorter` abstraction. Sorters define the order in which hierarchy layers (e.g. roles or frameworks) should be offered resources by taking "client" objects and some information about those clients and returning an ordered list of clients.
 
-Sorters are implemented in C++ and inherit the `Sorter` class defined in `$MESOS_HOME/src/master/allocator/sorter/sorter.hpp`. The default sorter is `DRFSorter`, which implements fair sharing and can be found in `$MESOS_HOME/src/master/allocator/sorter/drf/sorter.hpp`. This sorter is capable of expressing priorities by specifying weights in `Sorter::add()`. Each client's share is divided by its weight. For example, a role that has a weight of 2 will be offered twice as many resources as  [...]
+Sorters are implemented in C++ and inherit the `Sorter` class defined in `$MESOS_HOME/src/master/allocator/mesos/sorter/sorter.hpp`. The default sorter is `DRFSorter`, which implements fair sharing and can be found in `$MESOS_HOME/src/master/allocator/mesos/sorter/drf/sorter.hpp`. This sorter is capable of expressing priorities by specifying weights in `Sorter::add()`. Each client's share is divided by its weight. For example, a role that has a weight of 2 will be offered twice as many r [...]
 
 <a name="wiring-up-a-custom-allocator"></a>
 ## Wiring up a custom allocator
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index e0200eb..0ec4442 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -426,9 +426,9 @@ set(MASTER_SRC
   master/allocator/allocator.cpp
   master/allocator/mesos/hierarchical.cpp
   master/allocator/mesos/metrics.cpp
-  master/allocator/sorter/drf/metrics.cpp
-  master/allocator/sorter/drf/sorter.cpp
-  master/allocator/sorter/random/sorter.cpp
+  master/allocator/mesos/sorter/drf/metrics.cpp
+  master/allocator/mesos/sorter/drf/sorter.cpp
+  master/allocator/mesos/sorter/random/sorter.cpp
   master/contender/contender.cpp
   master/contender/standalone.cpp
   master/contender/zookeeper.cpp
diff --git a/src/Makefile.am b/src/Makefile.am
index d27d4b6..0377c8d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1125,14 +1125,14 @@ libmesos_no_3rdparty_la_SOURCES +=					\
   master/allocator/mesos/hierarchical.hpp				\
   master/allocator/mesos/metrics.cpp					\
   master/allocator/mesos/metrics.hpp					\
-  master/allocator/sorter/drf/metrics.cpp				\
-  master/allocator/sorter/drf/metrics.hpp				\
-  master/allocator/sorter/drf/sorter.cpp				\
-  master/allocator/sorter/drf/sorter.hpp				\
-  master/allocator/sorter/random/sorter.cpp				\
-  master/allocator/sorter/random/sorter.hpp				\
-  master/allocator/sorter/random/utils.hpp				\
-  master/allocator/sorter/sorter.hpp					\
+  master/allocator/mesos/sorter/drf/metrics.cpp				\
+  master/allocator/mesos/sorter/drf/metrics.hpp				\
+  master/allocator/mesos/sorter/drf/sorter.cpp				\
+  master/allocator/mesos/sorter/drf/sorter.hpp				\
+  master/allocator/mesos/sorter/random/sorter.cpp				\
+  master/allocator/mesos/sorter/random/sorter.hpp				\
+  master/allocator/mesos/sorter/random/utils.hpp				\
+  master/allocator/mesos/sorter/sorter.hpp					\
   master/constants.cpp							\
   master/constants.hpp							\
   master/contender/contender.cpp					\
diff --git a/src/local/local.cpp b/src/local/local.cpp
index 68dc9fb..8ff4361 100644
--- a/src/local/local.cpp
+++ b/src/local/local.cpp
@@ -75,7 +75,7 @@
 #include "master/registrar.hpp"
 
 #include "master/allocator/mesos/hierarchical.hpp"
-#include "master/allocator/sorter/drf/sorter.hpp"
+#include "master/allocator/mesos/sorter/drf/sorter.hpp"
 
 #include "master/contender/standalone.hpp"
 
diff --git a/src/master/allocator/mesos/hierarchical.hpp b/src/master/allocator/mesos/hierarchical.hpp
index d2658bc..29dfa9f 100644
--- a/src/master/allocator/mesos/hierarchical.hpp
+++ b/src/master/allocator/mesos/hierarchical.hpp
@@ -39,8 +39,8 @@
 #include "master/allocator/mesos/allocator.hpp"
 #include "master/allocator/mesos/metrics.hpp"
 
-#include "master/allocator/sorter/drf/sorter.hpp"
-#include "master/allocator/sorter/random/sorter.hpp"
+#include "master/allocator/mesos/sorter/drf/sorter.hpp"
+#include "master/allocator/mesos/sorter/random/sorter.hpp"
 
 #include "master/constants.hpp"
 
diff --git a/src/master/allocator/sorter/drf/metrics.cpp b/src/master/allocator/mesos/sorter/drf/metrics.cpp
similarity index 95%
rename from src/master/allocator/sorter/drf/metrics.cpp
rename to src/master/allocator/mesos/sorter/drf/metrics.cpp
index ece151c..82cb530 100644
--- a/src/master/allocator/sorter/drf/metrics.cpp
+++ b/src/master/allocator/mesos/sorter/drf/metrics.cpp
@@ -14,7 +14,7 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-#include "master/allocator/sorter/drf/metrics.hpp"
+#include "master/allocator/mesos/sorter/drf/metrics.hpp"
 
 #include <process/defer.hpp>
 
@@ -23,7 +23,7 @@
 #include <stout/foreach.hpp>
 #include <stout/path.hpp>
 
-#include "master/allocator/sorter/drf/sorter.hpp"
+#include "master/allocator/mesos/sorter/drf/sorter.hpp"
 
 using std::string;
 
diff --git a/src/master/allocator/sorter/drf/metrics.hpp b/src/master/allocator/mesos/sorter/drf/metrics.hpp
similarity index 100%
rename from src/master/allocator/sorter/drf/metrics.hpp
rename to src/master/allocator/mesos/sorter/drf/metrics.hpp
diff --git a/src/master/allocator/sorter/drf/sorter.cpp b/src/master/allocator/mesos/sorter/drf/sorter.cpp
similarity index 99%
rename from src/master/allocator/sorter/drf/sorter.cpp
rename to src/master/allocator/mesos/sorter/drf/sorter.cpp
index 9367469..40397f7 100644
--- a/src/master/allocator/sorter/drf/sorter.cpp
+++ b/src/master/allocator/mesos/sorter/drf/sorter.cpp
@@ -14,7 +14,7 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-#include "master/allocator/sorter/drf/sorter.hpp"
+#include "master/allocator/mesos/sorter/drf/sorter.hpp"
 
 #include <iterator>
 #include <set>
diff --git a/src/master/allocator/sorter/drf/sorter.hpp b/src/master/allocator/mesos/sorter/drf/sorter.hpp
similarity index 99%
rename from src/master/allocator/sorter/drf/sorter.hpp
rename to src/master/allocator/mesos/sorter/drf/sorter.hpp
index 84c33ca..0da635c 100644
--- a/src/master/allocator/sorter/drf/sorter.hpp
+++ b/src/master/allocator/mesos/sorter/drf/sorter.hpp
@@ -31,9 +31,9 @@
 #include <stout/hashmap.hpp>
 #include <stout/option.hpp>
 
-#include "master/allocator/sorter/drf/metrics.hpp"
+#include "master/allocator/mesos/sorter/drf/metrics.hpp"
 
-#include "master/allocator/sorter/sorter.hpp"
+#include "master/allocator/mesos/sorter/sorter.hpp"
 
 
 namespace mesos {
diff --git a/src/master/allocator/sorter/random/sorter.cpp b/src/master/allocator/mesos/sorter/random/sorter.cpp
similarity index 99%
rename from src/master/allocator/sorter/random/sorter.cpp
rename to src/master/allocator/mesos/sorter/random/sorter.cpp
index 9899cfd..b480aee 100644
--- a/src/master/allocator/sorter/random/sorter.cpp
+++ b/src/master/allocator/mesos/sorter/random/sorter.cpp
@@ -14,8 +14,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-#include "master/allocator/sorter/random/sorter.hpp"
-#include "master/allocator/sorter/random/utils.hpp"
+#include "master/allocator/mesos/sorter/random/sorter.hpp"
+#include "master/allocator/mesos/sorter/random/utils.hpp"
 
 #include <set>
 #include <string>
diff --git a/src/master/allocator/sorter/random/sorter.hpp b/src/master/allocator/mesos/sorter/random/sorter.hpp
similarity index 99%
rename from src/master/allocator/sorter/random/sorter.hpp
rename to src/master/allocator/mesos/sorter/random/sorter.hpp
index ca687d4..1c22054 100644
--- a/src/master/allocator/sorter/random/sorter.hpp
+++ b/src/master/allocator/mesos/sorter/random/sorter.hpp
@@ -33,7 +33,7 @@
 #include <stout/hashset.hpp>
 #include <stout/option.hpp>
 
-#include "master/allocator/sorter/sorter.hpp"
+#include "master/allocator/mesos/sorter/sorter.hpp"
 
 
 namespace mesos {
diff --git a/src/master/allocator/sorter/random/utils.hpp b/src/master/allocator/mesos/sorter/random/utils.hpp
similarity index 100%
rename from src/master/allocator/sorter/random/utils.hpp
rename to src/master/allocator/mesos/sorter/random/utils.hpp
diff --git a/src/master/allocator/sorter/sorter.hpp b/src/master/allocator/mesos/sorter/sorter.hpp
similarity index 100%
rename from src/master/allocator/sorter/sorter.hpp
rename to src/master/allocator/mesos/sorter/sorter.hpp
diff --git a/src/tests/sorter_tests.cpp b/src/tests/sorter_tests.cpp
index 5cd2a64..fc33971 100644
--- a/src/tests/sorter_tests.cpp
+++ b/src/tests/sorter_tests.cpp
@@ -25,10 +25,10 @@
 
 #include <stout/gtest.hpp>
 
-#include "master/allocator/sorter/drf/sorter.hpp"
+#include "master/allocator/mesos/sorter/drf/sorter.hpp"
 
-#include "master/allocator/sorter/random/sorter.hpp"
-#include "master/allocator/sorter/random/utils.hpp"
+#include "master/allocator/mesos/sorter/random/sorter.hpp"
+#include "master/allocator/mesos/sorter/random/utils.hpp"
 
 #include "tests/mesos.hpp"
 #include "tests/resources_utils.hpp"