Пример #1
0
 private void addCallsForOtherReplicas(
     ResultBoundedCompletionService<Pair<Result[], ScannerCallable>> cs,
     RegionLocations rl,
     int min,
     int max) {
   if (scan.getConsistency() == Consistency.STRONG) {
     return; // not scheduling on other replicas for strong consistency
   }
   for (int id = min; id <= max; id++) {
     if (currentScannerCallable.id == id) {
       continue; // this was already scheduled earlier
     }
     ScannerCallable s = currentScannerCallable.getScannerCallableForReplica(id);
     setStartRowForReplicaCallable(s);
     outstandingCallables.add(s);
     RetryingRPC retryingOnReplica = new RetryingRPC(s);
     cs.submit(retryingOnReplica, scannerTimeout, id);
   }
 }
 private int addCallsForOtherReplicas(
     BoundedCompletionService<Pair<Result[], ScannerCallable>> cs,
     RegionLocations rl,
     int min,
     int max) {
   if (scan.getConsistency() == Consistency.STRONG) {
     return 0; // not scheduling on other replicas for strong consistency
   }
   for (int id = min; id <= max; id++) {
     if (currentScannerCallable.getHRegionInfo().getReplicaId() == id) {
       continue; // this was already scheduled earlier
     }
     ScannerCallable s = currentScannerCallable.getScannerCallableForReplica(id);
     if (this.lastResult != null) {
       s.getScan().setStartRow(this.lastResult.getRow());
     }
     outstandingCallables.add(s);
     RetryingRPC retryingOnReplica = new RetryingRPC(s);
     cs.submit(retryingOnReplica);
   }
   return max - min + 1;
 }