You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by mp...@apache.org on 2016/04/11 20:28:00 UTC

mesos git commit: Cleaned up dynamic reservation example framework.

Repository: mesos
Updated Branches:
  refs/heads/master be73cb48f -> 69aa2d650


Cleaned up dynamic reservation example framework.

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


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

Branch: refs/heads/master
Commit: 69aa2d650388b745b78a02a32bd8efbf63c2ebbe
Parents: be73cb4
Author: Neil Conway <ne...@gmail.com>
Authored: Mon Apr 11 11:20:48 2016 -0700
Committer: Michael Park <mp...@apache.org>
Committed: Mon Apr 11 11:20:48 2016 -0700

----------------------------------------------------------------------
 src/examples/dynamic_reservation_framework.cpp | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/69aa2d65/src/examples/dynamic_reservation_framework.cpp
----------------------------------------------------------------------
diff --git a/src/examples/dynamic_reservation_framework.cpp b/src/examples/dynamic_reservation_framework.cpp
index b51b42b..8f00bcf 100644
--- a/src/examples/dynamic_reservation_framework.cpp
+++ b/src/examples/dynamic_reservation_framework.cpp
@@ -14,7 +14,6 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-#include <iostream>
 #include <string>
 #include <vector>
 
@@ -31,15 +30,12 @@
 #include <stout/flags.hpp>
 #include <stout/option.hpp>
 #include <stout/os.hpp>
-#include <stout/path.hpp>
 #include <stout/protobuf.hpp>
 #include <stout/stringify.hpp>
 #include <stout/try.hpp>
 
 using namespace mesos;
 
-using std::cerr;
-using std::endl;
 using std::string;
 using std::vector;
 
@@ -49,7 +45,7 @@ const int32_t MEM_PER_TASK = 128;
 // The framework reserves resources to run at most one task at a time
 // on each agent; the resources are reserved when they are offered to
 // the framework for the first time, and are unreserved when all tasks
-// are done. The framework terminates if any task failed.
+// are done. The framework terminates if any task fails.
 class DynamicReservationScheduler : public Scheduler
 {
 public:
@@ -99,7 +95,7 @@ public:
         }
 
         states[offer.slave_id()] = State::INIT;
-      };
+      }
 
       const State state = states[offer.slave_id()];
 
@@ -127,8 +123,7 @@ public:
           }
           states[offer.slave_id()] = State::RESERVED;
 
-          // We fallthorugh here to save an offer cycle.
-          // [[fallthrough]]
+          // We fallthrough here to save an offer cycle.
         }
         case State::RESERVED: {
           Resources resources = offer.resources();
@@ -279,12 +274,12 @@ private:
   //              |               | the driver.
 
   enum State {
-    INIT,         // The framework receive the offer for the first time.
+    INIT,         // The framework received the offer for the first time.
     RESERVING,    // The framework sent the RESERVE request to master.
     RESERVED,     // The framework got reserved resources from master.
     TASK_RUNNING, // The task was dispatched to master.
     UNRESERVING,  // The framework sent the UNRESERVE request to master.
-    UNRESERVED,   // The resources was unreserved.
+    UNRESERVED,   // The resources were unreserved.
   };
 
   hashmap<SlaveID, State> states;