lidavidm commented on a change in pull request #8780:
URL: https://github.com/apache/arrow/pull/8780#discussion_r535624785



##########
File path: 
java/flight/flight-core/src/main/java/org/apache/arrow/flight/FlightClient.java
##########
@@ -388,6 +389,57 @@ public ExchangeReaderWriter doExchange(FlightDescriptor 
descriptor, CallOption..
     }
   }
 
+  /**
+   * Wrapper class to wrap the iterator and handle auth failures and retry.
+   * @param <T> The type of iterator.
+   */
+  public static class WrappedFlightIterator<T> implements Iterator<T> {

Review comment:
       Sorry - let me clarify. What I mean is that gRPC offers 3 types of 
clients in Java: a blocking client, async client, and a "generic" client. This 
last client offers a unified interface for all types of calls: it accepts a 
StreamObserver which gets called with data from the server and it is given a 
StreamObserver to send data to the server. So if you were to rewrite all gRPC 
calls in terms of this last type of client, then you could implement a single 
StreamObserver wrapper that handles retries for all calls.
   
   Not a requirement - just offering a suggestion to avoid having to implement 
lots of single-purpose retries. It would take a decent amount of refactoring.




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

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


Reply via email to