Apache Mesos
Public Member Functions | List of all members
mesos::master::detector::ZooKeeperMasterDetector Class Reference

#include <zookeeper.hpp>

Inheritance diagram for mesos::master::detector::ZooKeeperMasterDetector:
mesos::master::detector::MasterDetector

Public Member Functions

 ZooKeeperMasterDetector (const zookeeper::URL &url, const Duration &sessionTimeout=MASTER_DETECTOR_ZK_SESSION_TIMEOUT)
 
 ZooKeeperMasterDetector (process::Owned< zookeeper::Group > group)
 
virtual ~ZooKeeperMasterDetector ()
 
virtual process::Future
< Option< MasterInfo > > 
detect (const Option< MasterInfo > &previous=None())
 Returns MasterInfo after an election has occurred and the elected master is different than that specified (if any), or NONE if an election occurs and no master is elected (e.g., all masters are lost). More...
 
- Public Member Functions inherited from mesos::master::detector::MasterDetector
virtual ~MasterDetector ()=0
 

Additional Inherited Members

- Static Public Member Functions inherited from mesos::master::detector::MasterDetector
static Try< MasterDetector * > create (const Option< std::string > &zk, const Option< std::string > &masterDetectorModule=None(), const Option< Duration > &zkSessionTimeout=None())
 Creates a master detector. More...
 

Constructor & Destructor Documentation

mesos::master::detector::ZooKeeperMasterDetector::ZooKeeperMasterDetector ( const zookeeper::URL url,
const Duration sessionTimeout = MASTER_DETECTOR_ZK_SESSION_TIMEOUT 
)
explicit
mesos::master::detector::ZooKeeperMasterDetector::ZooKeeperMasterDetector ( process::Owned< zookeeper::Group group)
explicit
virtual mesos::master::detector::ZooKeeperMasterDetector::~ZooKeeperMasterDetector ( )
virtual

Member Function Documentation

virtual process::Future<Option<MasterInfo> > mesos::master::detector::ZooKeeperMasterDetector::detect ( const Option< MasterInfo > &  previous = None())
virtual

Returns MasterInfo after an election has occurred and the elected master is different than that specified (if any), or NONE if an election occurs and no master is elected (e.g., all masters are lost).

A failed future is returned if the detector is unable to detect the leading master due to a non-retryable error. Note that the detector transparently tries to recover from retryable errors. The future is never discarded unless it stays pending when the detector destructs.

The 'previous' result (if any) should be passed back if this method is called repeatedly so the detector only returns when it gets a different result.

Implements mesos::master::detector::MasterDetector.


The documentation for this class was generated from the following file: