Class: Aerospike::HLLValue
Overview
HLLValue value. Encapsulates a HyperLogLog value. Supported by Aerospike server version 4.9 and later.
Instance Method Summary collapse
- #estimate_size ⇒ Object
- #get ⇒ Object
-
#initialize(value) ⇒ HLLValue
constructor
:nodoc:.
- #pack(packer) ⇒ Object
- #to_bytes ⇒ Object
- #to_s ⇒ Object
- #type ⇒ Object
- #write(buffer, offset) ⇒ Object
Methods inherited from Value
Constructor Details
#initialize(value) ⇒ HLLValue
:nodoc:
547 548 549 550 551 552 |
# File 'lib/aerospike/value/value.rb', line 547 def initialize(value) @bytes = value @bytes.force_encoding('binary') self end |
Instance Method Details
#estimate_size ⇒ Object
570 571 572 |
# File 'lib/aerospike/value/value.rb', line 570 def estimate_size @bytes.bytesize end |
#get ⇒ Object
558 559 560 |
# File 'lib/aerospike/value/value.rb', line 558 def get self end |
#pack(packer) ⇒ Object
578 579 580 |
# File 'lib/aerospike/value/value.rb', line 578 def pack(packer) packer.write(Aerospike::ParticleType::BLOB.chr + @bytes) end |
#to_bytes ⇒ Object
566 567 568 |
# File 'lib/aerospike/value/value.rb', line 566 def to_bytes @bytes end |
#to_s ⇒ Object
562 563 564 |
# File 'lib/aerospike/value/value.rb', line 562 def to_s @bytes.to_s end |
#type ⇒ Object
554 555 556 |
# File 'lib/aerospike/value/value.rb', line 554 def type Aerospike::ParticleType::HLL end |
#write(buffer, offset) ⇒ Object
574 575 576 |
# File 'lib/aerospike/value/value.rb', line 574 def write(buffer, offset) buffer.write_binary(@bytes, offset) end |