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 2016/09/17 00:39:11 UTC
[3/3] mesos git commit: Added a virtual function to Isolator to tell
is it supports nesting.
Added a virtual function to Isolator to tell is it supports nesting.
Review: https://reviews.apache.org/r/51975
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/aaa574ef
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/aaa574ef
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/aaa574ef
Branch: refs/heads/master
Commit: aaa574efbb06b945f08cde99ca253962c9ef06a5
Parents: 45fea21
Author: Jie Yu <yu...@gmail.com>
Authored: Fri Sep 16 15:07:43 2016 -0700
Committer: Jie Yu <yu...@gmail.com>
Committed: Fri Sep 16 17:38:59 2016 -0700
----------------------------------------------------------------------
include/mesos/slave/isolator.hpp | 8 ++++++++
src/slave/containerizer/mesos/isolator.cpp | 6 ++++++
src/slave/containerizer/mesos/isolator.hpp | 7 +++++++
3 files changed, 21 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/aaa574ef/include/mesos/slave/isolator.hpp
----------------------------------------------------------------------
diff --git a/include/mesos/slave/isolator.hpp b/include/mesos/slave/isolator.hpp
index d5880ee..b16f832 100644
--- a/include/mesos/slave/isolator.hpp
+++ b/include/mesos/slave/isolator.hpp
@@ -41,6 +41,14 @@ class Isolator
public:
virtual ~Isolator() {}
+ // Returns true if this isolator supports nested containers. This
+ // method is designed to allow isolators to opt-in to support nested
+ // containers.
+ virtual bool supportsNesting()
+ {
+ return false;
+ }
+
// Recover containers from the run states and the orphan containers
// (known to the launcher but not known to the slave) detected by
// the launcher.
http://git-wip-us.apache.org/repos/asf/mesos/blob/aaa574ef/src/slave/containerizer/mesos/isolator.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/isolator.cpp b/src/slave/containerizer/mesos/isolator.cpp
index 253ff3c..ccdcb9a 100644
--- a/src/slave/containerizer/mesos/isolator.cpp
+++ b/src/slave/containerizer/mesos/isolator.cpp
@@ -46,6 +46,12 @@ MesosIsolator::~MesosIsolator()
}
+bool MesosIsolator::supportsNesting()
+{
+ return process->supportsNesting();
+}
+
+
Future<Nothing> MesosIsolator::recover(
const list<ContainerState>& state,
const hashset<ContainerID>& orphans)
http://git-wip-us.apache.org/repos/asf/mesos/blob/aaa574ef/src/slave/containerizer/mesos/isolator.hpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/isolator.hpp b/src/slave/containerizer/mesos/isolator.hpp
index b94947b..aaad346 100644
--- a/src/slave/containerizer/mesos/isolator.hpp
+++ b/src/slave/containerizer/mesos/isolator.hpp
@@ -41,6 +41,8 @@ public:
explicit MesosIsolator(process::Owned<MesosIsolatorProcess> process);
virtual ~MesosIsolator();
+ virtual bool supportsNesting();
+
virtual process::Future<Nothing> recover(
const std::list<mesos::slave::ContainerState>& states,
const hashset<ContainerID>& orphans);
@@ -79,6 +81,11 @@ class MesosIsolatorProcess : public process::Process<MesosIsolatorProcess>
public:
virtual ~MesosIsolatorProcess() {}
+ virtual bool supportsNesting()
+ {
+ return false;
+ }
+
virtual process::Future<Nothing> recover(
const std::list<mesos::slave::ContainerState>& states,
const hashset<ContainerID>& orphans)