Class SketchFrequencies.Sketch<T>

java.lang.Object
org.apache.beam.sdk.extensions.sketching.SketchFrequencies.Sketch<T>
All Implemented Interfaces:
Serializable
Enclosing class:
SketchFrequencies

public abstract static class SketchFrequencies.Sketch<T> extends Object implements Serializable
Wrap StreamLib's Count-Min Sketch to support counting all user types by hashing the encoded user type using the supplied deterministic coder. This is required since objects in Apache Beam are considered equal if their encodings are equal.
See Also:
  • Constructor Details

    • Sketch

      public Sketch()
  • Method Details

    • add

      public void add(T element, long count, Coder<T> coder)
    • add

      public void add(T element, Coder<T> coder)
    • estimateCount

      public long estimateCount(T element, Coder<T> coder)
      Utility class to retrieve the estimate frequency of an element from a CountMinSketch.