@Override public void addBinary(byte[] item, long count) { if (count < 0) { throw new IllegalArgumentException("Negative increments not implemented"); } int[] buckets = getHashBuckets(item, depth, width); for (int i = 0; i < depth; ++i) { table[i][buckets[i]] += count; } totalCount += count; }
@Override public void addBinary(byte[] item, long count) { if (count < 0) { throw new IllegalArgumentException("Negative increments not implemented"); } int[] buckets = getHashBuckets(item, depth, width); for (int i = 0; i < depth; ++i) { table[i][buckets[i]] += count; } totalCount += count; }
private long estimateCountForStringItem(String item) { long res = Long.MAX_VALUE; int[] buckets = getHashBuckets(item, depth, width); for (int i = 0; i < depth; ++i) { res = Math.min(res, table[i][buckets[i]]); } return res; }
private long estimateCountForStringItem(String item) { long res = Long.MAX_VALUE; int[] buckets = getHashBuckets(item, depth, width); for (int i = 0; i < depth; ++i) { res = Math.min(res, table[i][buckets[i]]); } return res; }
private long estimateCountForStringItem(String item) { long res = Long.MAX_VALUE; int[] buckets = getHashBuckets(item, depth, width); for (int i = 0; i < depth; ++i) { res = Math.min(res, table[i][buckets[i]]); } return res; }
private long estimateCountForStringItem(String item) { long res = Long.MAX_VALUE; int[] buckets = getHashBuckets(item, depth, width); for (int i = 0; i < depth; ++i) { res = Math.min(res, table[i][buckets[i]]); } return res; }
private long estimateCountForBinaryItem(byte[] item) { long res = Long.MAX_VALUE; int[] buckets = getHashBuckets(item, depth, width); for (int i = 0; i < depth; ++i) { res = Math.min(res, table[i][buckets[i]]); } return res; }
private long estimateCountForBinaryItem(byte[] item) { long res = Long.MAX_VALUE; int[] buckets = getHashBuckets(item, depth, width); for (int i = 0; i < depth; ++i) { res = Math.min(res, table[i][buckets[i]]); } return res; }
@Override public void addBinary(byte[] item, long count) { if (count < 0) { throw new IllegalArgumentException("Negative increments not implemented"); } int[] buckets = getHashBuckets(item, depth, width); for (int i = 0; i < depth; ++i) { table[i][buckets[i]] += count; } totalCount += count; }
private long estimateCountForBinaryItem(byte[] item) { long res = Long.MAX_VALUE; int[] buckets = getHashBuckets(item, depth, width); for (int i = 0; i < depth; ++i) { res = Math.min(res, table[i][buckets[i]]); } return res; }
@Override public void addBinary(byte[] item, long count) { if (count < 0) { throw new IllegalArgumentException("Negative increments not implemented"); } int[] buckets = getHashBuckets(item, depth, width); for (int i = 0; i < depth; ++i) { table[i][buckets[i]] += count; } totalCount += count; }
private static int[] getHashBuckets(String key, int hashCount, int max) { return getHashBuckets(Utils.getBytesFromUTF8String(key), hashCount, max); }
private static int[] getHashBuckets(String key, int hashCount, int max) { return getHashBuckets(Utils.getBytesFromUTF8String(key), hashCount, max); }
private static int[] getHashBuckets(String key, int hashCount, int max) { return getHashBuckets(Utils.getBytesFromUTF8String(key), hashCount, max); }
private static int[] getHashBuckets(String key, int hashCount, int max) { return getHashBuckets(Utils.getBytesFromUTF8String(key), hashCount, max); }