You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by nn...@apache.org on 2014/10/23 00:44:05 UTC
git commit: Added loading of Isolator modules in mesos containerizer.
Repository: mesos
Updated Branches:
refs/heads/master 88ead2571 -> 3a179ce2d
Added loading of Isolator modules in mesos containerizer.
If an Isolator type is not found in the default list, the code now
queries ModuleManager and creates a module instance if found.
Review: https://reviews.apache.org/r/26727
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/3a179ce2
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/3a179ce2
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/3a179ce2
Branch: refs/heads/master
Commit: 3a179ce2d9fa119ca692682dfa6819498893ec95
Parents: 88ead25
Author: Kapil Arya <ka...@mesosphere.io>
Authored: Wed Oct 22 14:58:19 2014 -0700
Committer: Niklas Q. Nielsen <ni...@mesosphere.io>
Committed: Wed Oct 22 15:41:42 2014 -0700
----------------------------------------------------------------------
src/slave/containerizer/mesos/containerizer.cpp | 13 +++++++++++++
1 file changed, 13 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/3a179ce2/src/slave/containerizer/mesos/containerizer.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/containerizer.cpp b/src/slave/containerizer/mesos/containerizer.cpp
index 9d08329..9f745d8 100644
--- a/src/slave/containerizer/mesos/containerizer.cpp
+++ b/src/slave/containerizer/mesos/containerizer.cpp
@@ -24,6 +24,9 @@
#include <stout/os.hpp>
+#include "module/isolator.hpp"
+#include "module/manager.hpp"
+
#include "slave/paths.hpp"
#include "slave/slave.hpp"
@@ -58,6 +61,8 @@ namespace mesos {
namespace internal {
namespace slave {
+using mesos::modules::ModuleManager;
+
using state::SlaveState;
using state::FrameworkState;
using state::ExecutorState;
@@ -113,6 +118,14 @@ Try<MesosContainerizer*> MesosContainerizer::create(
} else {
isolators.push_back(Owned<Isolator>(isolator.get()));
}
+ } else if (ModuleManager::contains<Isolator>(type)) {
+ Try<Isolator*> isolator = ModuleManager::create<Isolator>(type);
+ if (isolator.isError()) {
+ return Error(
+ "Could not create isolator " + type + ": " + isolator.error());
+ } else {
+ isolators.push_back(Owned<Isolator>(isolator.get()));
+ }
} else {
return Error("Unknown or unsupported isolator: " + type);
}