public final class MemoryEstimator extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
static <T> int |
estimateMemory(AtomicLong stats,
DataType<T> dataType,
T data)
Estimates memory size of the data based on previous values.
|
static <T> int |
estimateMemory(AtomicLong stats,
DataType<T> dataType,
T[] storage,
int count)
Estimates memory size of the data set based on previous values.
|
static int |
samplingPct(AtomicLong stats)
Calculates percentage of how many times actual calculation happened (vs. estimation)
|
public static <T> int estimateMemory(AtomicLong stats, DataType<T> dataType, T data)
T - type of the datastats - AtomicLong holding statistical data about the estimated sequencedataType - used for calculation of the next sequence value, if necessarydata - which size is to be calculated as the next sequence value, if necessarypublic static <T> int estimateMemory(AtomicLong stats, DataType<T> dataType, T[] storage, int count)
T - type of the data in the storagestats - AtomicLong holding statistical data about the estimated sequencedataType - used for calculation of the next sequence value, if necessarystorage - of the data set, which size is to be calculatedcount - number of data items in the storagepublic static int samplingPct(AtomicLong stats)
stats - AtomicLong holding statistical data about the estimated sequenceCopyright © 2022. All rights reserved.