@Override
  public void getMin(RpcController controller, AggregateRequest request,
    RpcCallback<AggregateResponse> done) {
    AggregateResponse response = null;
    InternalScanner scanner = null;
    PartialResultContext partialResultContext = new PartialResultContext();
    T min = null;
    boolean hasMoreRows = true;
    try {
      ColumnInterpreter<T, S, P, Q, R> ci = constructColumnInterpreterFromRequest(request);
      T temp;
      Scan scan = ProtobufUtil.toScan(request.getScan());
      scanner = env.getRegion().getScanner(scan);
      List<Cell> results = new ArrayList<>();
      byte[] colFamily = scan.getFamilies()[0];
      NavigableSet<byte[]> qualifiers = scan.getFamilyMap().get(colFamily);
      byte[] qualifier = null;
      if (qualifiers != null && !qualifiers.isEmpty()) {
        qualifier = qualifiers.pollFirst();
      }
      do {
        if (shouldBreakForThrottling(request, scan, partialResultContext)) {
          break;
        }
        hasMoreRows = scanner.next(results);
        int listSize = results.size();
        for (int i = 0; i < listSize; i++) {
          temp = ci.getValue(colFamily, qualifier, results.get(i));
          min = (min == null || (temp != null && ci.compare(temp, min) < 0)) ? temp : min;
        }
        postScanPartialResultUpdate(results, partialResultContext);
        results.clear();
      } while (hasMoreRows);
      response = singlePartResponse(request, hasMoreRows, partialResultContext, min,
        ci::getProtoForCellType);
    } catch (IOException e) {
      CoprocessorRpcUtils.setControllerException(controller, e);
    } finally {
      if (scanner != null) {
        IOUtils.closeQuietly(scanner);
      }
      closeQuota(partialResultContext);
    }
    log.debug("Minimum from this region is {}: {} (partial result: {}) (client {})",
      env.getRegion().getRegionInfo().getRegionNameAsString(), min, hasMoreRows,
      RpcServer.getRequestUser());
    done.run(response);
  }
Gives the minimum for a given combination of column qualifier and column family, in the given
row range as defined in the Scan object. In its current implementation, it takes one column
family and one column qualifier (if provided). In case of null column qualifier, minimum value
for the entire column family will be returned.
hbase-endpoint/src/main/java/org/apache/hadoop/hbase/coprocessor/AggregateImplementation.java