Class: Aerospike::NodePartitions

Inherits:
Object
  • Object
show all
Defined in:
lib/aerospike/query/node_partitions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(node) ⇒ NodePartitions

Returns a new instance of NodePartitions.



22
23
24
25
26
27
28
29
# File 'lib/aerospike/query/node_partitions.rb', line 22

def initialize(node)
    @node= node
    @parts_full=    []
    @parts_partial= []
    @record_count= 0
    @parts_unavailable= 0
    @record_max= 0
end

Instance Attribute Details

#nodeObject

Returns the value of attribute node.



20
21
22
# File 'lib/aerospike/query/node_partitions.rb', line 20

def node
  @node
end

#parts_fullObject

Returns the value of attribute parts_full.



20
21
22
# File 'lib/aerospike/query/node_partitions.rb', line 20

def parts_full
  @parts_full
end

#parts_partialObject

Returns the value of attribute parts_partial.



20
21
22
# File 'lib/aerospike/query/node_partitions.rb', line 20

def parts_partial
  @parts_partial
end

#parts_unavailableObject

Returns the value of attribute parts_unavailable.



20
21
22
# File 'lib/aerospike/query/node_partitions.rb', line 20

def parts_unavailable
  @parts_unavailable
end

#record_countObject

Returns the value of attribute record_count.



20
21
22
# File 'lib/aerospike/query/node_partitions.rb', line 20

def record_count
  @record_count
end

#record_maxObject

Returns the value of attribute record_max.



20
21
22
# File 'lib/aerospike/query/node_partitions.rb', line 20

def record_max
  @record_max
end

Instance Method Details

#add_partition(partition_status) ⇒ Object



35
36
37
# File 'lib/aerospike/query/node_partitions.rb', line 35

def add_partition(partition_status)
  partition_status.digest.nil? ? @parts_full << partition_status : @parts_partial << partition_status
end

#to_sObject



31
32
33
# File 'lib/aerospike/query/node_partitions.rb', line 31

def to_s
  "Node #{@node.inspect}: full: #{@parts_full.length}, partial: #{@parts_partial.length}"
end