aerospike_helpers — Aerospike Helper Package for bin operations (list, map, bit, etc.), and metrics

This package contains:

  • Helpers to be used by the operate and operate_ordered methods for bin operations. (list, map, bitwise, etc.)

  • Classes for metrics callbacks.

  • The HyperLogLog data type

class aerospike_helpers.HyperLogLog(o)

Bases: bytes

Represents a HyperLogLog value. This can be returned from or sent to the server.

from aerospike_helpers.operations import hll_operations
import aerospike

client = aerospike.client({'hosts': [('localhost', 3000)]})

BIN_NAME="hll"
ops = [
    hll_operations.hll_init(BIN_NAME, index_bit_count=4, mh_bit_count=4)
]
keyTuple = ("test", "demo", 1)
client.operate(keyTuple, ops)
_, _, bins = client.get(keyTuple)
print(bins[BIN_NAME])

client.put(keyTuple, bins)
_, _, bins = client.get(keyTuple)
print(bins[BIN_NAME])
HyperLogLog(...)
HyperLogLog(...)

Subpackages