@Override public MeasureIngester<BitmapCounter> newIngester() { return new MeasureIngester<BitmapCounter>() { BitmapCounter current = new BitmapCounter(); @Override public BitmapCounter valueOf(String[] values, MeasureDesc measureDesc, Map<TblColRef, Dictionary<String>> dictionaryMap) { BitmapCounter bitmap = current; bitmap.clear(); for (String v : values) bitmap.add(v); return bitmap; } }; }
private BitmapCounter current() { BitmapCounter counter = current.get(); if (counter == null) { counter = new BitmapCounter(); current.set(counter); } return counter; }
public static BitmapCounter add(BitmapCounter counter, Object v) { BitmapCounter c = (BitmapCounter) v; if (counter == null) { return new BitmapCounter(c); } else { counter.merge(c); return counter; } }
@Override public void aggregate(BitmapCounter value) { if (sum == null) { sum = new BitmapCounter(value); } else { sum.merge(value); } }