private <R, S, P extends Message, Q extends Message, T extends Message> Pair<S, Long> getAvgArgs(
    final TableName tableName, final ColumnInterpreter<R, S, P, Q, T> ci, final Scan scan)
    throws Throwable {
    try (Table table = getConnection().getTable(tableName)) {
      return getAvgArgs(table, ci, scan);
    }
  }
It computes average while fetching sum and row count from all the corresponding regions.
Approach is to compute a global sum of region level sum and rowcount and then compute the
average.
@param tableName the name of the table to scan
@param scan      the HBase scan object to use to read data from HBase
@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