keeratsingh commented on a change in pull request #8780:
URL: https://github.com/apache/arrow/pull/8780#discussion_r534469821
##########
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:
@lidavidm Thank you for your feedback
I have pushed a PS with the suggested changes.
I do currently have a blocking call
[[link]](https://github.com/apache/arrow/pull/8780/commits/2fc2971979a1fa93346948d2da9cba91a8399c43#diff-5f196a1c597e5a8d9c3cd835dae4db594b6204cb2d681c494d8ed3906cf47478R47)
on the API calls that return an Iterable, like listFlights and listActions, as
we need to have the iterable populated before we return it to the FlightClient,
if not then we are back to the same approach using a wrapped iterator.
While the changes latest PS `doClientCall ` only caters to API calls that
return an iterable/iterator, the next step is to make them generic for calls
like `getInfo, getSchema`
Before I go ahead and do that, I wanted to confirm if this is what you had
in mind when you made the suggestions above, regarding a generic StreamObserver.
Other options that I had in mind were to pass the functional interfaces to
pass the `ApiCallObserver` and have it retry the API call `onError`, in that
case, we would not need to block `doClientCall` until the `ApiCallObserver`
completes as the API call would be retried asynchronously when the Observer
encounters an error.
----------------------------------------------------------------
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]