@Override public void aggregate() { if (byRow) { hashRow(selectorPluses, collector); } else { hashValues(selectorPluses, collector); } }
@Override public void aggregate(ByteBuffer buf, int position) { // Save position, limit and restore later instead of allocating a new ByteBuffer object final int oldPosition = buf.position(); final int oldLimit = buf.limit(); buf.limit(position + HyperLogLogCollector.getLatestNumBytesForDenseStorage()); buf.position(position); try { final HyperLogLogCollector collector = HyperLogLogCollector.makeCollector(buf); if (byRow) { CardinalityAggregator.hashRow(selectorPluses, collector); } else { CardinalityAggregator.hashValues(selectorPluses, collector); } } finally { buf.limit(oldLimit); buf.position(oldPosition); } }
@Override public void aggregate() { if (byRow) { hashRow(selectorPluses, collector); } else { hashValues(selectorPluses, collector); } }
@Override public void aggregate(ByteBuffer buf, int position) { // Save position, limit and restore later instead of allocating a new ByteBuffer object final int oldPosition = buf.position(); final int oldLimit = buf.limit(); buf.limit(position + HyperLogLogCollector.getLatestNumBytesForDenseStorage()); buf.position(position); try { final HyperLogLogCollector collector = HyperLogLogCollector.makeCollector(buf); if (byRow) { CardinalityAggregator.hashRow(selectorPluses, collector); } else { CardinalityAggregator.hashValues(selectorPluses, collector); } } finally { buf.limit(oldLimit); buf.position(oldPosition); } }