You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ji...@apache.org on 2017/05/31 21:51:30 UTC

[16/16] mesos git commit: Removed an unnecessary declaration in slave.hpp.

Removed an unnecessary declaration in slave.hpp.

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


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

Branch: refs/heads/master
Commit: e6a865b519601fd9fbd3b44f5bc3d3a97c6a5bb8
Parents: 97272c8
Author: Jie Yu <yu...@gmail.com>
Authored: Tue May 30 16:32:07 2017 -0700
Committer: Jie Yu <yu...@gmail.com>
Committed: Wed May 31 14:51:10 2017 -0700

----------------------------------------------------------------------
 src/slave/slave.cpp | 64 ++++++++++++++++++++++++++----------------------
 src/slave/slave.hpp |  6 -----
 2 files changed, 35 insertions(+), 35 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/e6a865b5/src/slave/slave.cpp
----------------------------------------------------------------------
diff --git a/src/slave/slave.cpp b/src/slave/slave.cpp
index c3df7d9..247c7eb 100644
--- a/src/slave/slave.cpp
+++ b/src/slave/slave.cpp
@@ -171,6 +171,12 @@ static string taskOrTaskGroup(
     const Option<TaskGroupInfo>& taskGroup);
 
 
+// Returns the command info for default executor.
+static CommandInfo defaultExecutorCommandInfo(
+    const std::string& launcherDir,
+    const Option<std::string>& user);
+
+
 Slave::Slave(const string& id,
              const slave::Flags& _flags,
              MasterDetector* _detector,
@@ -7791,35 +7797,6 @@ map<string, string> executorEnvironment(
 }
 
 
-CommandInfo defaultExecutorCommandInfo(
-    const string& launcherDir,
-    const Option<string>& user)
-{
-  Result<string> path = os::realpath(
-      path::join(launcherDir, MESOS_DEFAULT_EXECUTOR));
-
-  CommandInfo commandInfo;
-  if (path.isSome()) {
-    commandInfo.set_shell(false);
-    commandInfo.set_value(path.get());
-    commandInfo.add_arguments(MESOS_DEFAULT_EXECUTOR);
-    commandInfo.add_arguments("--launcher_dir=" + launcherDir);
-  } else {
-    commandInfo.set_shell(true);
-    commandInfo.set_value(
-        "echo '" +
-        (path.isError() ? path.error() : "No such file or directory") +
-        "'; exit 1");
-  }
-
-  if (user.isSome()) {
-    commandInfo.set_user(user.get());
-  }
-
-  return commandInfo;
-}
-
-
 ostream& operator<<(ostream& stream, const Executor& executor)
 {
   stream << "'" << executor.id << "' of framework " << executor.frameworkId;
@@ -7891,6 +7868,35 @@ static string taskOrTaskGroup(
   return out.str();
 }
 
+
+static CommandInfo defaultExecutorCommandInfo(
+    const string& launcherDir,
+    const Option<string>& user)
+{
+  Result<string> path = os::realpath(
+      path::join(launcherDir, MESOS_DEFAULT_EXECUTOR));
+
+  CommandInfo commandInfo;
+  if (path.isSome()) {
+    commandInfo.set_shell(false);
+    commandInfo.set_value(path.get());
+    commandInfo.add_arguments(MESOS_DEFAULT_EXECUTOR);
+    commandInfo.add_arguments("--launcher_dir=" + launcherDir);
+  } else {
+    commandInfo.set_shell(true);
+    commandInfo.set_value(
+        "echo '" +
+        (path.isError() ? path.error() : "No such file or directory") +
+        "'; exit 1");
+  }
+
+  if (user.isSome()) {
+    commandInfo.set_user(user.get());
+  }
+
+  return commandInfo;
+}
+
 } // namespace slave {
 } // namespace internal {
 } // namespace mesos {

http://git-wip-us.apache.org/repos/asf/mesos/blob/e6a865b5/src/slave/slave.hpp
----------------------------------------------------------------------
diff --git a/src/slave/slave.hpp b/src/slave/slave.hpp
index 09b7f0a..24b9258 100644
--- a/src/slave/slave.hpp
+++ b/src/slave/slave.hpp
@@ -941,12 +941,6 @@ std::map<std::string, std::string> executorEnvironment(
     bool checkpoint);
 
 
-// Returns the command info for default executor.
-CommandInfo defaultExecutorCommandInfo(
-    const std::string& launcherDir,
-    const Option<std::string>& user);
-
-
 std::ostream& operator<<(std::ostream& stream, Executor::State state);
 std::ostream& operator<<(std::ostream& stream, Framework::State state);
 std::ostream& operator<<(std::ostream& stream, Slave::State state);