Class HLLOperation

java.lang.Object
com.aerospike.client.operation.HLLOperation

public final class HLLOperation extends Object
HyperLogLog (HLL) operations.

HyperLogLog operations on HLL items nested in lists/maps are not currently supported by the server.

  • Constructor Details

    • HLLOperation

      public HLLOperation()
  • Method Details

    • init

      public static Operation init(HLLPolicy policy, String binName, int indexBitCount)
      Create HLL init operation. Server creates a new HLL or resets an existing HLL. Server does not return a value.
      Parameters:
      policy - write policy, use HLLPolicy.Default for default
      binName - name of bin
      indexBitCount - 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, use HLLPolicy.Default for default
      binName - name of bin
      indexBitCount - 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

      public static Operation add(HLLPolicy policy, String binName, List<Value> list)
      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, use HLLPolicy.Default for default
      binName - name of bin
      list - list of values to be added
    • add

      public static Operation add(HLLPolicy policy, String binName, List<Value> list, int indexBitCount)
      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, use HLLPolicy.Default for default
      binName - name of bin
      list - list of values to be added
      indexBitCount - 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, use HLLPolicy.Default for default
      binName - name of bin
      list - list of values to be added
      indexBitCount - 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

      public static Operation setUnion(HLLPolicy policy, String binName, List<Value.HLLValue> list)
      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, use HLLPolicy.Default for default
      binName - name of bin
      list - list of HLL objects
    • refreshCount

      public static Operation refreshCount(String binName)
      Create HLL refresh operation. Server updates the cached count (if stale) and returns the count.
      Parameters:
      binName - name of bin
    • fold

      public static Operation fold(String binName, int indexBitCount)
      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 bin
      indexBitCount - number of index bits. Must be between 4 and 16 inclusive.
    • getCount

      public static Operation getCount(String binName)
      Create HLL getCount operation. Server returns estimated number of elements in the HLL bin.
      Parameters:
      binName - name of bin
    • getUnion

      public static Operation getUnion(String binName, List<Value.HLLValue> list)
      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 bin
      list - list of HLL objects
    • getUnionCount

      public static Operation getUnionCount(String binName, List<Value.HLLValue> list)
      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 bin
      list - list of HLL objects
    • getIntersectCount

      public static Operation getIntersectCount(String binName, List<Value.HLLValue> list)
      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 bin
      list - list of HLL objects
    • getSimilarity

      public static Operation getSimilarity(String binName, List<Value.HLLValue> list)
      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 bin
      list - list of HLL objects
    • describe

      public static Operation describe(String binName)
      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