@Override
        public S call(AggregateService instance) throws IOException {
          RpcController controller = new AggregationClientRpcController();
          // Not sure what is going on here why I have to do these casts. TODO.
          CoprocessorRpcUtils.BlockingRpcCallback<AggregateResponse> rpcCallback =
            new CoprocessorRpcUtils.BlockingRpcCallback<>();
          instance.getSum(controller, requestArg, rpcCallback);
          AggregateResponse response = rpcCallback.get();
          if (controller.failed()) {
            throw new IOException(controller.errorText());
          }
          if (response.getFirstPartCount() == 0) {
            return null;
          }
          ByteString b = response.getFirstPart(0);
          T t = getParsedGenericInstance(ci.getClass(), 4, b);
          S s = ci.getPromotedValueFromProto(t);
          return s;
        }
It sums up the value returned from various regions. In case qualifier is null, summation of all
the column qualifiers in the given family is done.
@param table table to scan.
@param ci    the user's ColumnInterpreter implementation
@param scan  the HBase scan object to use to read data from HBase
@return sum &lt;S&gt;
@throws Throwable The caller is supposed to handle the exception as they are thrown &amp;
                  propagated to it.
hbase-endpoint/src/main/java/org/apache/hadoop/hbase/client/coprocessor/AggregationClient.java