@Nullable
  private <ACC, RES extends Message> AggregateResponse singlePartResponse(AggregateRequest request,
    boolean hasMoreRows, PartialResultContext partialResultContext, ACC acc,
    Function<ACC, RES> toRes) {
    AggregateResponse response = null;
    if (acc != null && !request.getClientSupportsPartialResult()) {
      ByteString first = toRes.apply(acc).toByteString();
      response = AggregateResponse.newBuilder().addFirstPart(first).build();
    } else if (request.getClientSupportsPartialResult()) {
      AggregateResponse.Builder responseBuilder =
        responseBuilder(request, hasMoreRows, partialResultContext);
      if (acc != null) {
        responseBuilder.addFirstPart(toRes.apply(acc).toByteString());
      }
      response = responseBuilder.build();
    }
    return response;
  }
Gives a List containing sum of values and sum of weights. It is computed for the combination of
column family and column qualifier(s) in the given row range as defined in the Scan object. In
its current implementation, it takes one column family and two column qualifiers. The first
qualifier is for values column and the second qualifier (optional) is for weight column.
hbase-endpoint/src/main/java/org/apache/hadoop/hbase/coprocessor/AggregateImplementation.java