Renamed Hook to ParentHook in Mesos [2/2].

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


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

Branch: refs/heads/master
Commit: f4be028f5eb8c04a2c13a58863896ad4f571d541
Parents: 6a4a4f1
Author: Joerg Schad <jo...@mesosphere.io>
Authored: Wed Sep 21 09:50:36 2016 -0700
Committer: Jie Yu <yujie....@gmail.com>
Committed: Wed Sep 21 09:50:36 2016 -0700

----------------------------------------------------------------------
 src/linux/systemd.cpp                            | 4 ++--
 src/slave/container_loggers/lib_logrotate.cpp    | 4 ++--
 src/slave/containerizer/docker.cpp               | 6 +++---
 src/slave/containerizer/mesos/launcher.cpp       | 5 +++--
 src/slave/containerizer/mesos/launcher.hpp       | 4 ++--
 src/slave/containerizer/mesos/linux_launcher.cpp | 7 ++++---
 src/slave/containerizer/mesos/linux_launcher.hpp | 2 +-
 src/tests/containerizer/launcher.hpp             | 2 +-
 8 files changed, 18 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/f4be028f/src/linux/systemd.cpp
----------------------------------------------------------------------
diff --git a/src/linux/systemd.cpp b/src/linux/systemd.cpp
index 619aa27..96813b7 100644
--- a/src/linux/systemd.cpp
+++ b/src/linux/systemd.cpp
@@ -133,8 +133,8 @@ Try<Nothing> initialize(const Flags& flags)
   // This allows the life-time of the process to be extended past the life-time
   // of the slave. See MESOS-3352.
   // This function takes responsibility for creating and starting this slice.
-  // We inject a `Subprocess::Hook` into the `subprocess` function that 
migrates
-  // pids into this slice if the `EXTEND_LIFETIME` option is set on the
+  // We inject a `Subprocess::ParentHook` into the `subprocess` function that
+  // migrates pids into this slice if the `EXTEND_LIFETIME` option is set on 
the
   // `subprocess` call.
 
   // Ensure that the `MESOS_EXECUTORS_SLICE` exists and is running.

http://git-wip-us.apache.org/repos/asf/mesos/blob/f4be028f/src/slave/container_loggers/lib_logrotate.cpp
----------------------------------------------------------------------
diff --git a/src/slave/container_loggers/lib_logrotate.cpp 
b/src/slave/container_loggers/lib_logrotate.cpp
index e975ad8..0ca2b3d 100644
--- a/src/slave/container_loggers/lib_logrotate.cpp
+++ b/src/slave/container_loggers/lib_logrotate.cpp
@@ -175,10 +175,10 @@ public:
     // If we are on systemd, then extend the life of the process as we
     // do with the executor. Any grandchildren's lives will also be
     // extended.
