Class: Aerospike::HLLValue
Overview
HLLValue value. Encapsulates a HyperLogLog value. Supported by Aerospike server version 4.9 and later.
Instance Attribute Summary collapse
-
#bytes ⇒ Object
readonly
:nodoc:.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #estimate_size ⇒ Object
- #get ⇒ Object
-
#initialize(value) ⇒ HLLValue
constructor
A new instance of HLLValue.
- #pack(packer) ⇒ Object
- #to_bytes ⇒ Object
- #to_s ⇒ Object
- #type ⇒ Object
- #write(buffer, offset) ⇒ Object
Methods inherited from Value
Constructor Details
#initialize(value) ⇒ HLLValue
Returns a new instance of HLLValue.
530 531 532 533 534 535 |
# File 'lib/aerospike/value/value.rb', line 530 def initialize(value) @bytes = value @bytes.force_encoding("binary") self end |
Instance Attribute Details
#bytes ⇒ Object (readonly)
:nodoc:
528 529 530 |
# File 'lib/aerospike/value/value.rb', line 528 def bytes @bytes end |
Instance Method Details
#==(other) ⇒ Object
537 538 539 |
# File 'lib/aerospike/value/value.rb', line 537 def ==(other) @bytes.to_s == other.to_s end |
#estimate_size ⇒ Object
557 558 559 |
# File 'lib/aerospike/value/value.rb', line 557 def estimate_size @bytes.bytesize end |
#get ⇒ Object
545 546 547 |
# File 'lib/aerospike/value/value.rb', line 545 def get self end |
#pack(packer) ⇒ Object
565 566 567 |
# File 'lib/aerospike/value/value.rb', line 565 def pack(packer) packer.write(Aerospike::ParticleType::BLOB.chr + @bytes) end |
#to_bytes ⇒ Object
553 554 555 |
# File 'lib/aerospike/value/value.rb', line 553 def to_bytes @bytes end |
#to_s ⇒ Object
549 550 551 |
# File 'lib/aerospike/value/value.rb', line 549 def to_s @bytes.to_s end |
#type ⇒ Object
541 542 543 |
# File 'lib/aerospike/value/value.rb', line 541 def type Aerospike::ParticleType::HLL end |
#write(buffer, offset) ⇒ Object
561 562 563 |
# File 'lib/aerospike/value/value.rb', line 561 def write(buffer, offset) buffer.write_binary(@bytes, offset) end |