Class: Aerospike::PartitionFilter
- Inherits:
-
Object
- Object
- Aerospike::PartitionFilter
- Defined in:
- lib/aerospike/query/partition_filter.rb
Instance Attribute Summary collapse
-
#count ⇒ Object
readonly
Returns the value of attribute count.
-
#digest ⇒ Object
readonly
Returns the value of attribute digest.
-
#done ⇒ Object
(also: #done?)
Returns the value of attribute done.
-
#partition_begin ⇒ Object
readonly
Returns the value of attribute partition_begin.
-
#partitions ⇒ Object
Returns the value of attribute partitions.
Class Method Summary collapse
-
.all ⇒ Object
Creates a partition filter that reads all the partitions.
-
.by_id(partition_id) ⇒ Object
Creates a partition filter by partition id.
-
.by_key(key) ⇒ Object
Creates a partition filter that will return records after key’s digest in the partition containing the digest.
-
.by_range(partition_begin, count) ⇒ Object
Creates a partition filter by partition range.
Instance Method Summary collapse
Instance Attribute Details
#count ⇒ Object (readonly)
Returns the value of attribute count.
20 21 22 |
# File 'lib/aerospike/query/partition_filter.rb', line 20 def count @count end |
#digest ⇒ Object (readonly)
Returns the value of attribute digest.
20 21 22 |
# File 'lib/aerospike/query/partition_filter.rb', line 20 def digest @digest end |
#done ⇒ Object 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_begin ⇒ Object (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 |
#partitions ⇒ Object
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
.all ⇒ Object
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_s ⇒ Object
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 |