Interface CountMinSketchAgent

All Known Implementing Classes:
CountMinSketchAgentStringUTF16

public interface CountMinSketchAgent
For use with Count-min sketch aggregation functions: The agent implementation encapsulates transformation of value objects to byte-array and back (when needed), and may override or provide custom behavior.
  • Method Details

    • add

      Add a value to the Count-min sketch. Implementations typically check for null value, convert the value object to a byte-array and invoke a method on the state object to add the byte-array value.
      Parameters:
      ctx - contains value to add as well as the state
    • estimate

      Return the estimated count for a given value. Implementations typically check for null value, convert the value object to a byte-array and invoke a method on the state object to retrieve a count.
      Parameters:
      ctx - contains value to query as well as the state
      Returns:
      estimated count
    • fromBytes

      Return the value object for a given byte-array, for use with top-K. Implementations typically simply convert a byte-array into a value object.
      Parameters:
      ctx - value object and state
      Returns:
      value object