github-actions[bot] commented on code in PR #70465:
URL: https://github.com/apache/doris/pull/70465#discussion_r4640990349
##########
samples/arrow-flight-sql/java/src/main/java/doris/arrowflight/demo/FlightSqlClient.java:
##########
@@ -67,12 +65,20 @@ public static FlightInfoResult<FlightInfo,
CredentialCallOption, org.apache.arro
return new FlightInfoResult<>(info, credentialCallOption,
preparedStatement);
}
+ public static Location feLocation(Configuration configuration) throws
URISyntaxException {
+ return new Location(new URI("grpc", null, configuration.ip,
Integer.parseInt(configuration.arrowFlightPort),
+ null, null, null));
+ }
+
/**
* Use the correct Bearertoken and the correct Ticket, and the expected
return result is normal.
+ * An endpoint with no location is a result the FE holds itself (a SHOW, a
SET, ... under the FE config
+ * arrow_flight_fe_result_empty_location): it is redeemed on the FE that
issued the ticket.
*/
- public static void getResultFromDorisBe(FlightInfo info, Ticket ticket,
CredentialCallOption credentialCallOption)
- throws Exception {
- final Location locationBE =
info.getEndpoints().get(0).getLocations().get(0);
+ public static void getResultFromDorisBe(FlightInfo info, Ticket ticket,
CredentialCallOption credentialCallOption,
+ Location feLocation) throws Exception {
+ final List<Location> locations =
info.getEndpoints().get(0).getLocations();
+ final Location locationBE = locations.isEmpty() ? feLocation :
locations.get(0);
Review Comment:
[P2] Reuse the ticket-issuing FE connection for empty-location endpoints.
`getFlightInfoFromDorisFe` authenticates and executes through one
`FlightClient`, but this branch creates a new client at `feLocation`; with a
load balancer or multiple FEs that connection can land on another FE, where the
bearer token/session is unknown. Keep/pass the original FE client (and its
allocator) in the returned sample state and use it when `locations` is empty;
retain a separate client for BE locations.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]