mesos-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m.@apache.org
Subject [1/2] mesos git commit: Wrapped IOSwitchboard.connect() in a dispatch.
Date Fri, 24 Feb 2017 03:58:21 GMT
Repository: mesos
Updated Branches:
  refs/heads/master 4f8a2c1bc -> ea3436b38


Wrapped IOSwitchboard.connect() in a dispatch.

Since the IOSwitchboard is implemented as a MesosIsolatorProcess, most
of its API calls are automatically dispatched onto its underlying
process by an Isolator wrapper. However, the IOSwitchboard also
includes an additional connect() call which is not accessed through
the Isolator wrapper. As such, we need to wrap it in a dispatch call
manually.

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


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

Branch: refs/heads/master
Commit: b2ad1ae29514e67e3f29cb666e70060e2951ec42
Parents: 4f8a2c1
Author: Kevin Klues <klueska@gmail.com>
Authored: Thu Feb 23 18:43:27 2017 -0800
Committer: Adam B <adam@mesosphere.io>
Committed: Thu Feb 23 18:54:57 2017 -0800

----------------------------------------------------------------------
 src/slave/containerizer/mesos/io/switchboard.cpp | 11 ++++++++++-
 src/slave/containerizer/mesos/io/switchboard.hpp |  6 +++++-
 2 files changed, 15 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/b2ad1ae2/src/slave/containerizer/mesos/io/switchboard.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/io/switchboard.cpp b/src/slave/containerizer/mesos/io/switchboard.cpp
index b948f3c..820d53b 100644
--- a/src/slave/containerizer/mesos/io/switchboard.cpp
+++ b/src/slave/containerizer/mesos/io/switchboard.cpp
@@ -659,7 +659,16 @@ Future<Option<ContainerLaunchInfo>> IOSwitchboard::_prepare(
 
 
 Future<http::Connection> IOSwitchboard::connect(
-    const ContainerID& containerId)
+    const ContainerID& containerId) const
+{
+  return dispatch(self(), [this, containerId]() {
+    return _connect(containerId);
+  });
+}
+
+
+Future<http::Connection> IOSwitchboard::_connect(
+    const ContainerID& containerId) const
 {
 #ifdef __WINDOWS__
   return Failure("Not supported on Windows");

http://git-wip-us.apache.org/repos/asf/mesos/blob/b2ad1ae2/src/slave/containerizer/mesos/io/switchboard.hpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/io/switchboard.hpp b/src/slave/containerizer/mesos/io/switchboard.hpp
index 7a7ad2d..5b1fa25 100644
--- a/src/slave/containerizer/mesos/io/switchboard.hpp
+++ b/src/slave/containerizer/mesos/io/switchboard.hpp
@@ -75,8 +75,9 @@ public:
   virtual process::Future<Nothing> cleanup(
       const ContainerID& containerId);
 
+  // Connect to the `IOSwitchboard` associated with `containerId`.
   process::Future<process::http::Connection> connect(
-      const ContainerID& containerId);
+      const ContainerID& containerId) const;
 
   // Helper function that returns `true` if `IOSwitchboardServer`
   // needs to be enabled for the given `ContainerConfig`. It must
@@ -106,6 +107,9 @@ private:
       const mesos::slave::ContainerConfig& containerConfig,
       const mesos::slave::ContainerLogger::SubprocessInfo& loggerInfo);
 
+  process::Future<process::http::Connection> _connect(
+      const ContainerID& containerId) const;
+
 #ifndef __WINDOWS__
   void reaped(
       const ContainerID& containerId,


Mime
View raw message