Class: Aerospike::Peers

Inherits:
Object
  • Object
show all
Defined in:
lib/aerospike/peers.rb,
lib/aerospike/peers/fetch.rb,
lib/aerospike/peers/parse.rb

Defined Under Namespace

Modules: Fetch, Parse

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializePeers

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_changedObject

Returns the value of attribute generation_changed.



22
23
24
# File 'lib/aerospike/peers.rb', line 22

def generation_changed
  @generation_changed
end

#hostsObject

Returns the value of attribute hosts.



22
23
24
# File 'lib/aerospike/peers.rb', line 22

def hosts
  @hosts
end

#nodesObject

Returns the value of attribute nodes.



22
23
24
# File 'lib/aerospike/peers.rb', line 22

def nodes
  @nodes
end

#peersObject

Returns the value of attribute peers.



22
23
24
# File 'lib/aerospike/peers.rb', line 22

def peers
  @peers
end

#refresh_countObject

Returns the value of attribute refresh_count.



22
23
24
# File 'lib/aerospike/peers.rb', line 22

def refresh_count
  @refresh_count
end

#use_peersObject

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

Returns:

  • (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

Returns:

  • (Boolean)


44
45
46
# File 'lib/aerospike/peers.rb', line 44

def use_peers?
  @use_peers == true
end