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/12/13 01:18:06 UTC
[2/2] mesos git commit: Moved the `IOSwitchboardServer::isRequired`
to `IOSwitchBoard`.
Moved the `IOSwitchboardServer::isRequired` to `IOSwitchBoard`.
Renamed it to `IOSwitchboard::requiresServer` after the move.
This is mainly done for supporting Windows builds because
`IOSwitchboardServer` is ifdef'ed out for Windows but we need access
to the static method.
Review: https://reviews.apache.org/r/54686
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/5fe6ec45
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/5fe6ec45
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/5fe6ec45
Branch: refs/heads/master
Commit: 5fe6ec45de47ec7eb054923a2d5228602319283c
Parents: 0a96f5b
Author: Vinod Kone <vi...@gmail.com>
Authored: Mon Dec 12 16:49:30 2016 -0800
Committer: Vinod Kone <vi...@gmail.com>
Committed: Mon Dec 12 17:17:49 2016 -0800
----------------------------------------------------------------------
.../containerizer/mesos/io/switchboard.cpp | 4 +-
.../containerizer/mesos/io/switchboard.hpp | 39 ++++++++++----------
2 files changed, 22 insertions(+), 21 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/5fe6ec45/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 0122974..478815d 100644
--- a/src/slave/containerizer/mesos/io/switchboard.cpp
+++ b/src/slave/containerizer/mesos/io/switchboard.cpp
@@ -290,7 +290,7 @@ Future<Option<ContainerLaunchInfo>> IOSwitchboard::_prepare(
// On windows, we do not yet support running an io switchboard
// server, so we must error out if it is required.
#ifdef __WINDOWS__
- if (IOSwitchboardServer::isRequired(containerConfig)) {
+ if (IOSwitchboard::requiresServer(containerConfig)) {
return Failure(
"IO Switchboard server is not supported on windows");
}
@@ -299,7 +299,7 @@ Future<Option<ContainerLaunchInfo>> IOSwitchboard::_prepare(
bool hasTTY = containerConfig.has_container_info() &&
containerConfig.container_info().has_tty_info();
- if (!IOSwitchboardServer::isRequired(containerConfig)) {
+ if (!IOSwitchboard::requiresServer(containerConfig)) {
ContainerLaunchInfo launchInfo;
ContainerIO* out = launchInfo.mutable_out();
http://git-wip-us.apache.org/repos/asf/mesos/blob/5fe6ec45/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 ec109bf..8dfac79 100644
--- a/src/slave/containerizer/mesos/io/switchboard.hpp
+++ b/src/slave/containerizer/mesos/io/switchboard.hpp
@@ -78,6 +78,26 @@ public:
process::Future<process::http::Connection> connect(
const ContainerID& containerId);
+ // Helper function that returns `true` if `IOSwitchboardServer`
+ // needs to be enabled for the given `ContainerConfig`. It must
+ // be enabled for `DEBUG` containers and ones that need `TTYInfo`.
+ static bool requiresServer(
+ const mesos::slave::ContainerConfig& containerConfig)
+ {
+ if (containerConfig.has_container_info() &&
+ containerConfig.container_info().has_tty_info()) {
+ return true;
+ }
+
+ if (containerConfig.has_container_class() &&
+ containerConfig.container_class() ==
+ mesos::slave::ContainerClass::DEBUG) {
+ return true;
+ }
+
+ return false;
+ }
+
private:
struct Info
{
@@ -227,25 +247,6 @@ public:
// has been started with `waitForConnection` set to `true`.
process::Future<Nothing> unblock();
- // Helper function that returns `true` if `IOSwitchboardServer`
- // needs to be enabled for the given `ContainerConfig`. It must
- // be enabled for `DEBUG` containers and ones that need `TTYInfo`.
- static bool isRequired(const mesos::slave::ContainerConfig& containerConfig)
- {
- if (containerConfig.has_container_info() &&
- containerConfig.container_info().has_tty_info()) {
- return true;
- }
-
- if (containerConfig.has_container_class() &&
- containerConfig.container_class() ==
- mesos::slave::ContainerClass::DEBUG) {
- return true;
- }
-
- return false;
- }
-
private:
IOSwitchboardServer(
bool tty,