Class SketchFrequencies.Sketch<T>

  • All Implemented Interfaces:
    java.io.Serializable
    Enclosing class:
    SketchFrequencies

    public abstract static class SketchFrequencies.Sketch<T>
    extends java.lang.Object
    implements java.io.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:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      Sketch()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(T element, long count, org.apache.beam.sdk.coders.Coder<T> coder)  
      void add​(T element, org.apache.beam.sdk.coders.Coder<T> coder)  
      long estimateCount​(T element, org.apache.beam.sdk.coders.Coder<T> coder)
      Utility class to retrieve the estimate frequency of an element from a CountMinSketch.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Sketch

        public Sketch()
    • Method Detail

      • add

        public void add​(T element,
                        long count,
                        org.apache.beam.sdk.coders.Coder<T> coder)
      • add

        public void add​(T element,
                        org.apache.beam.sdk.coders.Coder<T> coder)
      • estimateCount

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