public final class MemoryEstimator
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static <T> int |
estimateMemory(java.util.concurrent.atomic.AtomicLong stats,
DataType<T> dataType,
T data)
Estimates memory size of the data based on previous values.
|
static <T> int |
estimateMemory(java.util.concurrent.atomic.AtomicLong stats,
DataType<T> dataType,
T[] storage,
int count)
Estimates memory size of the data set based on previous values.
|
static int |
samplingPct(java.util.concurrent.atomic.AtomicLong stats)
Calculates percentage of how many times actual calculation happened (vs.
|
public static <T> int estimateMemory(java.util.concurrent.atomic.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(java.util.concurrent.atomic.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(java.util.concurrent.atomic.AtomicLong stats)
stats - AtomicLong holding statistical data about the estimated sequence