Class UpdatableTupleSketchBuilder<U, S extends UpdatableSummary<U>>

java.lang.Object
org.apache.datasketches.tuple.UpdatableTupleSketchBuilder<U,S>
Type Parameters:
U - Type of update value
S - Type of Summary

public class UpdatableTupleSketchBuilder<U, S extends UpdatableSummary<U>> extends Object
For building a new generic tuple UpdatableTupleSketch
  • Constructor Details

    • UpdatableTupleSketchBuilder

      public UpdatableTupleSketchBuilder(SummaryFactory<S> summaryFactory)
      Creates an instance of UpdatableTupleSketchBuilder with default parameters
      Parameters:
      summaryFactory - An instance of SummaryFactory.
  • Method Details

    • setNominalEntries

      public UpdatableTupleSketchBuilder<U,S> setNominalEntries(int nomEntries)
      This is to set the nominal number of entries.
      Parameters:
      nomEntries - Nominal number of entries. Forced to the nearest power of 2 greater than or equal to the given value.
      Returns:
      this UpdatableTupleSketchBuilder
    • setResizeFactor

      public UpdatableTupleSketchBuilder<U,S> setResizeFactor(ResizeFactor resizeFactor)
      This is to set the resize factor. Value of X1 means that the maximum capacity is allocated from the start. Default resize factor is X8.
      Parameters:
      resizeFactor - value of X1, X2, X4 or X8
      Returns:
      this UpdatableTupleSketchBuilder
    • setSamplingProbability

      public UpdatableTupleSketchBuilder<U,S> setSamplingProbability(float samplingProbability)
      This is to set sampling probability. Default probability is 1.
      Parameters:
      samplingProbability - sampling probability from 0 to 1
      Returns:
      this UpdatableTupleSketchBuilder
    • build

      public UpdatableTupleSketch<U,S> build()
      Returns an UpdatableTupleSketch with the current configuration of this Builder.
      Returns:
      an UpdatableTupleSketch
    • reset

      public void reset()
      Resets the Nominal Entries, Resize Factor and Sampling Probability to their default values. The assignment of U and S remain the same.