Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
|
#include <failure-detector.h>
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... | |
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.
Enumerator | |
---|---|
FAILED | |
SUSPECTED | |
OK | |
UNKNOWN |
Definition at line 35 of file failure-detector.h.
|
inlinevirtual |
Definition at line 42 of file failure-detector.h.
|
pure virtual |
Remove a peer from the failure detector completely.
Implemented in impala::MissedHeartbeatFailureDetector, and impala::TimeoutFailureDetector.
|
pure virtual |
Returns the current estimated state of a peer.
Implemented in impala::MissedHeartbeatFailureDetector, and impala::TimeoutFailureDetector.
|
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.
|
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.