Class UpdatableTupleSketchBuilder<U, S extends UpdatableSummary<U>>
java.lang.Object
org.apache.datasketches.tuple.UpdatableTupleSketchBuilder<U,S>
- Type Parameters:
U- Type of update valueS- Type of Summary
For building a new generic tuple UpdatableTupleSketch
-
Constructor Summary
ConstructorsConstructorDescriptionUpdatableTupleSketchBuilder(SummaryFactory<S> summaryFactory) Creates an instance of UpdatableTupleSketchBuilder with default parameters -
Method Summary
Modifier and TypeMethodDescriptionbuild()Returns an UpdatableTupleSketch with the current configuration of this Builder.voidreset()Resets the Nominal Entries, Resize Factor and Sampling Probability to their default values.setNominalEntries(int nomEntries) This is to set the nominal number of entries.setResizeFactor(ResizeFactor resizeFactor) This is to set the resize factor.setSamplingProbability(float samplingProbability) This is to set sampling probability.
-
Constructor Details
-
UpdatableTupleSketchBuilder
Creates an instance of UpdatableTupleSketchBuilder with default parameters- Parameters:
summaryFactory- An instance of SummaryFactory.
-
-
Method Details
-
setNominalEntries
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
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
This is to set sampling probability. Default probability is 1.- Parameters:
samplingProbability- sampling probability from 0 to 1- Returns:
- this UpdatableTupleSketchBuilder
-
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.
-