Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
impala::FailureDetector Class Referenceabstract

#include <failure-detector.h>

Inheritance diagram for impala::FailureDetector:
Collaboration diagram for impala::FailureDetector:

Public Types

enum  PeerState { FAILED = 0, SUSPECTED = 1, OK = 2, UNKNOWN = 3 }
 

Public Member Functions

virtual ~FailureDetector ()
 
virtual PeerState UpdateHeartbeat (const std::string &peer, bool seen)=0
 
virtual PeerState GetPeerState (const std::string &peer)=0
 Returns the current estimated state of a peer. More...
 
virtual void EvictPeer (const std::string &peer)=0
 Remove a peer from the failure detector completely. More...
 

Static Public Member Functions

static const std::string & PeerStateToString (PeerState peer_state)
 Utility method to convert a PeerState enum to a string. More...
 

Detailed Description

A failure detector tracks the liveness of a set of peers which is computed as a function of received 'heartbeat' signals. A peer may be in one of four states: FAILED -> the peer is assumed to be failed SUSPECTED -> the peer may have failed, and may be moved to the FAILED state shortly. OK -> the peer is apparently healthy and sending regular heartbeats UNKNOWN -> nothing has been heard about the peer

Definition at line 33 of file failure-detector.h.

Member Enumeration Documentation

Enumerator
FAILED 
SUSPECTED 
OK 
UNKNOWN 

Definition at line 35 of file failure-detector.h.

Constructor & Destructor Documentation

virtual impala::FailureDetector::~FailureDetector ( )
inlinevirtual

Definition at line 42 of file failure-detector.h.

Member Function Documentation

virtual void impala::FailureDetector::EvictPeer ( const std::string &  peer)
pure virtual

Remove a peer from the failure detector completely.

Implemented in impala::MissedHeartbeatFailureDetector, and impala::TimeoutFailureDetector.

virtual PeerState impala::FailureDetector::GetPeerState ( const std::string &  peer)
pure virtual

Returns the current estimated state of a peer.

Implemented in impala::MissedHeartbeatFailureDetector, and impala::TimeoutFailureDetector.

const string & FailureDetector::PeerStateToString ( FailureDetector::PeerState  peer_state)
static

Utility method to convert a PeerState enum to a string.

Definition at line 36 of file failure-detector.cc.

References PEER_STATE_TO_STRING.

virtual PeerState impala::FailureDetector::UpdateHeartbeat ( const std::string &  peer,
bool  seen 
)
pure virtual

Updates the state of a peer according to the most recent heartbeat state. If 'seen' is true, this method indicates that a heartbeat has been received. If seen is 'false', this method indicates that a heartbeat has not been received since the last successful heartbeat receipt. This method returns the current state of the updated peer. Note that this may be different from the state implied by seen - a single missed heartbeat, for example, may not cause a peer to enter the SUSPECTED or FAILED states. The failure detector has the benefit of looking at all samples, rather than just the most recent one.

Implemented in impala::MissedHeartbeatFailureDetector, and impala::TimeoutFailureDetector.


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