private void completeWhenError(boolean closeScanner) {
    incRPCRetriesMetrics(scanMetrics, closeScanner);
    resultCache.clear();
    if (closeScanner) {
      closeScanner();
    }
    if (nextStartRowWhenError != null) {
      scan.withStartRow(nextStartRowWhenError, includeNextStartRowWhenError);
    }
    future.complete(true);
  }
This method is used when {@link ScanControllerImpl#suspend} had ever been called to get a
{@link ScanResumerImpl}, but now user stops scan and does not need any more scan results.
hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncScanSingleRegionRpcRetryingCaller.java