@Override public void consume(BulletRecord data) { this.data.consume(data); }
/** * Consumes the given {@link BulletRecord} and computes group operation metrics. * * @param data The record to compute metrics for. */ public void consume(BulletRecord data) { metrics.entrySet().stream().forEach(e -> consume(e, data)); }
@Override public void update(CachingGroupData value) { if (!initialized) { // This only needs to happen once per summary (i.e. once per group). data = value.partialCopy(); initialized = true; } data.consume(value.getCachedRecord()); }
private static byte[] getGroupDataWithCount(String countField, int count) { GroupData groupData = new GroupData(new HashSet<>(singletonList(new GroupOperation(COUNT, null, countField)))); IntStream.range(0, count).forEach(i -> groupData.consume(RecordBox.get().getRecord())); return SerializerDeserializer.toBytes(groupData); }