Class: Aerospike::PartitionFilter

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#countObject (readonly)

Returns the value of attribute count.



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

def count
  @count
end

#digestObject (readonly)

Returns the value of attribute digest.



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

def digest
  @digest
end

#doneObject Also known as: done?

Returns the value of attribute done.



21
22
23
# File 'lib/aerospike/query/partition_filter.rb', line 21

def done
  @done
end

#partition_beginObject (readonly)

Returns the value of attribute partition_begin.



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

def partition_begin
  @partition_begin
end

#partitionsObject

Returns the value of attribute partitions.



21
22
23
# File 'lib/aerospike/query/partition_filter.rb', line 21

def partitions
  @partitions
end

Class Method Details

.allObject

Creates a partition filter that reads all the partitions.



27
28
29
# File 'lib/aerospike/query/partition_filter.rb', line 27

def self.all
  PartitionFilter.new(0, Aerospike::Node::PARTITIONS)
end

.by_id(partition_id) ⇒ Object

Creates a partition filter by partition id. Partition id is between 0 - 4095



33
34
35
# File 'lib/aerospike/query/partition_filter.rb', line 33

def self.by_id(partition_id)
  PartitionFilter.new(partition_id, 1)
end

.by_key(key) ⇒ Object

Creates a partition filter that will return records after key’s digest in the partition containing the digest. Note that digest order is not the same as userKey order. This method only works for scan or query with nil filter.



48
49
50
# File 'lib/aerospike/query/partition_filter.rb', line 48

def self.by_key(key)
  PartitionFilter.new(key.partition_id, 1, key.digest)
end

.by_range(partition_begin, count) ⇒ Object

Creates a partition filter by partition range. begin partition id is between 0 - 4095 count is the number of partitions, in the range of 1 - 4096 inclusive.



40
41
42
# File 'lib/aerospike/query/partition_filter.rb', line 40

def self.by_range(partition_begin, count)
  PartitionFilter.new(partition_begin, count)
end

Instance Method Details

#to_sObject



52
53
54
# File 'lib/aerospike/query/partition_filter.rb', line 52

def to_s
  "PartitionFilter<begin: #{@partition_begin}, count: #{@count}, digest: #{@digest}, done: #{@done}>"
end