apache / apache/arrow-java

[Java][Flight] Add caching of FlightClients to JDBC

Open
#157 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
94
Forks
152
Avg merge
3d 16h
Merged PRs (30d)
11

Description

### Describe the enhancement requested

When getFlightInfo reports a list of endpoints, the driver internally creates a FlightClient for each endpoint that reports a Location. These clients can benefit from being cached/pooled since a server will likely re-use endpoints for subsequent queries. This should likely be a configuration option.

The driver should also check if the Location at an endpoint is the same as the original location used when calling getFlightInfo and avoid creating a new FlightClient in this case.

Investigate using https://github.com/ben-manes/caffeine for caching.

### Component(s)

FlightRPC, Java

Contributor guide

Open the contributing guide

Research direction

Start by tracing the Java JDBC driver's getFlightInfo path and how it creates FlightClients for returned Locations. Investigate Caffeine as suggested, then define a configuration option for client caching or pooling and verify that the original Location is reused without creating a duplicate client. Done means endpoint clients are reused for subsequent queries while the original location avoids an extra client.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.