@Override public void reset() { data = new GroupData(operations); } }
/** * Constructor that requires an {@link Aggregation}. * * @param aggregation The {@link Aggregation} that specifies how and what this will compute. * @param config The BulletConfig. */ public GroupAll(Aggregation aggregation, BulletConfig config) { // GroupOperations is all we care about - size etc. are meaningless for Group All since it's a single result operations = GroupOperation.getOperations(aggregation.getAttributes()); data = new GroupData(operations); this.provider = config.getBulletRecordProvider(); }
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); }