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 2015/02/10 19:22:40 UTC
[6/9] mesos git commit: Out of tree build 6: Exposed
module/isolator.hpp for out-of-tree module building.
Out of tree build 6: Exposed module/isolator.hpp for out-of-tree module building.
The isolation module can thus include <mesos/module/isolator.hpp> to
get all required definitions.
Review: https://reviews.apache.org/r/29604
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/45732231
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/45732231
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/45732231
Branch: refs/heads/master
Commit: 4573223193aa81bd140143546538050d938ebde4
Parents: 0082eb6
Author: Kapil Arya <ka...@mesosphere.io>
Authored: Tue Feb 10 09:55:09 2015 -0800
Committer: Niklas Q. Nielsen <ni...@mesosphere.io>
Committed: Tue Feb 10 09:55:09 2015 -0800
----------------------------------------------------------------------
include/mesos/module/isolator.hpp | 66 ++++++++++++++++++++
src/Makefile.am | 2 +-
src/examples/test_isolator_module.cpp | 4 +-
src/module/isolator.hpp | 66 --------------------
src/slave/containerizer/mesos/containerizer.cpp | 3 +-
src/tests/isolator_tests.cpp | 4 +-
src/tests/module_tests.cpp | 2 +-
7 files changed, 74 insertions(+), 73 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/45732231/include/mesos/module/isolator.hpp
----------------------------------------------------------------------
diff --git a/include/mesos/module/isolator.hpp b/include/mesos/module/isolator.hpp
new file mode 100644
index 0000000..452ad31
--- /dev/null
+++ b/include/mesos/module/isolator.hpp
@@ -0,0 +1,66 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __MESOS_MODULE_ISOLATOR_HPP__
+#define __MESOS_MODULE_ISOLATOR_HPP__
+
+#include <mesos/mesos.hpp>
+#include <mesos/module.hpp>
+
+#include <mesos/slave/isolator.hpp>
+
+namespace mesos {
+namespace modules {
+
+template<>
+inline const char* kind<mesos::slave::Isolator>()
+{
+ return "Isolator";
+}
+
+
+template <>
+struct Module<mesos::slave::Isolator> : ModuleBase
+{
+ Module(
+ const char* _moduleApiVersion,
+ const char* _mesosVersion,
+ const char* _authorName,
+ const char* _authorEmail,
+ const char* _description,
+ bool (*_compatible)(),
+ mesos::slave::Isolator*
+ (*_create)(const Parameters& parameters))
+ : ModuleBase(
+ _moduleApiVersion,
+ _mesosVersion,
+ mesos::modules::kind<mesos::slave::Isolator>(),
+ _authorName,
+ _authorEmail,
+ _description,
+ _compatible),
+ create(_create)
+ { }
+
+ mesos::slave::Isolator* (*create)(const Parameters& parameters);
+};
+
+} // namespace modules {
+} // namespace mesos {
+
+#endif // __MESOS_MODULE_ISOLATOR_HPP__
http://git-wip-us.apache.org/repos/asf/mesos/blob/45732231/src/Makefile.am
----------------------------------------------------------------------
diff --git a/src/Makefile.am b/src/Makefile.am
index 00fb2a6..471af11 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -376,6 +376,7 @@ nodist_fetcher_HEADERS = ../include/mesos/fetcher/fetcher.pb.h
moduledir = $(pkgincludedir)/module
module_HEADERS = \
+ $(top_srcdir)/include/mesos/module/isolator.hpp \
$(top_srcdir)/include/mesos/module/module.hpp \
$(top_srcdir)/include/mesos/module/module.proto
@@ -494,7 +495,6 @@ libmesos_no_3rdparty_la_SOURCES += \
module/authenticatee.hpp \
module/authenticator.hpp \
module/hook.hpp \
- module/isolator.hpp \
module/manager.hpp \
sched/constants.hpp \
sched/flags.hpp \
http://git-wip-us.apache.org/repos/asf/mesos/blob/45732231/src/examples/test_isolator_module.cpp
----------------------------------------------------------------------
diff --git a/src/examples/test_isolator_module.cpp b/src/examples/test_isolator_module.cpp
index dc804fe..a66dc74 100644
--- a/src/examples/test_isolator_module.cpp
+++ b/src/examples/test_isolator_module.cpp
@@ -19,12 +19,12 @@
#include <mesos/mesos.hpp>
#include <mesos/module.hpp>
+#include <mesos/module/isolator.hpp>
+
#include <mesos/slave/isolator.hpp>
#include <stout/try.hpp>
-#include "module/isolator.hpp"
-
#include "slave/containerizer/isolators/posix.hpp"
#include "slave/flags.hpp"
http://git-wip-us.apache.org/repos/asf/mesos/blob/45732231/src/module/isolator.hpp
----------------------------------------------------------------------
diff --git a/src/module/isolator.hpp b/src/module/isolator.hpp
deleted file mode 100644
index 4457186..0000000
--- a/src/module/isolator.hpp
+++ /dev/null
@@ -1,66 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __MODULE_ISOLATOR_HPP__
-#define __MODULE_ISOLATOR_HPP__
-
-#include <mesos/mesos.hpp>
-#include <mesos/module.hpp>
-
-#include <mesos/slave/isolator.hpp>
-
-namespace mesos {
-namespace modules {
-
-template<>
-inline const char* kind<mesos::slave::Isolator>()
-{
- return "Isolator";
-}
-
-
-template <>
-struct Module<mesos::slave::Isolator> : ModuleBase
-{
- Module(
- const char* _moduleApiVersion,
- const char* _mesosVersion,
- const char* _authorName,
- const char* _authorEmail,
- const char* _description,
- bool (*_compatible)(),
- mesos::slave::Isolator*
- (*_create)(const Parameters& parameters))
- : ModuleBase(
- _moduleApiVersion,
- _mesosVersion,
- mesos::modules::kind<mesos::slave::Isolator>(),
- _authorName,
- _authorEmail,
- _description,
- _compatible),
- create(_create)
- { }
-
- mesos::slave::Isolator* (*create)(const Parameters& parameters);
-};
-
-} // namespace modules {
-} // namespace mesos {
-
-#endif // __MODULE_ISOLATOR_HPP__
http://git-wip-us.apache.org/repos/asf/mesos/blob/45732231/src/slave/containerizer/mesos/containerizer.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/containerizer.cpp b/src/slave/containerizer/mesos/containerizer.cpp
index 9910a17..d2fa50d 100644
--- a/src/slave/containerizer/mesos/containerizer.cpp
+++ b/src/slave/containerizer/mesos/containerizer.cpp
@@ -16,6 +16,8 @@
* limitations under the License.
*/
+#include <mesos/module/isolator.hpp>
+
#include <mesos/slave/isolator.hpp>
#include <process/collect.hpp>
@@ -26,7 +28,6 @@
#include <stout/os.hpp>
-#include "module/isolator.hpp"
#include "module/manager.hpp"
#include "slave/paths.hpp"
http://git-wip-us.apache.org/repos/asf/mesos/blob/45732231/src/tests/isolator_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/isolator_tests.cpp b/src/tests/isolator_tests.cpp
index 7123a40..ab4bacc 100644
--- a/src/tests/isolator_tests.cpp
+++ b/src/tests/isolator_tests.cpp
@@ -26,6 +26,8 @@
#include <mesos/resources.hpp>
+#include <mesos/module/isolator.hpp>
+
#include <mesos/slave/isolator.hpp>
#include <process/future.hpp>
@@ -44,8 +46,6 @@
#include "master/master.hpp"
#include "master/detector.hpp"
-#include "module/isolator.hpp"
-
#include "slave/flags.hpp"
#include "slave/slave.hpp"
http://git-wip-us.apache.org/repos/asf/mesos/blob/45732231/src/tests/module_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/module_tests.cpp b/src/tests/module_tests.cpp
index 5131309..64e05c1 100644
--- a/src/tests/module_tests.cpp
+++ b/src/tests/module_tests.cpp
@@ -18,6 +18,7 @@
#include <mesos/module.hpp>
+#include <mesos/module/isolator.hpp>
#include <mesos/module/module.hpp>
#include <mesos/slave/isolator.hpp>
@@ -27,7 +28,6 @@
#include "common/parse.hpp"
#include "examples/test_module.hpp"
-#include "module/isolator.hpp"
#include "module/manager.hpp"
#include "tests/flags.hpp"