Class ThetaSetOperationBuilder
java.lang.Object
org.apache.datasketches.theta.ThetaSetOperationBuilder
For building a new ThetaSetOperation.
- Author:
- Lee Rhodes
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor for building a new ThetaSetOperation. -
Method Summary
Modifier and TypeMethodDescriptionReturns a ThetaSetOperation with the current configuration of this Builder and the given Family.build(Family family, MemorySegment dstSeg) Returns a ThetaSetOperation with the current configuration of this Builder, the given Family and the given destination MemorySegment.Convenience method, returns a configured ThetaSetOperation ANotB with Default Update SeedConvenience method, returns a configured ThetaIntersection with Default Nominal EntriesbuildIntersection(MemorySegment dstSeg) Convenience method, returns a configured ThetaIntersection with Default Nominal Entries and the given destination MemorySegment.Convenience method, returns a configured ThetaSetOperation ThetaUnion with Default Nominal EntriesbuildUnion(MemorySegment dstSeg) Convenience method, returns a configured ThetaSetOperation ThetaUnion with Default Nominal Entries and the given destination MemorySegment.intReturns Log-base 2 Nominal EntriesfloatgetP()Returns the pre-sampling probability pReturns the Resize FactorlonggetSeed()Returns the seedsetLogNominalEntries(int lgNomEntries) Alternative method of setting the Nominal Entries for this set operation from the log_base2 value.setNominalEntries(int nomEntries) Sets the Maximum Nominal Entries (max K) for this set operation.setP(float p) Sets the upfront uniform sampling probability, p.Sets the cache Resize FactorsetSeed(long seed) Sets the long seed value that is require by the hashing function.toString()
-
Constructor Details
-
ThetaSetOperationBuilder
public ThetaSetOperationBuilder()Constructor for building a new ThetaSetOperation. The default configuration is- Max Nominal Entries (max K): 4096
- Seed: 9001L
ResizeFactor.X8- Input Sampling Probability: 1.0
- MemorySegment: null
-
-
Method Details
-
setNominalEntries
Sets the Maximum Nominal Entries (max K) for this set operation. The effective value of K of the result of a Set Operation can be less than max K, but never greater. The minimum value is 16 and the maximum value is 67,108,864, which is 2^26.- Parameters:
nomEntries- Nominal Entries This will become the ceiling power of 2 if it is not a power of 2.- Returns:
- this ThetaSetOperationBuilder
-
setLogNominalEntries
Alternative method of setting the Nominal Entries for this set operation from the log_base2 value. The minimum value is 4 and the maximum value is 26. Be aware that set operations as large as this maximum value may not have been thoroughly characterized for performance.- Parameters:
lgNomEntries- the log_base2 Nominal Entries.- Returns:
- this ThetaSetOperationBuilder
-
getLgNominalEntries
public int getLgNominalEntries()Returns Log-base 2 Nominal Entries- Returns:
- Log-base 2 Nominal Entries
-
setSeed
Sets the long seed value that is require by the hashing function.- Parameters:
seed- See seed- Returns:
- this ThetaSetOperationBuilder
-
getSeed
public long getSeed()Returns the seed- Returns:
- the seed
-
setP
Sets the upfront uniform sampling probability, p. Although this functionality is implemented for ThetaUnions only, it rarely makes sense to use it. The proper use of upfront sampling is when building the sketches.- Parameters:
p- See Sampling Probability, p- Returns:
- this ThetaSetOperationBuilder
-
getP
public float getP()Returns the pre-sampling probability p- Returns:
- the pre-sampling probability p
-
setResizeFactor
Sets the cache Resize Factor- Parameters:
rf- See Resize Factor- Returns:
- this ThetaSetOperationBuilder
-
getResizeFactor
-
build
Returns a ThetaSetOperation with the current configuration of this Builder and the given Family.- Parameters:
family- the chosen ThetaSetOperation family- Returns:
- a ThetaSetOperation
-
build
Returns a ThetaSetOperation with the current configuration of this Builder, the given Family and the given destination MemorySegment. Note that the destination MemorySegment cannot be used with ThetaAnotB.- Parameters:
family- the chosen ThetaSetOperation familydstSeg- The destination MemorySegment.- Returns:
- a ThetaSetOperation
-
buildUnion
Convenience method, returns a configured ThetaSetOperation ThetaUnion with Default Nominal Entries- Returns:
- a ThetaUnion object
-
buildUnion
Convenience method, returns a configured ThetaSetOperation ThetaUnion with Default Nominal Entries and the given destination MemorySegment.- Parameters:
dstSeg- The destination MemorySegment.- Returns:
- a ThetaUnion object
-
buildIntersection
Convenience method, returns a configured ThetaIntersection with Default Nominal Entries- Returns:
- a ThetaIntersection object
-
buildIntersection
Convenience method, returns a configured ThetaIntersection with Default Nominal Entries and the given destination MemorySegment.- Parameters:
dstSeg- The destination MemorySegment.- Returns:
- a ThetaIntersection object
-
buildANotB
Convenience method, returns a configured ThetaSetOperation ANotB with Default Update Seed- Returns:
- a ThetaANotB object
-
toString
-