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 10:48:29 UTC
svn commit: r1132131 - in /incubator/mesos/trunk/src:
examples/java/TestFramework.java launcher/launcher.cpp
slave/lxc_isolation_module.cpp slave/process_based_isolation_module.cpp
slave/slave.cpp slave/slave.hpp slave/solaris_project_isolation_module.cpp
Author: benh
Date: Sun Jun 5 08:48:29 2011
New Revision: 1132131
URL: http://svn.apache.org/viewvc?rev=1132131&view=rev
Log:
Reverting to calling params conf. Returning accidentally collapsed
comments to two separate lines of comments.
Modified:
incubator/mesos/trunk/src/examples/java/TestFramework.java
incubator/mesos/trunk/src/launcher/launcher.cpp
incubator/mesos/trunk/src/slave/lxc_isolation_module.cpp
incubator/mesos/trunk/src/slave/process_based_isolation_module.cpp
incubator/mesos/trunk/src/slave/slave.cpp
incubator/mesos/trunk/src/slave/slave.hpp
incubator/mesos/trunk/src/slave/solaris_project_isolation_module.cpp
Modified: incubator/mesos/trunk/src/examples/java/TestFramework.java
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/examples/java/TestFramework.java?rev=1132131&r1=1132130&r2=1132131&view=diff
==============================================================================
--- incubator/mesos/trunk/src/examples/java/TestFramework.java (original)
+++ incubator/mesos/trunk/src/examples/java/TestFramework.java Sun Jun 5 08:48:29 2011
@@ -30,7 +30,7 @@ public class TestFramework {
public ExecutorInfo getExecutorInfo(SchedulerDriver d) {
try {
return new ExecutorInfo(
- "java/test_executor",
+ new File("./test_executor").getCanonicalPath(),
new byte[0]);
} catch (Exception e) {
e.printStackTrace();
Modified: incubator/mesos/trunk/src/launcher/launcher.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/launcher/launcher.cpp?rev=1132131&r1=1132130&r2=1132131&view=diff
==============================================================================
--- incubator/mesos/trunk/src/launcher/launcher.cpp (original)
+++ incubator/mesos/trunk/src/launcher/launcher.cpp Sun Jun 5 08:48:29 2011
@@ -125,7 +125,8 @@ string ExecutorLauncher::fetchExecutor()
executor.find_first_of('\0') != string::npos) {
fatal("Illegal characters in executor path");
}
-// Grab the executor from HDFS if its path begins with hdfs:// // TODO: Enforce some size limits on files we get from HDFS
+ // Grab the executor from HDFS if its path begins with hdfs://
+ // TODO: Enforce some size limits on files we get from HDFS
if (executor.find("hdfs://") == 0) {
// Locate Hadoop's bin/hadoop script. If a Hadoop home was given to us by
// the slave (from the Mesos config file), use that. Otherwise check for
Modified: incubator/mesos/trunk/src/slave/lxc_isolation_module.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/slave/lxc_isolation_module.cpp?rev=1132131&r1=1132130&r2=1132131&view=diff
==============================================================================
--- incubator/mesos/trunk/src/slave/lxc_isolation_module.cpp (original)
+++ incubator/mesos/trunk/src/slave/lxc_isolation_module.cpp Sun Jun 5 08:48:29 2011
@@ -90,7 +90,7 @@ void LxcIsolationModule::startExecutor(F
<< fw->executorInfo.uri;
// Get location of Mesos install in order to find mesos-launcher.
- string mesosHome = slave->getParams().get("home", ".");
+ string mesosHome = slave->getConf().get("home", ".");
string mesosLauncher = mesosHome + "/mesos-launcher";
// Create a name for the container
@@ -122,12 +122,12 @@ void LxcIsolationModule::startExecutor(F
fw->user,
slave->getUniqueWorkDirectory(fw->id),
slave->self(),
- slave->getParams().get("frameworks_home",
+ slave->getConf().get("frameworks_home",
""),
- slave->getParams().get("home", ""),
- slave->getParams().get("hadoop_home", ""),
+ slave->getConf().get("home", ""),
+ slave->getConf().get("hadoop_home", ""),
!slave->local,
- slave->getParams().get("switch_user", true),
+ slave->getConf().get("switch_user", true),
fw->executorInfo.params);
launcher->setupEnvironmentForLauncherMain();
Modified: incubator/mesos/trunk/src/slave/process_based_isolation_module.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/slave/process_based_isolation_module.cpp?rev=1132131&r1=1132130&r2=1132131&view=diff
==============================================================================
--- incubator/mesos/trunk/src/slave/process_based_isolation_module.cpp (original)
+++ incubator/mesos/trunk/src/slave/process_based_isolation_module.cpp Sun Jun 5 08:48:29 2011
@@ -114,11 +114,11 @@ ExecutorLauncher* ProcessBasedIsolationM
fw->user,
slave->getUniqueWorkDirectory(fw->id),
slave->self(),
- slave->getParams().get("frameworks_home", ""),
- slave->getParams().get("home", ""),
- slave->getParams().get("hadoop_home", ""),
+ slave->getConf().get("frameworks_home", ""),
+ slave->getConf().get("home", ""),
+ slave->getConf().get("hadoop_home", ""),
!slave->local,
- slave->getParams().get("switch_user", true),
+ slave->getConf().get("switch_user", true),
fw->executorInfo.params);
}
Modified: incubator/mesos/trunk/src/slave/slave.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/slave/slave.cpp?rev=1132131&r1=1132130&r2=1132131&view=diff
==============================================================================
--- incubator/mesos/trunk/src/slave/slave.cpp (original)
+++ incubator/mesos/trunk/src/slave/slave.cpp Sun Jun 5 08:48:29 2011
@@ -79,11 +79,11 @@ Slave::Slave(Resources _resources, bool
isolationModule(_isolationModule) {}
-Slave::Slave(const Params& _params, bool _local, IsolationModule *_module)
- : id(""), params(_params), local(_local), isolationModule(_module)
+Slave::Slave(const Params& _conf, bool _local, IsolationModule *_module)
+ : id(""), conf(_conf), local(_local), isolationModule(_module)
{
- resources = Resources(params.get<int32_t>("cpus", DEFAULT_CPUS),
- params.get<int32_t>("mem", DEFAULT_MEM));
+ resources = Resources(conf.get<int32_t>("cpus", DEFAULT_CPUS),
+ conf.get<int32_t>("mem", DEFAULT_MEM));
}
@@ -546,10 +546,10 @@ void Slave::executorExited(FrameworkID f
string Slave::getUniqueWorkDirectory(FrameworkID fid)
{
string workDir;
- if (params.contains("work_dir")) {
- workDir = params["work_dir"];
- } else if (params.contains("home")) {
- workDir = params["home"] + "/work";
+ if (conf.contains("work_dir")) {
+ workDir = conf["work_dir"];
+ } else if (conf.contains("home")) {
+ workDir = conf["home"] + "/work";
} else {
workDir = "work";
}
@@ -576,7 +576,7 @@ string Slave::getUniqueWorkDirectory(Fra
}
-const Params& Slave::getParams()
+const Params& Slave::getConf()
{
- return params;
+ return conf;
}
Modified: incubator/mesos/trunk/src/slave/slave.hpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/slave/slave.hpp?rev=1132131&r1=1132130&r2=1132131&view=diff
==============================================================================
--- incubator/mesos/trunk/src/slave/slave.hpp (original)
+++ incubator/mesos/trunk/src/slave/slave.hpp Sun Jun 5 08:48:29 2011
@@ -166,7 +166,7 @@ struct Executor
class Slave : public MesosProcess
{
public:
- Params params;
+ Params conf;
typedef unordered_map<FrameworkID, Framework*> FrameworkMap;
typedef unordered_map<FrameworkID, Executor*> ExecutorMap;
@@ -185,7 +185,7 @@ public:
public:
Slave(Resources resources, bool local, IsolationModule* isolationModule);
- Slave(const Params& params, bool local, IsolationModule *isolationModule);
+ Slave(const Params& conf, bool local, IsolationModule *isolationModule);
virtual ~Slave();
@@ -201,7 +201,7 @@ public:
string getUniqueWorkDirectory(FrameworkID fid);
- const Params& getParams();
+ const Params& getConf();
protected:
void operator () ();
Modified: incubator/mesos/trunk/src/slave/solaris_project_isolation_module.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/slave/solaris_project_isolation_module.cpp?rev=1132131&r1=1132130&r2=1132131&view=diff
==============================================================================
--- incubator/mesos/trunk/src/slave/solaris_project_isolation_module.cpp (original)
+++ incubator/mesos/trunk/src/slave/solaris_project_isolation_module.cpp Sun Jun 5 08:48:29 2011
@@ -87,11 +87,11 @@ ExecutorLauncher* SolarisProjectIsolatio
fw->user,
slave->getWorkDirectory(fw->id),
slave->self(),
- slave->getParams().get("frameworks_home", ""),
- slave->getParams().get("home", ""),
- slave->getParams().get("hadoop_home", ""),
+ slave->getConf().get("frameworks_home", ""),
+ slave->getConf().get("home", ""),
+ slave->getConf().get("hadoop_home", ""),
!slave->local,
- slave->getParams().get("switch_user", true),
+ slave->getConf().get("switch_user", true),
frameworkProject[fw->id]);
}
@@ -102,7 +102,7 @@ void SolarisProjectIsolationModule::Comm
LOG(INFO) << "Starting projd for project " << project;
// Get location of Mesos install in order to find projd.
- string mesosHome = slave->getParams().get("home", ".");
+ string mesosHome = slave->getConf().get("home", ".");
pid_t pid;
if ((pid = fork()) == -1)