You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ji...@apache.org on 2015/06/05 00:01:52 UTC

[2/2] mesos git commit: Adjusted the NoopResourceEstimator to the new slave semantics.

Adjusted the NoopResourceEstimator to the new slave semantics.

Review: https://reviews.apache.org/r/35082


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/2197e039
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/2197e039
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/2197e039

Branch: refs/heads/master
Commit: 2197e039e278f194b1aeef4dd6d20c9394842919
Parents: 7b99908
Author: Jie Yu <yu...@gmail.com>
Authored: Thu Jun 4 10:52:06 2015 -0700
Committer: Jie Yu <yu...@gmail.com>
Committed: Thu Jun 4 15:01:33 2015 -0700

----------------------------------------------------------------------
 src/slave/resource_estimators/noop.cpp | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/2197e039/src/slave/resource_estimators/noop.cpp
----------------------------------------------------------------------
diff --git a/src/slave/resource_estimators/noop.cpp b/src/slave/resource_estimators/noop.cpp
index 772eb4e..5f135ff 100644
--- a/src/slave/resource_estimators/noop.cpp
+++ b/src/slave/resource_estimators/noop.cpp
@@ -16,6 +16,8 @@
  * limitations under the License.
  */
 
+#include <list>
+
 #include <process/dispatch.hpp>
 #include <process/process.hpp>
 
@@ -25,6 +27,8 @@
 
 using namespace process;
 
+using std::list;
+
 namespace mesos {
 namespace internal {
 namespace slave {
@@ -33,20 +37,10 @@ class NoopResourceEstimatorProcess :
   public Process<NoopResourceEstimatorProcess>
 {
 public:
-  NoopResourceEstimatorProcess() : sent(false) {}
-
   Future<Resources> oversubscribable()
   {
-    if (!sent) {
-      sent = true;
-      return Resources();
-    }
-
-    return Future<Resources>();
+    return Resources();
   }
-
-private:
-  bool sent;
 };
 
 
@@ -60,7 +54,7 @@ NoopResourceEstimator::~NoopResourceEstimator()
 
 
 Try<Nothing> NoopResourceEstimator::initialize(
-    const lambda::function<Future<std::list<ResourceUsage>>()>& usages)
+    const lambda::function<Future<list<ResourceUsage>>()>& usages)
 {
   if (process.get() != NULL) {
     return Error("Noop resource estimator has already been initialized");