apache / apache/arrow-java

Provide non blocking getFlightInfo

Đang mở
#719 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
Type: enhancement
Ngôn ngữ chính
Java
Star
94
Fork
152
Merge trung bình
3 ngày 16 giờ
Pull request đã merge (30 ngày)
11

Mô tả

### 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 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;
}
```

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu bằng cách đọc interface FlightProducer và cách FlightService xử lý getFlightInfo, sau đó so sánh cách các phương thức không blocking khác của FlightProducer được triển khai. Xác nhận cách overload listener được đề xuất và flag isBlockingFlightInfo có thể bảo toàn các triển khai hiện có; công việc hoàn tất khi FlightService có thể sử dụng đường dẫn không blocking mà không làm hỏng các producer blocking.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
java
Lĩnh vực
api
Loại issue
Tính năng
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
42/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.