Provide non blocking getFlightInfo

Open
#719 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

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

Research direction

Start by reading the FlightProducer interface and FlightService handling of getFlightInfo, then compare how the other non-blocking FlightProducer methods are implemented. Confirm how the proposed listener overload and isBlockingFlightInfo flag can preserve existing implementations; the work is done when FlightService can use the non-blocking path without breaking blocking producers.

Written by the indexing model from the issue text.

Description

Type: enhancement
Describe the enhancement requested

We have a use case in our production environment where getFlightInfo can take longer than a second and having a blocking getFlightInfo is a problem. Since many other methods in FlightProducer is non blocking we should also have a non blocking getFlightInfo

The code would look something like this with minimum impact to all the implementations

 /**
   * Get information about a particular data stream.
   *
   * @param context Per-call context.
   * @param descriptor The descriptor identifying the data stream.
   * @return Metadata about the stream.
   */
  FlightInfo getFlightInfo(CallContext context, FlightDescriptor descriptor);

  /**
   *  Get information about a particular data stream.
   *  
   * @param context Per-call context.
   * @param descriptor The descriptor identifying the data stream.
   * @param listener An interface for sending data back to the client.
   */
  default void getFlightInfo(CallContext context, FlightDescriptor descriptor, StreamListener<FlightInfo> listener ){
    FlightInfo flightInfo = getFlightInfo(context, descriptor);
    listener.onNext(flightInfo);
    listener.onCompleted();
  }

  /**
   *
   * @return true if blocking (default) version of getFlightInfo needs to be used by FlightService.
   */
  default boolean isBlockingFlightInfo() {
    return true;
  }
Dominant language
Java
Stars
95
Forks
154
Avg merge
2d 10h
Merged PRs (30d)
11

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/arrow-java

All issues in apache/arrow-java

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.