Package com.aerospike.client.operation
Class HLLOperation
java.lang.Object
com.aerospike.client.operation.HLLOperation
HyperLogLog (HLL) operations.
HyperLogLog operations on HLL items nested in lists/maps are not currently supported by the server.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic OperationCreate HLL add operation.static OperationCreate HLL add operation.static OperationCreate HLL add operation with minhash bits.static OperationCreate HLL describe operation.static OperationCreate HLL fold operation.static OperationCreate HLL getCount operation.static OperationgetIntersectCount(String binName, List<Value.HLLValue> list) Create HLL getIntersectCount operation.static OperationgetSimilarity(String binName, List<Value.HLLValue> list) Create HLL getSimilarity operation.static OperationgetUnion(String binName, List<Value.HLLValue> list) Create HLL getUnion operation.static OperationgetUnionCount(String binName, List<Value.HLLValue> list) Create HLL getUnionCount operation.static OperationCreate HLL init operation.static OperationCreate HLL init operation with minhash bits.static OperationrefreshCount(String binName) Create HLL refresh operation.static OperationsetUnion(HLLPolicy policy, String binName, List<Value.HLLValue> list) Create HLL set union operation.
-
Constructor Details
-
HLLOperation
public HLLOperation()
-
-
Method Details
-
init
Create HLL init operation. Server creates a new HLL or resets an existing HLL. Server does not return a value.- Parameters:
policy- write policy, useHLLPolicy.Defaultfor defaultbinName- name of binindexBitCount- number of index bits. Must be between 4 and 16 inclusive.
-
init
public static Operation init(HLLPolicy policy, String binName, int indexBitCount, int minHashBitCount) Create HLL init operation with minhash bits. Server creates a new HLL or resets an existing HLL. Server does not return a value.- Parameters:
policy- write policy, useHLLPolicy.Defaultfor defaultbinName- name of binindexBitCount- number of index bits. Must be between 4 and 16 inclusive.minHashBitCount- number of min hash bits. Must be between 4 and 51 inclusive. Also, indexBitCount + minHashBitCount must be <= 64.
-
add
Create HLL add operation. This operation assumes HLL bin already exists. Server adds values to the HLL set. Server returns number of entries that caused HLL to update a register.- Parameters:
policy- write policy, useHLLPolicy.Defaultfor defaultbinName- name of binlist- list of values to be added
-
add
Create HLL add operation. Server adds values to HLL set. If HLL bin does not exist, use indexBitCount to create HLL bin. Server returns number of entries that caused HLL to update a register.- Parameters:
policy- write policy, useHLLPolicy.Defaultfor defaultbinName- name of binlist- list of values to be addedindexBitCount- number of index bits. Must be between 4 and 16 inclusive.
-
add
public static Operation add(HLLPolicy policy, String binName, List<Value> list, int indexBitCount, int minHashBitCount) Create HLL add operation with minhash bits. Server adds values to HLL set. If HLL bin does not exist, use indexBitCount and minHashBitCount to create HLL bin. Server returns number of entries that caused HLL to update a register.- Parameters:
policy- write policy, useHLLPolicy.Defaultfor defaultbinName- name of binlist- list of values to be addedindexBitCount- number of index bits. Must be between 4 and 16 inclusive.minHashBitCount- number of min hash bits. Must be between 4 and 51 inclusive. Also, indexBitCount + minHashBitCount must be <= 64.
-
setUnion
Create HLL set union operation. Server sets union of specified HLL objects with HLL bin. Server does not return a value.- Parameters:
policy- write policy, useHLLPolicy.Defaultfor defaultbinName- name of binlist- list of HLL objects
-
refreshCount
Create HLL refresh operation. Server updates the cached count (if stale) and returns the count.- Parameters:
binName- name of bin
-
fold
Create HLL fold operation. Servers folds indexBitCount to the specified value. This can only be applied when minHashBitCount on the HLL bin is 0. Server does not return a value.- Parameters:
binName- name of binindexBitCount- number of index bits. Must be between 4 and 16 inclusive.
-
getCount
Create HLL getCount operation. Server returns estimated number of elements in the HLL bin.- Parameters:
binName- name of bin
-
getUnion
Create HLL getUnion operation. Server returns an HLL object that is the union of all specified HLL objects in the list with the HLL bin.- Parameters:
binName- name of binlist- list of HLL objects
-
getUnionCount
Create HLL getUnionCount operation. Server returns estimated number of elements that would be contained by the union of these HLL objects.- Parameters:
binName- name of binlist- list of HLL objects
-
getIntersectCount
Create HLL getIntersectCount operation. Bin contains an HLL value. List of HLL objects may have maximum 2 objects if minhash bits are 0, can have >2 objects otherwise. Server returns estimated number of elements that would be contained by the intersection of these HLL objects.- Parameters:
binName- name of binlist- list of HLL objects
-
getSimilarity
Create HLL getSimilarity operation. Bin contains an HLL value. List of HLL objects may have maximum 2 objects if minhash bits are 0, can have >2 objects otherwise. Server returns estimated similarity of these HLL objects. Return type is a double.- Parameters:
binName- name of binlist- list of HLL objects
-
describe
Create HLL describe operation. Server returns indexBitCount and minHashBitCount used to create HLL bin in a list of longs. The list size is 2.- Parameters:
binName- name of bin
-