Class: RedisFailover::NodeStrategy::Consensus
- Inherits:
-
RedisFailover::NodeStrategy
- Object
- RedisFailover::NodeStrategy
- RedisFailover::NodeStrategy::Consensus
- Defined in:
- lib/redis_failover/node_strategy/consensus.rb
Overview
Consensus strategy only marks the node as unavailable if all members of the snapshot indicate that the node is down.
Constant Summary
Constants included from Util
Util::CONNECTIVITY_ERRORS, Util::DEFAULT_ROOT_ZNODE_PATH, Util::REDIS_ERRORS, Util::REDIS_READ_OPS, Util::UNSUPPORTED_OPS, Util::ZK_ERRORS
Instance Method Summary collapse
Methods inherited from RedisFailover::NodeStrategy
Methods included from Util
#decode, #different?, #encode, logger, #logger, logger=, #symbolize_keys
Instance Method Details
#determine_state(node, snapshots) ⇒ Object
7 8 9 10 11 12 13 14 15 |
# File 'lib/redis_failover/node_strategy/consensus.rb', line 7 def determine_state(node, snapshots) snapshot = snapshots[node] if snapshot.all_unavailable? log_unavailable(node, snapshot) :unavailable else :available end end |