Package org.apache.datasketches.tuple
Class UpdatableSketchBuilder<U,S extends UpdatableSummary<U>>
java.lang.Object
org.apache.datasketches.tuple.UpdatableSketchBuilder<U,S>
- Type Parameters:
U
- Type of update valueS
- Type of Summary
For building a new generic tuple UpdatableSketch
-
Constructor Summary
ConstructorDescriptionUpdatableSketchBuilder
(SummaryFactory<S> summaryFactory) Creates an instance of UpdatableSketchBuilder with default parameters -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Returns an UpdatableSketch with the current configuration of this Builder.void
reset()
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
-
UpdatableSketchBuilder
Creates an instance of UpdatableSketchBuilder 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 UpdatableSketchBuilder
-
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 UpdatableSketchBuilder
-
setSamplingProbability
This is to set sampling probability. Default probability is 1.- Parameters:
samplingProbability
- sampling probability from 0 to 1- Returns:
- this UpdatableSketchBuilder
-
build
Returns an UpdatableSketch with the current configuration of this Builder.- Returns:
- an UpdatableSketch
-
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.
-