code: private ScanContext grab() throws ExecutionException, InterruptedException {
          final Future<ScanContext> ret = exec.take();
  
          final ScanRequest originalRequest = ret.get().getScanRequest();
          final int segment = originalRequest.getSegment();
  
          final ScanSegmentWorker sw = workers[segment];
  
          if (sw.hasNext()) {
              currentFutures[segment] = exec.submit(sw);
          } else {
              finishSegment(segment);
              currentFutures[segment] = null;
          }
  
          //FYI, This might block if nothing is available.
          return ret.get();
      }
docs: This method gets a segmentedScanResult and submits the next scan request for that segment, if there is one.
  @return the next available ScanResult
  @throws ExecutionException if one of the segment pages threw while executing
  @throws InterruptedException if one of the segment pages was interrupted while executing.