-    std::vector<Subprocess::Hook> parentHooks;
+    std::vector<Subprocess::ParentHook> parentHooks;
 #ifdef __linux__
     if (systemd::enabled()) {
-      parentHooks.emplace_back(Subprocess::Hook(
+      parentHooks.emplace_back(Subprocess::ParentHook(
           &systemd::mesos::extendLifetime));
     }
 #endif // __linux__

http://git-wip-us.apache.org/repos/asf/mesos/blob/f4be028f/src/slave/containerizer/docker.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/docker.cpp 
b/src/slave/containerizer/docker.cpp
index ac4a019..26a7e7c 100644
--- a/src/slave/containerizer/docker.cpp
+++ b/src/slave/containerizer/docker.cpp
@@ -1283,7 +1283,7 @@ Future<pid_t> 
DockerContainerizerProcess::launchExecutorProcess(
           -> Future<pid_t> {
     // NOTE: The child process will be blocked until all hooks have been
     // executed.
-    vector<Subprocess::Hook> parentHooks;
+    vector<Subprocess::ParentHook> parentHooks;
 
     // NOTE: Currently we don't care about the order of the hooks, as
     // both hooks are independent.
@@ -1297,7 +1297,7 @@ Future<pid_t> 
DockerContainerizerProcess::launchExecutorProcess(
     // - It is safe to bind `this`, as hooks are executed immediately
     //   in a `subprocess` call.
     // - If `checkpoiont` returns an Error, the child process will be killed.
-    parentHooks.emplace_back(Subprocess::Hook(lambda::bind(
+    parentHooks.emplace_back(Subprocess::ParentHook(lambda::bind(
         &DockerContainerizerProcess::checkpoint,
         this,
         containerId,
@@ -1307,7 +1307,7 @@ Future<pid_t> 
DockerContainerizerProcess::launchExecutorProcess(
     // If we are on systemd, then extend the life of the executor. Any
     // grandchildren's lives will also be extended.
     if (systemd::enabled()) {
-      parentHooks.emplace_back(Subprocess::Hook(
+      parentHooks.emplace_back(Subprocess::ParentHook(
           &systemd::mesos::extendLifetime));
     }
 #endif // __linux__

http://git-wip-us.apache.org/repos/asf/mesos/blob/f4be028f/src/slave/containerizer/mesos/launcher.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/launcher.cpp 
b/src/slave/containerizer/mesos/launcher.cpp
index 7e4df3f..2155e7a 100644
--- a/src/slave/containerizer/mesos/launcher.cpp
+++ b/src/slave/containerizer/mesos/launcher.cpp
@@ -114,7 +114,7 @@ Try<pid_t> PosixLauncher::fork(
     const flags::FlagsBase* flags,
     const Option<map<string, string>>& environment,
     const Option<int>& namespaces,
-    vector<process::Subprocess::Hook> parentHooks)
+    vector<process::Subprocess::ParentHook> parentHooks)
 {
   if (namespaces.isSome() && namespaces.get() != 0) {
     return Error("Posix launcher does not support namespaces");
@@ -129,7 +129,8 @@ Try<pid_t> PosixLauncher::fork(
   // grandchildren's lives will also be extended.
 #ifdef __linux__
   if (systemd::enabled()) {
-    
parentHooks.emplace_back(Subprocess::Hook(&systemd::mesos::extendLifetime));
+    parentHooks.emplace_back(Subprocess::ParentHook(
+        &systemd::mesos::extendLifetime));
   }
 #endif // __linux__
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/f4be028f/src/slave/containerizer/mesos/launcher.hpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/launcher.hpp 
b/src/slave/containerizer/mesos/launcher.hpp
index a3f1364..6d9fb8d 100644
--- a/src/slave/containerizer/mesos/launcher.hpp
+++ b/src/slave/containerizer/mesos/launcher.hpp
@@ -70,7 +70,7 @@ public:
       const flags::FlagsBase* flags,
       const Option<std::map<std::string, std::string>>& environment,
       const Option<int>& namespaces,
-      std::vector<process::Subprocess::Hook> parentHooks = {}) = 0;
+      std::vector<process::Subprocess::ParentHook> parentHooks = {}) = 0;
 
   // Kill all processes in the containerized context.
   virtual process::Future<Nothing> destroy(const ContainerID& containerId) = 0;
@@ -121,7 +121,7 @@ public:
       const flags::FlagsBase* flags,
       const Option<std::map<std::string, std::string>>& environment,
       const Option<int>& namespaces,
-      std::vector<process::Subprocess::Hook> parentHooks = {});
+      std::vector<process::Subprocess::ParentHook> parentHooks = {});
 
   virtual process::Future<Nothing> destroy(const ContainerID& containerId);
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/f4be028f/src/slave/containerizer/mesos/linux_launcher.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/linux_launcher.cpp 
b/src/slave/containerizer/mesos/linux_launcher.cpp
index d3d09f2..f277570 100644
--- a/src/slave/containerizer/mesos/linux_launcher.cpp
+++ b/src/slave/containerizer/mesos/linux_launcher.cpp
@@ -274,7 +274,7 @@ Try<pid_t> LinuxLauncher::fork(
     const flags::FlagsBase* flags,
     const Option<map<string, string>>& environment,
     const Option<int>& namespaces,
-    vector<Subprocess::Hook> parentHooks)
+    vector<Subprocess::ParentHook> parentHooks)
 {
   int cloneFlags = namespaces.isSome() ? namespaces.get() : 0;
   cloneFlags |= SIGCHLD; // Specify SIGCHLD as child termination signal.
@@ -288,11 +288,12 @@ Try<pid_t> LinuxLauncher::fork(
   // If we are on systemd, then extend the life of the child. As with the
   // freezer, any grandchildren will also be contained in the slice.
   if (systemdHierarchy.isSome()) {
-    
parentHooks.emplace_back(Subprocess::Hook(&systemd::mesos::extendLifetime));
+    parentHooks.emplace_back(Subprocess::ParentHook(
+        &systemd::mesos::extendLifetime));
   }
 
   // Create parent Hook for moving child into freezer cgroup.
-  parentHooks.emplace_back(Subprocess::Hook(lambda::bind(
+  parentHooks.emplace_back(Subprocess::ParentHook(lambda::bind(
       &assignFreezerHierarchy,
       lambda::_1,
       freezerHierarchy,

http://git-wip-us.apache.org/repos/asf/mesos/blob/f4be028f/src/slave/containerizer/mesos/linux_launcher.hpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/linux_launcher.hpp 
b/src/slave/containerizer/mesos/linux_launcher.hpp
index dca827c..2cd1e4d 100644
--- a/src/slave/containerizer/mesos/linux_launcher.hpp
+++ b/src/slave/containerizer/mesos/linux_launcher.hpp
@@ -48,7 +48,7 @@ public:
       const flags::FlagsBase* flags,
       const Option<std::map<std::string, std::string>>& environment,
       const Option<int>& namespaces,
-      std::vector<process::Subprocess::Hook> parentHooks);
+      std::vector<process::Subprocess::ParentHook> parentHooks);
 
   virtual process::Future<Nothing> destroy(const ContainerID& containerId);
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/f4be028f/src/tests/containerizer/launcher.hpp
----------------------------------------------------------------------
diff --git a/src/tests/containerizer/launcher.hpp 
b/src/tests/containerizer/launcher.hpp
index f87b3ce..a149220 100644
--- a/src/tests/containerizer/launcher.hpp
+++ b/src/tests/containerizer/launcher.hpp
@@ -68,7 +68,7 @@ public:
           const flags::FlagsBase* flags,
           const Option<std::map<std::string, std::string>>& env,
           const Option<int>& namespaces,
-          std::vector<process::Subprocess::Hook> parentHooks));
+          std::vector<process::Subprocess::ParentHook> parentHooks));
 
   MOCK_METHOD1(
       destroy,

Reply via email to