public final class ThetaUtil extends Object
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_NOMINAL_ENTRIES
The default nominal entries is provided as a convenience for those cases where the
nominal sketch size in number of entries is not provided.
|
static long |
DEFAULT_UPDATE_SEED
The seed 9001 used in the sketch update methods is a prime number that
was chosen very early on in experimental testing.
|
static int |
MAX_LG_NOM_LONGS
The largest Log2 nom entries allowed: 26.
|
static int |
MIN_LG_ARR_LONGS
The smallest Log2 cache size allowed: 5.
|
static int |
MIN_LG_NOM_LONGS
The smallest Log2 nom entries allowed: 4.
|
static double |
REBUILD_THRESHOLD
The hash table rebuild threshold = 15.0/16.0.
|
static double |
RESIZE_THRESHOLD
The resize threshold = 0.5; tuned for speed.
|
Modifier and Type | Method and Description |
---|---|
static int |
checkNomLongs(int nomLongs)
Checks that the given nomLongs is within bounds and returns the Log2 of the ceiling power of 2
of the given nomLongs.
|
static short |
checkSeedHashes(short seedHashA,
short seedHashB)
Check if the two seed hashes are equal.
|
static short |
computeSeedHash(long seed)
Computes and checks the 16-bit seed hash from the given long seed.
|
static int |
startingSubMultiple(int lgTarget,
int lgRF,
int lgMin)
Gets the smallest allowed exponent of 2 that it is a sub-multiple of the target by zero,
one or more resize factors.
|
public static final int MIN_LG_NOM_LONGS
public static final int MAX_LG_NOM_LONGS
public static final double REBUILD_THRESHOLD
public static final double RESIZE_THRESHOLD
public static final int DEFAULT_NOMINAL_ENTRIES
public static final long DEFAULT_UPDATE_SEED
In order to perform set operations on two sketches it is critical that the same hash function and seed are identical for both sketches, otherwise the assumed 1:1 relationship between the original source key value and the hashed bit string would be violated. Once you have developed a history of stored sketches you are stuck with it.
WARNING: This seed is used internally by library sketches in different packages and thus must be declared public. However, this seed value must not be used by library users with the MurmurHash3 function. It should be viewed as existing for exclusive, private use by the library.
public static final int MIN_LG_ARR_LONGS
public static short checkSeedHashes(short seedHashA, short seedHashB)
seedHashA
- the seedHash AseedHashB
- the seedHash Bpublic static short computeSeedHash(long seed)
seed
- See Update Hash Seedpublic static int startingSubMultiple(int lgTarget, int lgRF, int lgMin)
lgTarget
- Log2 of the target sizelgRF
- Log_base2 of Resize Factor.
See Resize FactorlgMin
- Log2 of the minimum allowed starting sizepublic static int checkNomLongs(int nomLongs)
nomLongs
- the given number of nominal longs. This can be any value from 16 to
67108864, inclusive.Copyright © 2015–2024 The Apache Software Foundation. All rights reserved.