Class ApproximateUnique.ApproximateUniqueCombineFn.LargestUnique

java.lang.Object
org.apache.beam.sdk.transforms.ApproximateUnique.ApproximateUniqueCombineFn.LargestUnique
All Implemented Interfaces:
Serializable
Enclosing class:
ApproximateUnique.ApproximateUniqueCombineFn<T>

public static class ApproximateUnique.ApproximateUniqueCombineFn.LargestUnique extends Object implements Serializable
A heap utility class to efficiently track the largest added elements.
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    LargestUnique(long sampleSize)
    Creates a heap to track the largest sampleSize elements.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    add(long value)
    Adds a value to the heap, returning whether the value is (large enough to be) in the heap.
    boolean
     
    int
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • LargestUnique

      public LargestUnique(long sampleSize)
      Creates a heap to track the largest sampleSize elements.
      Parameters:
      sampleSize - the size of the heap
  • Method Details

    • add

      public boolean add(long value)
      Adds a value to the heap, returning whether the value is (large enough to be) in the heap.
    • equals

      public boolean equals(@Nullable Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object