Sha256: 771745de0441818228bbf31034bbd1b683428b6fae46ec96a420b31dbaba0893

Contents?: true

Size: 543 Bytes

Versions: 13

Compression:

Stored size: 543 Bytes

Contents

module RedisFailover
  class NodeStrategy
    # Majority strategy only marks the node as unavailable if a majority of the
    # snapshot indicates that the node is down.
    class Majority < NodeStrategy
      # @see RedisFailover::NodeStrategy#determine_state
      def determine_state(node, snapshots)
        snapshot = snapshots[node]
        if snapshot.unavailable_count > snapshot.available_count
          log_unavailable(node, snapshot)
          :unavailable
        else
          :available
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 3 rubygems

Version Path
spbtv_redis_failover-1.0.2.1 lib/redis_failover/node_strategy/majority.rb
nogara-redis_failover-1.0.6 lib/redis_failover/node_strategy/majority.rb
nogara-redis_failover-1.0.5 lib/redis_failover/node_strategy/majority.rb
nogara-redis_failover-1.0.4 lib/redis_failover/node_strategy/majority.rb
redis_failover-1.0.2 lib/redis_failover/node_strategy/majority.rb
nogara-redis_failover-1.0.2 lib/redis_failover/node_strategy/majority.rb
nogara-redis_failover-1.0.1 lib/redis_failover/node_strategy/majority.rb
redis_failover-1.0.1 lib/redis_failover/node_strategy/majority.rb
nogara-redis_failover-1.0.0 lib/redis_failover/node_strategy/majority.rb
redis_failover-1.0.0 lib/redis_failover/node_strategy/majority.rb
nogara-redis_failover-0.9.7.4 lib/redis_failover/node_strategy/majority.rb
nogara-redis_failover-0.9.7.3 lib/redis_failover/node_strategy/majority.rb
nogara-redis_failover-0.9.7.2 lib/redis_failover/node_strategy/majority.rb