public <R, S, P extends Message, Q extends Message, T extends Message> double
    std(final Table table, ColumnInterpreter<R, S, P, Q, T> ci, Scan scan) throws Throwable {
    Pair<List<S>, Long> p = getStdArgs(table, ci, scan);
    double avg = ci.divideForAvg(p.getFirst().get(0), p.getSecond());
    double avgOfSumSq = ci.divideForAvg(p.getFirst().get(1), p.getSecond());
    double res = avgOfSumSq - avg * avg; // variance
    res = Math.pow(res, 0.5);
    return res;
  }
This is the client side interface/handle for calling the std method for a given cf-cq
combination. It was necessary to add one more call stack as its return type should be a decimal
value, irrespective of what columninterpreter says. So, this methods collects the necessary
parameters to compute the std and returns the double value.
@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 &lt;R, 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