pub struct HyperLogLogPlusPlusBuilder { /* private fields */ }Implementations§
Source§impl HyperLogLogPlusPlusBuilder
impl HyperLogLogPlusPlusBuilder
Sourcepub fn normal_precision(self, normal_precision: i32) -> Self
pub fn normal_precision(self, normal_precision: i32) -> Self
Sets the normal precision to be used. Must be in the range from HyperLogLogPlusPlus::MINIMUM_PRECISION
to HyperLogLogPlusPlus::MAXIMUM_PRECISION (inclusive).
The precision defines the accuracy of the HLL++ aggregator at the cost of the memory used.
The upper bound on the memory required is 2precision bytes, but less memory is
used for smaller cardinalities (up to ~2precision - 2). The relative error is 1.04
/ sqrt(2precision). If not specified, HyperLogLogPlusPlus::DEFAULT_NORMAL_PRECISION` is used,
which gives an error of about 0.6% while requiring an upper bound of 32 nbsp;KiB of memory.
Sourcepub fn sparse_precision(self, sparse_precision: i32) -> Self
pub fn sparse_precision(self, sparse_precision: i32) -> Self
Sets the sparse precision to be used. Must be in the range from the HyperLogLogPlusPlusBuilder::normal_precision
to HyperLogLogPlusPlus::MAXIMUM_SPARSE_PRECISION (inclusive), or HyperLogLogPlusPlus::SPARSE_PRECISION_DISABLED
to disable the use of the sparse representation. We recommend to use HyperLogLogPlusPlusBuilder::no_sparse_mode
for the latter, though.
If not specified, the normal precision + HyperLogLogPlusPlus::DEFAULT_SPARSE_PRECISION_DELTA is used.
Sourcepub fn no_sparse_mode(self) -> Self
pub fn no_sparse_mode(self) -> Self
Disable the “sparse representation” mode; i.e., the normal representation, where all
registers are explicitly stored, and its method to compute the COUNT DISTINCT estimate
are used from the start of the aggregation.
Sourcepub fn build_for_bytes(self) -> Result<HyperLogLogPlusPlus, SketchError>
pub fn build_for_bytes(self) -> Result<HyperLogLogPlusPlus, SketchError>
Returns a new HLL++ aggregator for counting the number of unique byte arrays in a stream.
Sourcepub fn build_for_string(self) -> Result<HyperLogLogPlusPlus, SketchError>
pub fn build_for_string(self) -> Result<HyperLogLogPlusPlus, SketchError>
Returns a new HLL++ aggregator for counting the number of unique strings in a stream.
Sourcepub fn build_for_u32(self) -> Result<HyperLogLogPlusPlus, SketchError>
pub fn build_for_u32(self) -> Result<HyperLogLogPlusPlus, SketchError>
Returns a new HLL++ aggregator for counting the number of unique 32-bit integers in a stream.
Sourcepub fn build_for_u64(self) -> Result<HyperLogLogPlusPlus, SketchError>
pub fn build_for_u64(self) -> Result<HyperLogLogPlusPlus, SketchError>
Returns a new HLL++ aggregator for counting the number of unique 64-bit integers in a stream.
Trait Implementations§
Source§impl Clone for HyperLogLogPlusPlusBuilder
impl Clone for HyperLogLogPlusPlusBuilder
Source§fn clone(&self) -> HyperLogLogPlusPlusBuilder
fn clone(&self) -> HyperLogLogPlusPlusBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for HyperLogLogPlusPlusBuilder
impl RefUnwindSafe for HyperLogLogPlusPlusBuilder
impl Send for HyperLogLogPlusPlusBuilder
impl Sync for HyperLogLogPlusPlusBuilder
impl Unpin for HyperLogLogPlusPlusBuilder
impl UnwindSafe for HyperLogLogPlusPlusBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more