Apache Mesos
detector.hpp
Go to the documentation of this file.
1 // Licensed to the Apache Software Foundation (ASF) under one
2 // or more contributor license agreements. See the NOTICE file
3 // distributed with this work for additional information
4 // regarding copyright ownership. The ASF licenses this file
5 // to you under the Apache License, Version 2.0 (the
6 // "License"); you may not use this file except in compliance
7 // with the License. You may obtain a copy of the License at
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 
17 #ifndef __MESOS_MODULE_DETECTOR_HPP__
18 #define __MESOS_MODULE_DETECTOR_HPP__
19 
20 #include <mesos/mesos.hpp>
21 #include <mesos/module.hpp>
22 
24 
25 namespace mesos {
26 namespace modules {
27 
28 template <>
29 inline const char* kind<mesos::master::detector::MasterDetector>()
30 {
31  return "MasterDetector";
32 }
33 
34 
35 template <>
37 {
39  const char* _moduleApiVersion,
40  const char* _mesosVersion,
41  const char* _authorName,
42  const char* _authorEmail,
43  const char* _description,
44  bool (*_compatible)(),
46  (*_create)(const Parameters& parameters))
47  : ModuleBase(
48  _moduleApiVersion,
49  _mesosVersion,
50  mesos::modules::kind<mesos::master::detector::MasterDetector>(),
51  _authorName,
52  _authorEmail,
53  _description,
54  _compatible),
55  create(_create) {}
56 
58  const Parameters& parameters);
59 };
60 
61 } // namespace modules {
62 } // namespace mesos {
63 
64 #endif // __MESOS_MODULE_DETECTOR_HPP__
Definition: master.hpp:27
Definition: module.hpp:56
Module(const char *_moduleApiVersion, const char *_mesosVersion, const char *_authorName, const char *_authorEmail, const char *_description, bool(*_compatible)(), mesos::master::detector::MasterDetector *(*_create)(const Parameters &parameters))
Definition: detector.hpp:38
const char * kind()
Definition: agent.hpp:25
An abstraction of a Master detector which can be used to detect the leading master from a group...
Definition: detector.hpp:38
Try< Nothing > create(const std::string &hierarchy, const std::string &cgroup, bool recursive=false)
Definition: module.hpp:97