| Modifier and Type | Field and Description |
|---|---|
| pack-priv int | |
| pack-priv static final long | |
| pack-priv static final long | |
| pack-priv int | |
| pack-priv int | |
| pack-priv long[] |
| Access | Constructor and Description |
|---|---|
| public | FrequencySketch()
Creates a lazily initialized frequency sketch, requiring |
| Modifier and Type | Method and Description |
|---|---|
| public void | ensureCapacity(@NonNegative long
the maximum size of the cache maximumSize)Initializes and increases the capacity of this FrequencySketch instance, if necessary, to ensure that it can accurately estimate the popularity of elements given the maximum size of the cache. |
| public @NonNegative int | Returns: the estimated number of occurrences of the element; possibly zero but never negativethe element to count occurrences of e)Returns the estimated number of occurrences of an element, up to the maximum (15). |
| public void | increment(E
the element to add e)Increments the popularity of the element if it does not exceed the maximum (15). |
| pack-priv boolean | Returns: if incrementedthe table index (16 counters) i, int the counter to increment j)Increments the specified counter by 1 if it is not already at the maximum value (15). |
| public boolean | isNotInitialized()
Returns if the sketch has not yet been initialized, requiring that |
| pack-priv static int | |
| pack-priv void | |
| pack-priv static int |
| blockMask | back to summary |
|---|---|
| pack-priv int blockMask | |
| ONE_MASK | back to summary |
|---|---|
| pack-priv static final long ONE_MASK | |
| RESET_MASK | back to summary |
|---|---|
| pack-priv static final long RESET_MASK | |
| sampleSize | back to summary |
|---|---|
| pack-priv int sampleSize | |
| size | back to summary |
|---|---|
| pack-priv int size | |
| table | back to summary |
|---|---|
| pack-priv long[] table | |
| FrequencySketch | back to summary |
|---|---|
| public FrequencySketch() Creates a lazily initialized frequency sketch, requiring
| |
| ensureCapacity | back to summary |
|---|---|
| public void ensureCapacity(@NonNegative long maximumSize) Initializes and increases the capacity of this FrequencySketch instance, if necessary, to ensure that it can accurately estimate the popularity of elements given the maximum size of the cache. This operation forgets all previous counts when resizing.
| |
| frequency | back to summary |
|---|---|
| public @NonNegative int frequency(E e) Returns the estimated number of occurrences of an element, up to the maximum (15).
| |
| increment | back to summary |
|---|---|
| public void increment(E e) Increments the popularity of the element if it does not exceed the maximum (15). The popularity of all elements will be periodically down sampled when the observed events exceed a threshold. This process provides a frequency aging to allow expired long term entries to fade away.
| |
| incrementAt | back to summary |
|---|---|
| pack-priv boolean incrementAt(int i, int j) Increments the specified counter by 1 if it is not already at the maximum value (15).
| |
| isNotInitialized | back to summary |
|---|---|
| public boolean isNotInitialized() Returns if the sketch has not yet been initialized, requiring that | |
| rehash | back to summary |
|---|---|
| pack-priv static int rehash(int x) Applies another round of hashing for additional randomization. | |
| reset | back to summary |
|---|---|
| pack-priv void reset() Reduces every counter by half of its original value. | |
| spread | back to summary |
|---|---|
| pack-priv static int spread(int x) Applies a supplemental hash functions to defends against poor quality hash. | |