You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by me...@apache.org on 2015/04/11 11:40:38 UTC
[4/4] mesos git commit: Removed FrameworkID argument from
Slave::_runTask.
Removed FrameworkID argument from Slave::_runTask.
The incoming FrameworkInfo has a valid FrameworkID.
Review: https://reviews.apache.org/r/32586
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/1b5851a8
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/1b5851a8
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/1b5851a8
Branch: refs/heads/master
Commit: 1b5851a8c0d95f66ef800321508aec31f2bda622
Parents: adec4b6
Author: Kapil Arya <ka...@mesosphere.io>
Authored: Sat Apr 11 01:32:20 2015 -0700
Committer: Adam B <ad...@mesosphere.io>
Committed: Sat Apr 11 01:50:34 2015 -0700
----------------------------------------------------------------------
src/slave/slave.cpp | 4 ++--
src/slave/slave.hpp | 1 -
src/tests/mesos.cpp | 5 ++---
src/tests/mesos.hpp | 4 +---
src/tests/slave_tests.cpp | 8 +++-----
5 files changed, 8 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/1b5851a8/src/slave/slave.cpp
----------------------------------------------------------------------
diff --git a/src/slave/slave.cpp b/src/slave/slave.cpp
index 4ed12c8..a0595f9 100644
--- a/src/slave/slave.cpp
+++ b/src/slave/slave.cpp
@@ -1222,7 +1222,6 @@ void Slave::runTask(
&Self::_runTask,
lambda::_1,
frameworkInfo,
- frameworkId,
pid,
task));
}
@@ -1231,10 +1230,11 @@ void Slave::runTask(
void Slave::_runTask(
const Future<bool>& future,
const FrameworkInfo& frameworkInfo,
- const FrameworkID& frameworkId,
const string& pid,
const TaskInfo& task)
{
+ const FrameworkID frameworkId = frameworkInfo.id();
+
LOG(INFO) << "Launching task " << task.task_id()
<< " for framework " << frameworkId;
http://git-wip-us.apache.org/repos/asf/mesos/blob/1b5851a8/src/slave/slave.hpp
----------------------------------------------------------------------
diff --git a/src/slave/slave.hpp b/src/slave/slave.hpp
index 5cb94b8..9495c70 100644
--- a/src/slave/slave.hpp
+++ b/src/slave/slave.hpp
@@ -114,7 +114,6 @@ public:
virtual void _runTask(
const process::Future<bool>& future,
const FrameworkInfo& frameworkInfo,
- const FrameworkID& frameworkId,
const std::string& pid,
const TaskInfo& task);
http://git-wip-us.apache.org/repos/asf/mesos/blob/1b5851a8/src/tests/mesos.cpp
----------------------------------------------------------------------
diff --git a/src/tests/mesos.cpp b/src/tests/mesos.cpp
index 02cbb4b..fc534e9 100644
--- a/src/tests/mesos.cpp
+++ b/src/tests/mesos.cpp
@@ -372,7 +372,7 @@ MockSlave::MockSlave(const slave::Flags& flags,
// Set up default behaviors, calling the original methods.
EXPECT_CALL(*this, runTask(_, _, _, _, _))
.WillRepeatedly(Invoke(this, &MockSlave::unmocked_runTask));
- EXPECT_CALL(*this, _runTask(_, _, _, _, _))
+ EXPECT_CALL(*this, _runTask(_, _, _, _))
.WillRepeatedly(Invoke(this, &MockSlave::unmocked__runTask));
EXPECT_CALL(*this, killTask(_, _, _))
.WillRepeatedly(Invoke(this, &MockSlave::unmocked_killTask));
@@ -403,11 +403,10 @@ void MockSlave::unmocked_runTask(
void MockSlave::unmocked__runTask(
const Future<bool>& future,
const FrameworkInfo& frameworkInfo,
- const FrameworkID& frameworkId,
const std::string& pid,
const TaskInfo& task)
{
- slave::Slave::_runTask(future, frameworkInfo, frameworkId, pid, task);
+ slave::Slave::_runTask(future, frameworkInfo, pid, task);
}
http://git-wip-us.apache.org/repos/asf/mesos/blob/1b5851a8/src/tests/mesos.hpp
----------------------------------------------------------------------
diff --git a/src/tests/mesos.hpp b/src/tests/mesos.hpp
index 0e98572..42e42ac 100644
--- a/src/tests/mesos.hpp
+++ b/src/tests/mesos.hpp
@@ -688,17 +688,15 @@ public:
const std::string& pid,
const TaskInfo& task);
- MOCK_METHOD5(_runTask, void(
+ MOCK_METHOD4(_runTask, void(
const process::Future<bool>& future,
const FrameworkInfo& frameworkInfo,
- const FrameworkID& frameworkId,
const std::string& pid,
const TaskInfo& task));
void unmocked__runTask(
const process::Future<bool>& future,
const FrameworkInfo& frameworkInfo,
- const FrameworkID& frameworkId,
const std::string& pid,
const TaskInfo& task);
http://git-wip-us.apache.org/repos/asf/mesos/blob/1b5851a8/src/tests/slave_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/slave_tests.cpp b/src/tests/slave_tests.cpp
index 29d23c6..b826000 100644
--- a/src/tests/slave_tests.cpp
+++ b/src/tests/slave_tests.cpp
@@ -1569,17 +1569,15 @@ TEST_F(SlaveTest, KillTaskBetweenRunTaskParts)
// Saved arguments from Slave::_runTask().
Future<bool> future;
FrameworkInfo frameworkInfo;
- FrameworkID frameworkId;
// Skip what Slave::_runTask() normally does, save its arguments for
// later, tie reaching the critical moment when to kill the task to
// a future.
Future<Nothing> _runTask;
- EXPECT_CALL(slave, _runTask(_, _, _, _, _))
+ EXPECT_CALL(slave, _runTask(_, _, _, _))
.WillOnce(DoAll(FutureSatisfy(&_runTask),
SaveArg<0>(&future),
- SaveArg<1>(&frameworkInfo),
- SaveArg<2>(&frameworkId)));
+ SaveArg<1>(&frameworkInfo)));
driver.launchTasks(offers.get()[0].id(), tasks);
@@ -1602,7 +1600,7 @@ TEST_F(SlaveTest, KillTaskBetweenRunTaskParts)
AWAIT_READY(killTask);
slave.unmocked__runTask(
- future, frameworkInfo, frameworkId, master.get(), task);
+ future, frameworkInfo, master.get(), task);
AWAIT_READY(removeFramework);