Class: Aerospike::Peers
- Inherits:
-
Object
- Object
- Aerospike::Peers
- Defined in:
- lib/aerospike/peers.rb,
lib/aerospike/peers/fetch.rb,
lib/aerospike/peers/parse.rb
Defined Under Namespace
Instance Attribute Summary collapse
-
#generation_changed ⇒ Object
Returns the value of attribute generation_changed.
-
#hosts ⇒ Object
Returns the value of attribute hosts.
-
#nodes ⇒ Object
Returns the value of attribute nodes.
-
#peers ⇒ Object
Returns the value of attribute peers.
-
#refresh_count ⇒ Object
Returns the value of attribute refresh_count.
-
#use_peers ⇒ Object
Returns the value of attribute use_peers.
Instance Method Summary collapse
- #find_node_by_name(node_name) ⇒ Object
- #generation_changed? ⇒ Boolean
-
#initialize ⇒ Peers
constructor
A new instance of Peers.
- #reset_refresh_count! ⇒ Object
- #use_peers? ⇒ Boolean
Constructor Details
#initialize ⇒ Peers
Returns a new instance of Peers.
24 25 26 27 28 29 30 |
# File 'lib/aerospike/peers.rb', line 24 def initialize @peers = ::Array.new @hosts = ::Set.new @nodes = {} @use_peers = true @refresh_count = 0 end |
Instance Attribute Details
#generation_changed ⇒ Object
Returns the value of attribute generation_changed.
22 23 24 |
# File 'lib/aerospike/peers.rb', line 22 def generation_changed @generation_changed end |
#hosts ⇒ Object
Returns the value of attribute hosts.
22 23 24 |
# File 'lib/aerospike/peers.rb', line 22 def hosts @hosts end |
#nodes ⇒ Object
Returns the value of attribute nodes.
22 23 24 |
# File 'lib/aerospike/peers.rb', line 22 def nodes @nodes end |
#peers ⇒ Object
Returns the value of attribute peers.
22 23 24 |
# File 'lib/aerospike/peers.rb', line 22 def peers @peers end |
#refresh_count ⇒ Object
Returns the value of attribute refresh_count.
22 23 24 |
# File 'lib/aerospike/peers.rb', line 22 def refresh_count @refresh_count end |
#use_peers ⇒ Object
Returns the value of attribute use_peers.
22 23 24 |
# File 'lib/aerospike/peers.rb', line 22 def use_peers @use_peers end |
Instance Method Details
#find_node_by_name(node_name) ⇒ Object
32 33 34 |
# File 'lib/aerospike/peers.rb', line 32 def find_node_by_name(node_name) @nodes[node_name] end |
#generation_changed? ⇒ Boolean
36 37 38 |
# File 'lib/aerospike/peers.rb', line 36 def generation_changed? @generation_changed == true end |
#reset_refresh_count! ⇒ Object
40 41 42 |
# File 'lib/aerospike/peers.rb', line 40 def reset_refresh_count! @refresh_count = 0 end |
#use_peers? ⇒ Boolean
44 45 46 |
# File 'lib/aerospike/peers.rb', line 44 def use_peers? @use_peers == true end |