Skip to content

Commit

Permalink
MINOR: [Java] Guide clients to use tickets from FlightInfo (#293)
Browse files Browse the repository at this point in the history
Not to construct them themselves in their clients.

Co-authored-by: David Li <[email protected]>
  • Loading branch information
liry and lidavidm authored Sep 5, 2023
1 parent c20eea0 commit 1c9a3f4
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions java/source/flight.rst
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,7 @@ Flight Client and Server
System.out.println("C3: Client (Get Metadata): " + flightInfo);

// Get data information
try(FlightStream flightStream = flightClient.getStream(new Ticket(
FlightDescriptor.path("profiles").getPath().get(0).getBytes(StandardCharsets.UTF_8)))) {
try(FlightStream flightStream = flightClient.getStream(flightInfo.getEndpoints().get(0).getTicket())) {
int batch = 0;
try (VectorSchemaRoot vectorSchemaRootReceived = flightStream.getRoot()) {
System.out.println("C4: Client (Get Stream):");
Expand Down Expand Up @@ -451,8 +450,7 @@ And get the data back:
}
// Client
try(FlightStream flightStream = flightClient.getStream(new Ticket(
FlightDescriptor.path("profiles").getPath().get(0).getBytes(StandardCharsets.UTF_8)))) {
try(FlightStream flightStream = flightClient.getStream(flightInfo.getEndpoints().get(0).getTicket())) {
int batch = 0;
try (VectorSchemaRoot vectorSchemaRootReceived = flightStream.getRoot()) {
System.out.println("C4: Client (Get Stream):");
Expand Down

0 comments on commit 1c9a3f4

Please sign in to comment.