Class: Aerospike::Node::Rebalance
- Inherits:
-
Object
- Object
- Aerospike::Node::Rebalance
- Defined in:
- lib/aerospike/node/rebalance.rb
Overview
generic class for representing changes in eg. peer and partition generation
Instance Attribute Summary collapse
-
#generation ⇒ Object
readonly
Returns the value of attribute generation.
Instance Method Summary collapse
- #changed? ⇒ Boolean
- #eql?(generation) ⇒ Boolean
-
#initialize(generation = -1)) ⇒ Rebalance
constructor
A new instance of Rebalance.
- #reset_changed! ⇒ Object
- #update(new_generation) ⇒ Object
Constructor Details
Instance Attribute Details
#generation ⇒ Object (readonly)
Returns the value of attribute generation.
24 25 26 |
# File 'lib/aerospike/node/rebalance.rb', line 24 def generation @generation end |
Instance Method Details
#changed? ⇒ Boolean
31 32 33 |
# File 'lib/aerospike/node/rebalance.rb', line 31 def changed? @changed.value == true end |
#eql?(generation) ⇒ Boolean
35 36 37 |
# File 'lib/aerospike/node/rebalance.rb', line 35 def eql?(generation) @generation.value == generation end |
#reset_changed! ⇒ Object
39 40 41 |
# File 'lib/aerospike/node/rebalance.rb', line 39 def reset_changed! @changed.value = false end |
#update(new_generation) ⇒ Object
43 44 45 46 47 |
# File 'lib/aerospike/node/rebalance.rb', line 43 def update(new_generation) return if @generation.value == new_generation @generation.value = new_generation @changed.value = true end |