dlmarion commented on code in PR #3292:
URL: https://github.com/apache/accumulo/pull/3292#discussion_r1171793144


##########
core/src/main/java/org/apache/accumulo/core/clientImpl/TabletServerBatchReaderIterator.java:
##########
@@ -679,32 +686,55 @@ public Collection<? extends ScanServerAttempt> 
getAttempts(TabletId tabletId) {
       public Map<String,String> getHints() {
         return options.executionHints;
       }
+
+      @Override
+      public <T> Optional<T> waitUntil(Supplier<Optional<T>> condition, 
Duration maxWaitTime,
+          String description) {
+        return ThriftScanner.waitUntil(condition, maxWaitTime, description, 
timeoutLeft, context,
+            tableId, log);
+      }
     };
 
     var actions = ecsm.selectServers(params);
 
     Map<String,ScanServerAttemptReporter> reporters = new HashMap<>();
 
+    failures = new ArrayList<>();
+
     for (TabletIdImpl tabletId : tabletIds) {
       KeyExtent extent = tabletId.toKeyExtent();
       String serverToUse = actions.getScanServer(tabletId);
       if (serverToUse == null) {
         // no scan server was given so use the tablet server
-        serverToUse = Objects.requireNonNull(extentToTserverMap.get(extent));
-        log.trace("For tablet {} scan server selector chose tablet_server", 
tabletId);
+        serverToUse = extentToTserverMap.get(extent);
+        if (serverToUse != null) {
+          log.trace("For tablet {} scan server selector chose tablet_server", 
tabletId);

Review Comment:
   ```suggestion
             log.trace("For tablet {} scan server selector chose tablet_server 
{}", tabletId, serverToUse);
   ```



##########
core/src/main/java/org/apache/accumulo/core/clientImpl/ThriftScanner.java:
##########
@@ -299,10 +305,52 @@ public ScanState(ClientContext context, TableId tableId, 
Authorizations authoriz
     }
   }
 
-  public static class ScanTimedOutException extends IOException {
+  static <T> Optional<T> waitUntil(Supplier<Optional<T>> condition, Duration 
maxWaitTime,

Review Comment:
   I wonder if the `Wait` class should be promoted out of the test package and 
this added to that class, or this added to `UtilWaitThread`.



##########
core/src/main/java/org/apache/accumulo/core/clientImpl/ThriftScanner.java:
##########
@@ -369,10 +427,19 @@ public Map<String,String> getHints() {
         log.trace("For tablet {} scan server selector chose scan_server:{} 
delay:{} busyTimeout:{}",
             loc.getExtent(), scanServer, delay, scanState.busyTimeout);
       } else {
-        addr = new ScanAddress(loc.getTserverLocation(), ServerType.TSERVER, 
loc);
-        delay = actions.getDelay();
-        scanState.busyTimeout = Duration.ZERO;
-        log.trace("For tablet {} scan server selector chose tablet_server", 
loc.getExtent());
+        Optional<String> tserverLoc = loc.getTserverLocation();
+
+        if (tserverLoc.isPresent()) {
+          addr = new ScanAddress(loc.getTserverLocation().get(), 
ServerType.TSERVER, loc);
+          delay = actions.getDelay();
+          scanState.busyTimeout = Duration.ZERO;
+          log.trace("For tablet {} scan server selector chose tablet_server", 
loc.getExtent());

Review Comment:
   ```suggestion
             log.trace("For tablet {} scan server selector chose tablet_server: 
{}", loc.getExtent(), addr);
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to