You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by vi...@apache.org on 2016/04/07 22:32:51 UTC

[2/4] mesos git commit: Deleted the `run` method in long lived executor.

Deleted the `run` method in long lived executor.

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


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

Branch: refs/heads/master
Commit: a0b173193f5d508affc5f05513602a6ef98527d9
Parents: 8d6c98b
Author: Anand Mazumdar <ma...@gmail.com>
Authored: Thu Apr 7 13:32:28 2016 -0700
Committer: Vinod Kone <vi...@gmail.com>
Committed: Thu Apr 7 13:32:28 2016 -0700

----------------------------------------------------------------------
 src/examples/long_lived_executor.cpp | 20 +++++++-------------
 1 file changed, 7 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/a0b17319/src/examples/long_lived_executor.cpp
----------------------------------------------------------------------
diff --git a/src/examples/long_lived_executor.cpp b/src/examples/long_lived_executor.cpp
index 5377865..efd6c65 100644
--- a/src/examples/long_lived_executor.cpp
+++ b/src/examples/long_lived_executor.cpp
@@ -33,18 +33,6 @@ using std::endl;
 using std::string;
 
 
-void run(ExecutorDriver* driver, const TaskInfo& task)
-{
-  os::sleep(Seconds(random() % 10));
-
-  TaskStatus status;
-  status.mutable_task_id()->MergeFrom(task.task_id());
-  status.set_state(TASK_FINISHED);
-
-  driver->sendStatusUpdate(status);
-}
-
-
 class LongLivedExecutor : public Executor
 {
 public:
@@ -71,7 +59,13 @@ public:
     cout << "Starting task " << task.task_id().value() << endl;
 
     std::thread thread([=]() {
-      run(driver, task);
+      os::sleep(Seconds(random() % 10));
+
+      TaskStatus status;
+      status.mutable_task_id()->MergeFrom(task.task_id());
+      status.set_state(TASK_FINISHED);
+
+      driver->sendStatusUpdate(status);
     });
 
     thread.detach();