charlesconnell commented on code in PR #6167:
URL: https://github.com/apache/hbase/pull/6167#discussion_r1757972223


##########
hbase-client/src/main/java/org/apache/hadoop/hbase/client/RawAsyncTableImpl.java:
##########
@@ -822,7 +822,30 @@ private <S, R> void onLocateComplete(Function<RpcChannel, 
S> stubMaker,
         } else {
           callback.onRegionComplete(region, r);
         }
-        if (unfinishedRequest.decrementAndGet() == 0 && locateFinished.get()) {
+
+        boolean complete = unfinishedRequest.decrementAndGet() == 0 && 
locateFinished.get();

Review Comment:
   Refactored this



##########
hbase-client/src/main/java/org/apache/hadoop/hbase/client/RawAsyncTableImpl.java:
##########
@@ -822,7 +822,30 @@ private <S, R> void onLocateComplete(Function<RpcChannel, 
S> stubMaker,
         } else {
           callback.onRegionComplete(region, r);
         }
-        if (unfinishedRequest.decrementAndGet() == 0 && locateFinished.get()) {
+
+        boolean complete = unfinishedRequest.decrementAndGet() == 0 && 
locateFinished.get();
+
+        if (e == null && r != null) {
+          ServiceCaller<S, R> updatedCallable = callback.getNextCallable(r, 
region);
+          if (updatedCallable != null) {
+            // We are launching a new request now, so un-set complete
+            complete = false;
+            long waitIntervalMs = callback.getWaitIntervalMs(r, region);
+            LOG.trace("Coprocessor returned incomplete result. "
+              + "Sleeping for {} millis before making follow-up request.", 
waitIntervalMs);
+            if (waitIntervalMs > 0) {
+              AsyncConnectionImpl.RETRY_TIMER.newTimeout(
+                (timeout) -> onLocateComplete(stubMaker, updatedCallable, 
callback, endKey,
+                  endKeyInclusive, locateFinished, unfinishedRequest, loc, 
null),
+                waitIntervalMs, TimeUnit.MILLISECONDS);
+            } else {
+              onLocateComplete(stubMaker, updatedCallable, callback, endKey, 
endKeyInclusive,

Review Comment:
   Sure, this is refactored now



-- 
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