@Test public void reset() { boolean reset = false; FrequencySketch sketch = makeSketch(64); try { for (int i = 1; i < 20 * sketch.tableLength; i++) { sketch.increment(i); if (sketch.size != i) { reset = true; break; } } assertThat(reset, is(true)); assertThat(sketch.size, lessThanOrEqualTo(sketch.sampleSize / 2)); } finally { sketch.release(); } }
private void reset() { int count = 0; for (int i = 0; i < tableLength; i++) { long t = tableAt(i); count += Long.bitCount(t & ONE_MASK); tableAt(i, (t >>> 1) & RESET_MASK); } size = (size >>> 1) - (count >>> 2); }
FrequencySketch { private void reset() { int count = 0; for (int i = 0; i < tableLength; i++) { long t = tableAt(i); count += Long.bitCount(t & ONE_MASK); tableAt(i, (t >>> 1) & RESET_MASK); } size = (size >>> 1) - (count >>> 2); } }
FrequencySketch { private void reset() { int count = 0; for (int i = 0; i < tableLength; i++) { long t = tableAt(i); count += Long.bitCount(t & ONE_MASK); tableAt(i, (t >>> 1) & RESET_MASK); } size = (size >>> 1) - (count >>> 2); } FrequencySketch(long maximumSize); }
FrequencySketch { private void reset() { int count = 0; for (int i = 0; i < tableLength; i++) { long t = tableAt(i); count += Long.bitCount(t & ONE_MASK); tableAt(i, (t >>> 1) & RESET_MASK); } size = (size >>> 1) - (count >>> 2); } FrequencySketch(long maximumSize);  }
FrequencySketch { private void reset() { int count = 0; for (int i = 0; i < tableLength; i++) { long t = tableAt(i); count += Long.bitCount(t & ONE_MASK); tableAt(i, (t >>> 1) & RESET_MASK); } size = (size >>> 1) - (count >>> 2); } FrequencySketch(long maximumSize);   }