You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by be...@apache.org on 2011/06/05 05:22:15 UTC
svn commit: r1131555 - in /incubator/mesos/trunk:
frameworks/hadoop-0.20.0/src/mapred/org/apache/hadoop/mapred/
frameworks/haproxy+apache/ frameworks/mpi/ include/ src/ src/swig/java/
Author: benh
Date: Sun Jun 5 03:22:15 2011
New Revision: 1131555
URL: http://svn.apache.org/viewvc?rev=1131555&view=rev
Log:
Rename Executor::startTask to launchTask (ticket #23).
Modified:
incubator/mesos/trunk/frameworks/hadoop-0.20.0/src/mapred/org/apache/hadoop/mapred/NexusExecutor.java
incubator/mesos/trunk/frameworks/haproxy+apache/startapache.py
incubator/mesos/trunk/frameworks/mpi/startmpd.py
incubator/mesos/trunk/include/nexus_exec.h
incubator/mesos/trunk/include/nexus_exec.hpp
incubator/mesos/trunk/src/cpp_test_executor.cpp
incubator/mesos/trunk/src/memhog_executor.cpp
incubator/mesos/trunk/src/nexus_exec.cpp
incubator/mesos/trunk/src/swig/java/TestExecutor.java
incubator/mesos/trunk/src/test_exec.cpp
Modified: incubator/mesos/trunk/frameworks/hadoop-0.20.0/src/mapred/org/apache/hadoop/mapred/NexusExecutor.java
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/frameworks/hadoop-0.20.0/src/mapred/org/apache/hadoop/mapred/NexusExecutor.java?rev=1131555&r1=1131554&r2=1131555&view=diff
==============================================================================
--- incubator/mesos/trunk/frameworks/hadoop-0.20.0/src/mapred/org/apache/hadoop/mapred/NexusExecutor.java (original)
+++ incubator/mesos/trunk/frameworks/hadoop-0.20.0/src/mapred/org/apache/hadoop/mapred/NexusExecutor.java Sun Jun 5 03:22:15 2011
@@ -140,7 +140,7 @@ public class NexusExecutor extends Execu
}
@Override
- public void startTask(ExecutorDriver d, TaskDescription taskDesc) {
+ public void launchTask(ExecutorDriver d, TaskDescription taskDesc) {
String taskType = new String(taskDesc.getArg());
LOG.info("start_task " + taskDesc.getTaskId() + ": " + taskType);
if (taskType.equals("map")) {
Modified: incubator/mesos/trunk/frameworks/haproxy+apache/startapache.py
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/frameworks/haproxy%2Bapache/startapache.py?rev=1131555&r1=1131554&r2=1131555&view=diff
==============================================================================
--- incubator/mesos/trunk/frameworks/haproxy+apache/startapache.py (original)
+++ incubator/mesos/trunk/frameworks/haproxy+apache/startapache.py Sun Jun 5 03:22:15 2011
@@ -20,7 +20,7 @@ class MyExecutor(nexus.Executor):
nexus.Executor.__init__(self)
self.tid = -1
- def startTask(self, driver, task):
+ def launchTask(self, driver, task):
self.tid = task.taskId
Popen("/usr/apache2/2.2/bin/apachectl start", shell=True)
Modified: incubator/mesos/trunk/frameworks/mpi/startmpd.py
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/frameworks/mpi/startmpd.py?rev=1131555&r1=1131554&r2=1131555&view=diff
==============================================================================
--- incubator/mesos/trunk/frameworks/mpi/startmpd.py (original)
+++ incubator/mesos/trunk/frameworks/mpi/startmpd.py Sun Jun 5 03:22:15 2011
@@ -25,7 +25,7 @@ class MyExecutor(nexus.Executor):
self.ip = ip
self.port = port
- def startTask(self, driver, task):
+ def launchTask(self, driver, task):
print "Running task %d" % task.taskId
Popen("mpd -n -h "+self.ip+" -p "+self.port, shell=True)
Modified: incubator/mesos/trunk/include/nexus_exec.h
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/include/nexus_exec.h?rev=1131555&r1=1131554&r2=1131555&view=diff
==============================================================================
--- incubator/mesos/trunk/include/nexus_exec.h (original)
+++ incubator/mesos/trunk/include/nexus_exec.h Sun Jun 5 03:22:15 2011
@@ -15,9 +15,10 @@ struct nexus_exec {
const char*, // framework_name
const void*, // init_arg
int); // init_arg_len
- void (*run) (struct nexus_exec*, struct nexus_task_desc*);
- void (*kill) (struct nexus_exec*, task_id tid);
- void (*message) (struct nexus_exec*, struct nexus_framework_message*);
+ void (*launch_task) (struct nexus_exec*, struct nexus_task_desc*);
+ void (*kill_task) (struct nexus_exec*, task_id tid);
+ void (*framework_message) (struct nexus_exec*,
+ struct nexus_framework_message*);
void (*shutdown) (struct nexus_exec*);
void (*error) (struct nexus_exec*, int, const char*);
Modified: incubator/mesos/trunk/include/nexus_exec.hpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/include/nexus_exec.hpp?rev=1131555&r1=1131554&r2=1131555&view=diff
==============================================================================
--- incubator/mesos/trunk/include/nexus_exec.hpp (original)
+++ incubator/mesos/trunk/include/nexus_exec.hpp Sun Jun 5 03:22:15 2011
@@ -41,7 +41,7 @@ public:
virtual ~Executor() {}
virtual void init(ExecutorDriver* d, const ExecutorArgs& args) {}
- virtual void startTask(ExecutorDriver* d, const TaskDescription& task) {}
+ virtual void launchTask(ExecutorDriver* d, const TaskDescription& task) {}
virtual void killTask(ExecutorDriver* d, TaskID taskId) {}
virtual void frameworkMessage(ExecutorDriver* d,
const FrameworkMessage& message) {}
Modified: incubator/mesos/trunk/src/cpp_test_executor.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/cpp_test_executor.cpp?rev=1131555&r1=1131554&r2=1131555&view=diff
==============================================================================
--- incubator/mesos/trunk/src/cpp_test_executor.cpp (original)
+++ incubator/mesos/trunk/src/cpp_test_executor.cpp Sun Jun 5 03:22:15 2011
@@ -16,7 +16,7 @@ public:
cout << "Init" << endl;
}
- virtual void startTask(ExecutorDriver* d, const TaskDescription& task) {
+ virtual void launchTask(ExecutorDriver* d, const TaskDescription& task) {
cout << "Starting task " << task.taskId << endl;
sleep(1);
cout << "Finishing task " << task.taskId << endl;
Modified: incubator/mesos/trunk/src/memhog_executor.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/memhog_executor.cpp?rev=1131555&r1=1131554&r2=1131555&view=diff
==============================================================================
--- incubator/mesos/trunk/src/memhog_executor.cpp (original)
+++ incubator/mesos/trunk/src/memhog_executor.cpp Sun Jun 5 03:22:15 2011
@@ -51,7 +51,7 @@ public:
<< ", threadsPerTask = " << threadsPerTask << endl;
}
- virtual void startTask(ExecutorDriver*, const TaskDescription& task) {
+ virtual void launchTask(ExecutorDriver*, const TaskDescription& task) {
cout << "Executor starting task " << task.taskId << endl;
for (int i = 0; i < threadsPerTask; i++) {
ThreadArg *arg = new ThreadArg(this, task.taskId, i == 0);
Modified: incubator/mesos/trunk/src/nexus_exec.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/nexus_exec.cpp?rev=1131555&r1=1131554&r2=1131555&view=diff
==============================================================================
--- incubator/mesos/trunk/src/nexus_exec.cpp (original)
+++ incubator/mesos/trunk/src/nexus_exec.cpp Sun Jun 5 03:22:15 2011
@@ -71,7 +71,7 @@ protected:
unpack<S2E_RUN_TASK>(tid, name, args, params);
TaskDescription task(tid, sid, name, params.getMap(), args);
send(slave, pack<E2S_STATUS_UPDATE>(fid, tid, TASK_RUNNING, ""));
- invoke(bind(&Executor::startTask, executor, driver, ref(task)));
+ invoke(bind(&Executor::launchTask, executor, driver, ref(task)));
break;
}
@@ -257,7 +257,7 @@ public:
args.data.size());
}
- virtual void startTask(ExecutorDriver*, const TaskDescription& task)
+ virtual void launchTask(ExecutorDriver*, const TaskDescription& task)
{
// Convert params to key=value list
Params paramsObj(task.params);
@@ -268,12 +268,12 @@ public:
paramsStr.c_str(),
task.arg.data(),
task.arg.size() };
- exec->run(exec, &td);
+ exec->launch_task(exec, &td);
}
virtual void killTask(ExecutorDriver*, TaskID taskId)
{
- exec->kill(exec, taskId);
+ exec->kill_task(exec, taskId);
}
virtual void frameworkMessage(ExecutorDriver*,
@@ -283,7 +283,7 @@ public:
message.taskId,
message.data.data(),
message.data.size() };
- exec->message(exec, &msg);
+ exec->framework_message(exec, &msg);
}
virtual void shutdown(ExecutorDriver*)
Modified: incubator/mesos/trunk/src/swig/java/TestExecutor.java
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/swig/java/TestExecutor.java?rev=1131555&r1=1131554&r2=1131555&view=diff
==============================================================================
--- incubator/mesos/trunk/src/swig/java/TestExecutor.java (original)
+++ incubator/mesos/trunk/src/swig/java/TestExecutor.java Sun Jun 5 03:22:15 2011
@@ -7,7 +7,7 @@ public class TestExecutor extends Execut
}
@Override
- public void startTask(final ExecutorDriver d, final TaskDescription task) {
+ public void launchTask(final ExecutorDriver d, final TaskDescription task) {
new Thread() { public void run() {
try {
System.out.println("Running task " + task.getTaskId());
Modified: incubator/mesos/trunk/src/test_exec.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/test_exec.cpp?rev=1131555&r1=1131554&r2=1131555&view=diff
==============================================================================
--- incubator/mesos/trunk/src/test_exec.cpp (original)
+++ incubator/mesos/trunk/src/test_exec.cpp Sun Jun 5 03:22:15 2011
@@ -22,7 +22,7 @@ void init(struct nexus_exec* exec,
}
-void run(struct nexus_exec* exec, struct nexus_task_desc* task)
+void launch_task(struct nexus_exec* exec, struct nexus_task_desc* task)
{
struct nexus_task_status done = { task->tid, TASK_FINISHED, 0, 0 };
cout << "run()" << endl;
@@ -32,13 +32,14 @@ void run(struct nexus_exec* exec, struct
}
-void kill(struct nexus_exec* exec, task_id tid)
+void kill_task(struct nexus_exec* exec, task_id tid)
{
cout << "asked to kill task, but that isn't implemented" << endl;
}
-void message(struct nexus_exec* exec, struct nexus_framework_message* msg)
+void framework_message(struct nexus_exec* exec,
+ struct nexus_framework_message* msg)
{
cout << "received framework message" << endl;
}
@@ -58,7 +59,17 @@ void error(struct nexus_exec* exec, int
}
+struct nexus_exec exec = {
+ init,
+ launch_task,
+ kill_task,
+ framework_message,
+ shutdown,
+ error,
+ NULL
+};
+
+
int main() {
- struct nexus_exec exec = { init, run, kill, message, shutdown, error, NULL };
return nexus_exec_run(&exec);
}