Module: Aerospike::Node::Verify::RebalanceGeneration

Defined in:
lib/aerospike/node/verify/rebalance_generation.rb

Overview

Fetch and set rebalance generation. If racks needs to be refreshed this will be indicated in node.rebalance_changed

Class Method Summary collapse

Class Method Details

.call(node, info_map) ⇒ Object



27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/aerospike/node/verify/rebalance_generation.rb', line 27

def call(node, info_map)
  gen_string = info_map.fetch('rebalance-generation', nil)

  raise Aerospike::Exceptions::Parse.new('rebalance-generation is empty') if gen_string.to_s.empty?

  generation = gen_string.to_i

  node.rebalance_generation.update(generation)

  return unless node.rebalance_generation.changed?
  Aerospike.logger.info("Node #{node.name} rebalance generation #{generation} changed")
end