You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by vi...@apache.org on 2016/02/04 23:42:35 UTC

[2/5] mesos git commit: Modified existing usage of Slave constructor.

Modified existing usage of Slave constructor.

This change adds the argument process ID wherever the `Slave` object is
constructed.

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


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

Branch: refs/heads/master
Commit: 4a211e5f9f95dbffb819d5802ffcb8617be202b8
Parents: d1068c1
Author: Anand Mazumdar <ma...@gmail.com>
Authored: Thu Feb 4 14:40:56 2016 -0800
Committer: Vinod Kone <vi...@gmail.com>
Committed: Thu Feb 4 14:40:56 2016 -0800

----------------------------------------------------------------------
 src/local/local.cpp | 1 +
 src/slave/main.cpp  | 5 ++++-
 src/tests/mesos.cpp | 1 +
 3 files changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/4a211e5f/src/local/local.cpp
----------------------------------------------------------------------
diff --git a/src/local/local.cpp b/src/local/local.cpp
index 2688f9d..359fc54 100644
--- a/src/local/local.cpp
+++ b/src/local/local.cpp
@@ -384,6 +384,7 @@ PID<Master> launch(const Flags& flags, Allocator* _allocator)
     // NOTE: At this point detector is already initialized by the
     // Master.
     Slave* slave = new Slave(
+        process::ID::generate("slave"),
         flags,
         detector,
         containerizer.get(),

http://git-wip-us.apache.org/repos/asf/mesos/blob/4a211e5f/src/slave/main.cpp
----------------------------------------------------------------------
diff --git a/src/slave/main.cpp b/src/slave/main.cpp
index a412ceb..22b8330 100644
--- a/src/slave/main.cpp
+++ b/src/slave/main.cpp
@@ -208,7 +208,9 @@ int main(int argc, char** argv)
     os::setenv("LIBPROCESS_ADVERTISE_PORT", advertise_port.get());
   }
 
-  process::initialize("slave(1)");
+  const string id = process::ID::generate("slave"); // Process ID.
+
+  process::initialize(id);
 
   logging::initialize(argv[0], flags, true); // Catch signals.
 
@@ -304,6 +306,7 @@ int main(int argc, char** argv)
   LOG(INFO) << "Starting Mesos slave";
 
   Slave* slave = new Slave(
+      id,
       flags,
       detector.get(),
       containerizer.get(),

http://git-wip-us.apache.org/repos/asf/mesos/blob/4a211e5f/src/tests/mesos.cpp
----------------------------------------------------------------------
diff --git a/src/tests/mesos.cpp b/src/tests/mesos.cpp
index 06e774b..8fe28ae 100644
--- a/src/tests/mesos.cpp
+++ b/src/tests/mesos.cpp
@@ -555,6 +555,7 @@ MockSlave::MockSlave(const slave::Flags& flags,
                      slave::Containerizer* containerizer,
                      const Option<mesos::slave::QoSController*>& _qosController)
   : slave::Slave(
+      process::ID::generate("slave"),
       flags,
       detector,
       containerizer,