Class: RedisFailover::NodeStrategy::Single

Inherits:
RedisFailover::NodeStrategy show all
Defined in:
lib/redis_failover/node_strategy/single.rb

Overview

Marks the node as unavailable if any node manager reports the node as 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

for, #log_unavailable

Methods included from Util

#decode, #different?, #encode, logger, #logger, logger=, #symbolize_keys

Instance Method Details

#determine_state(node, snapshots) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'lib/redis_failover/node_strategy/single.rb', line 6

def determine_state(node, snapshots)
  snapshot = snapshots[node]
  if snapshot.unavailable_count > 0
    log_unavailable(node, snapshot)
    :unavailable
  else
    :available
  end
end