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_MASTER_DETECTOR_HPP__
18 #define __MESOS_MASTER_DETECTOR_HPP__
19 
20 #include <string>
21 
22 #include <mesos/mesos.hpp>
23 
24 #include <process/future.hpp>
25 
26 #include <stout/duration.hpp>
27 #include <stout/option.hpp>
28 #include <stout/try.hpp>
29 
30 namespace mesos {
31 namespace master {
32 namespace detector {
33 
39 {
40 public:
58  const Option<std::string>& zk,
59  const Option<std::string>& masterDetectorModule = None(),
60  const Option<Duration>& zkSessionTimeout = None());
61 
62  virtual ~MasterDetector() = 0;
63 
80  const Option<MasterInfo>& previous = None()) = 0;
81 };
82 
83 } // namespace detector {
84 } // namespace master {
85 } // namespace mesos {
86 
87 #endif // __MESOS_MASTER_DETECTOR_HPP__
static Try< MasterDetector * > create(const Option< std::string > &zk, const Option< std::string > &masterDetectorModule=None(), const Option< Duration > &zkSessionTimeout=None())
Creates a master detector.
virtual process::Future< Option< MasterInfo > > detect(const Option< MasterInfo > &previous=None())=0
Returns MasterInfo after an election has occurred and the elected master is different than that speci...
Definition: master.hpp:27
Definition: check.hpp:33
Definition: agent.hpp:25
Definition: none.hpp:27
An abstraction of a Master detector which can be used to detect the leading master from a group...
Definition: detector.hpp:38
Definition: future.hpp:58