@Override
  public synchronized void onNext(Result[] results, ScanController controller) {
    assert results.length > 0;
    if (closed) {
      controller.terminate();
      return;
    }
    for (Result result : results) {
      addToCache(result);
    }
    notifyAll();
    if (cacheSize >= maxCacheSize) {
      stopPrefetch(controller);
    }
  }
The {@link ResultScanner} implementation for {@link RawAsyncTableImpl}. It will fetch data
automatically in background and cache it in memory. Typically, the {@link #maxCacheSize} will be
{@code 2 * scan.getMaxResultSize()}.
hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncTableResultScanner.java