@Override
    public ServiceCaller<AggregateService, AggregateResponse>
      getNextCallable(AggregateResponse response, RegionInfo region) {
      if (!response.hasNextChunkStartRow()) {
        return null;
      }
      return (stub, controller, rpcCallback) -> {
        AggregateRequest.Builder updatedRequest = AggregateRequest.newBuilder(originalRequest);
        updatedRequest.setScan(originalRequest.getScan().toBuilder()
          .setStartRow(response.getNextChunkStartRow()).build());
        if (log.isTraceEnabled()) {
          log.trace("Got incomplete result {} for original scan {}. Sending next request {}.",
            TextFormat.shortDebugString(response),
            TextFormat.shortDebugString(originalRequest.getScan()),
            TextFormat.shortDebugString(updatedRequest));
        }
        stubCaller.call(stub, controller, updatedRequest.build(), rpcCallback);
      };
    }
This client class is for invoking the aggregate functions deployed on the Region Server side via
the AggregateService. This class will implement the supporting functionality for
summing/processing the individual results obtained from the AggregateService for each region.
hbase-endpoint/src/main/java/org/apache/hadoop/hbase/client/coprocessor/AsyncAggregationClient.java