private void openScanner() {
    incRegionCountMetrics(scanMetrics);
    openScannerTries.set(1);
    addListener(timelineConsistentRead(conn.getLocator(), tableName, scan, scan.getStartRow(),
      getLocateType(scan), this::openScanner, rpcTimeoutNs, getPrimaryTimeoutNs(), retryTimer,
      conn.getConnectionMetrics()), (resp, error) -> {
        try (Scope ignored = span.makeCurrent()) {
          if (error != null) {
            try {
              consumer.onError(error);
              return;
            } finally {
              TraceUtil.setError(span, error);
              span.end();
            }
          }
          startScan(resp);
        }
      });
  }
The asynchronous client scanner implementation.
<p>
Here we will call OpenScanner first and use the returned scannerId to create a
{@link AsyncScanSingleRegionRpcRetryingCaller} to do the real scan operation. The return value of
{@link AsyncScanSingleRegionRpcRetryingCaller} will tell us whether open a new scanner or finish
scan.
hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncClientScanner.java