void AsyncClientScanner::StartScan()

in src/hbase/client/async-client-scanner.cc [103:132]


void AsyncClientScanner::StartScan(std::shared_ptr<OpenScannerResponse> resp) {
  auto self(shared_from_this());
  auto caller = conn_->caller_factory()
                    ->Scan()
                    ->scanner_id(resp->scan_resp_->scanner_id())
                    ->region_location(resp->region_location_)
                    ->scanner_lease_timeout(TimeUtil::MillisToNanos(resp->scan_resp_->ttl()))
                    ->scan(scan_)
                    ->rpc_client(resp->rpc_client_)
                    ->consumer(consumer_)
                    ->results_cache(results_cache_)
                    ->rpc_timeout(rpc_timeout_nanos_)
                    ->scan_timeout(scan_timeout_nanos_)
                    ->pause(pause_)
                    ->max_retries(max_retries_)
                    ->start_log_errors_count(start_log_errors_count_)
                    ->Build();

  caller->Start(resp->controller_, resp->scan_resp_, resp->cell_scanner_)
      .then([caller, self](const bool has_more) {
        if (has_more) {
          // open the next scanner on the next region.
          self->OpenScanner();
        } else {
          self->consumer_->OnComplete();
        }
      })
      .onError([caller, self](const folly::exception_wrapper& e) { self->consumer_->OnError(e); })
      .then([caller, self](const auto r) { return r; });
}