public class UpdateSketchBuilder extends Object
Constructor and Description |
---|
UpdateSketchBuilder()
Constructor for building a new UpdateSketch.
|
Modifier and Type | Method and Description |
---|---|
UpdateSketch |
build()
Returns an UpdateSketch with the current configuration of this Builder.
|
UpdateSketch |
build(org.apache.datasketches.memory.WritableMemory dstMem)
Returns an UpdateSketch with the current configuration of this Builder
with the specified backing destination Memory store.
|
UpdateSketch |
buildLocal(UpdateSketch shared)
Returns a local, on-heap, concurrent UpdateSketch to be used as a per-thread local buffer
along with the given concurrent shared UpdateSketch and the current configuration of this
Builder.
|
UpdateSketch |
buildShared()
Returns an on-heap concurrent shared UpdateSketch with the current configuration of the
Builder.
|
UpdateSketch |
buildShared(org.apache.datasketches.memory.WritableMemory dstMem)
Returns a direct (potentially off-heap) concurrent shared UpdateSketch with the current
configuration of the Builder and the given destination WritableMemory.
|
UpdateSketch |
buildSharedFromSketch(UpdateSketch sketch,
org.apache.datasketches.memory.WritableMemory dstMem)
Returns a direct (potentially off-heap) concurrent shared UpdateSketch with the current
configuration of the Builder, the data from the given sketch, and the given destination
WritableMemory.
|
Family |
getFamily()
Returns the Family
|
int |
getLgNominalEntries()
Returns Log-base 2 Nominal Entries
|
int |
getLocalLgNominalEntries()
Returns Log-base 2 Nominal Entries for the concurrent local sketch
|
double |
getMaxConcurrencyError()
Gets the Maximum Concurrency Error
|
int |
getMaxNumLocalThreads()
Gets the Maximum Number of Local Threads.
|
org.apache.datasketches.memory.MemoryRequestServer |
getMemoryRequestServer()
Returns the MemoryRequestServer
|
int |
getNumPoolThreads()
Gets the number of background pool threads used for propagation in the concurrent sketches.
|
float |
getP()
Returns the pre-sampling probability p
|
boolean |
getPropagateOrderedCompact()
Gets the Propagate Ordered Compact flag used with concurrent sketches.
|
ResizeFactor |
getResizeFactor()
Returns the Resize Factor
|
long |
getSeed()
Returns the seed
|
UpdateSketchBuilder |
setFamily(Family family)
Set the Family.
|
UpdateSketchBuilder |
setLocalLogNominalEntries(int lgNomEntries)
Alternative method of setting the Nominal Entries for a local concurrent sketch from the
log_base2 value.
|
UpdateSketchBuilder |
setLocalNominalEntries(int nomEntries)
Sets the Nominal Entries for the concurrent local sketch.
|
UpdateSketchBuilder |
setLogNominalEntries(int lgNomEntries)
Alternative method of setting the Nominal Entries for this sketch from the log_base2 value.
|
void |
setMaxConcurrencyError(double maxConcurrencyError)
Sets the Maximum Concurrency Error.
|
void |
setMaxNumLocalThreads(int maxNumLocalThreads)
Sets the Maximum Number of Local Threads.
|
UpdateSketchBuilder |
setMemoryRequestServer(org.apache.datasketches.memory.MemoryRequestServer memReqSvr)
Set the MemoryRequestServer
|
UpdateSketchBuilder |
setNominalEntries(int nomEntries)
Sets the Nominal Entries for this sketch.
|
void |
setNumPoolThreads(int numPoolThreads)
Sets the number of pool threads used for background propagation in the concurrent sketches.
|
UpdateSketchBuilder |
setP(float p)
Sets the upfront uniform sampling probability, p
|
UpdateSketchBuilder |
setPropagateOrderedCompact(boolean prop)
Sets the Propagate Ordered Compact flag to the given value.
|
UpdateSketchBuilder |
setResizeFactor(ResizeFactor rf)
Sets the cache Resize Factor.
|
UpdateSketchBuilder |
setSeed(long seed)
Sets the long seed value that is required by the hashing function.
|
String |
toString() |
public UpdateSketchBuilder()
Family.QUICKSELECT
ResizeFactor.X8
.
For direct sketches, which are targeted for native memory off the Java heap, this value will
be fixed at either ResizeFactor.X1
or ResizeFactor.X2
.DefaultMemoryRequestServer
.public UpdateSketchBuilder setNominalEntries(int nomEntries)
nomEntries
- Nominal Entries
This will become the ceiling power of 2 if the given value is not.public UpdateSketchBuilder setLogNominalEntries(int lgNomEntries)
lgNomEntries
- the Log Nominal Entries. Also for the concurrent shared sketchpublic int getLgNominalEntries()
public UpdateSketchBuilder setLocalNominalEntries(int nomEntries)
nomEntries
- Nominal Entries
This will become the ceiling power of 2 if it is not.public UpdateSketchBuilder setLocalLogNominalEntries(int lgNomEntries)
lgNomEntries
- the Log Nominal Entries for a concurrent local sketchpublic int getLocalLgNominalEntries()
public UpdateSketchBuilder setSeed(long seed)
seed
- See seedpublic long getSeed()
public UpdateSketchBuilder setP(float p)
p
- See Sampling Probability, ppublic float getP()
public UpdateSketchBuilder setResizeFactor(ResizeFactor rf)
rf
- See Resize Factorpublic ResizeFactor getResizeFactor()
public UpdateSketchBuilder setFamily(Family family)
family
- the family for this builderpublic Family getFamily()
public UpdateSketchBuilder setMemoryRequestServer(org.apache.datasketches.memory.MemoryRequestServer memReqSvr)
memReqSvr
- the given MemoryRequestServerpublic org.apache.datasketches.memory.MemoryRequestServer getMemoryRequestServer()
public void setNumPoolThreads(int numPoolThreads)
numPoolThreads
- the given number of pool threadspublic int getNumPoolThreads()
public UpdateSketchBuilder setPropagateOrderedCompact(boolean prop)
prop
- the given valuepublic boolean getPropagateOrderedCompact()
public void setMaxConcurrencyError(double maxConcurrencyError)
maxConcurrencyError
- the given Maximum Concurrency Error.public double getMaxConcurrencyError()
public void setMaxNumLocalThreads(int maxNumLocalThreads)
maxNumLocalThreads
- the given Maximum Number of Local Threadspublic int getMaxNumLocalThreads()
public UpdateSketch build()
public UpdateSketch build(org.apache.datasketches.memory.WritableMemory dstMem)
dstMem
- The destination Memory.public UpdateSketch buildShared()
The parameters unique to the shared concurrent sketch are:
Key parameters that are in common with other Theta sketches:
public UpdateSketch buildShared(org.apache.datasketches.memory.WritableMemory dstMem)
The parameters unique to the shared concurrent sketch are:
Key parameters that are in common with other Theta sketches:
dstMem
- the given WritableMemory for Direct, otherwise null.public UpdateSketch buildSharedFromSketch(UpdateSketch sketch, org.apache.datasketches.memory.WritableMemory dstMem)
The parameters unique to the shared concurrent sketch are:
Key parameters that are in common with other Theta sketches:
sketch
- a given UpdateSketch from which the data is used to initialize the returned
shared sketch.dstMem
- the given WritableMemory for Direct, otherwise null.public UpdateSketch buildLocal(UpdateSketch shared)
The parameters unique to the local concurrent sketch are:
shared
- the concurrent shared sketch to be accessed via the concurrent local sketch.Copyright © 2015–2021 The Apache Software Foundation. All rights reserved.