-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Java] Ability to register additional grpc services with FlightServer #34778
Comments
Use FlightGrpcUtil for full control; we are trying not to expose gRPC APIs directly from core APIs. |
@lidavidm I've been looking at |
Yes, and FlightServer does not do all that much for you in the first place, so I don't really want it to be a giant wrapper around the gRPC server builders...just use the gRPC ones directly. |
@lidavidm so |
It is still recommended, but if you want to control every gRPC knob we can't really support that in the core API. Again, the main constraint is not leaking gRPC implementation details (as best as possible) into the core API since we are still working on supporting non-gRPC transports. |
Of course, the C++/Python APIs expose some generic hooks for this kind of customization in the core API. A proposal for a similar hook in Java would be welcome. |
I believe the Go API does as well. Would the above commit seem like a reasonable proposal? I can make a PR and move the conversation there. |
Not quite, directly exposing gRPC is specifically what we have tried to avoid. I'm thinking something like (directly off the top of my head, not sure if this compiles) <T> Builder withTransportHook(Consumer<T> hook) {
if (grpcBuilder instanceof T) {
hook.accept((T) grpcBuilder);
} else {
// raise exception
}
}
// ...
FlightServer.builder().withTransportHook<NettyServerBuilder>((nsb) -> { nsb.registerService(...); })...; (Go and Rust forego flexibility and directly tie themselves to the gRPC API: that means that a project like Flight-UCX is not possible in those languages, not without rewriting your Flight client/service. That's what we are trying to avoid.) |
Gotcha, that makes sense! I'll take a stab at it! |
@lidavidm I've been struggling with generics and how to store the hook from Is it safe to assume in the future all builders will be either
and in
|
I think that's fine for this implementation. We can refactor when we have other implementations. |
@lidavidm got an initial PR out. Let me know what you think about the API before I go on making the unit tests and docs changes. I tested this with our server and I can add both Health Check and Reflection services. |
…service requests (#34815) ### Rationale for this change The interceptor applies to all methods. When receiving a method for a different service, we don't want to throw an error because the method doesn't exist. ### What changes are included in this PR? - Ensure added services work correctly - Add test to make sure registered services work correctly - Add documentation explaining how to add services ### Are these changes tested? Yes ### Are there any user-facing changes? Yes, documentation now explains how to add services * Closes: #34778 Authored-by: Diego Fernandez <aiguo.fernandez@gmail.com> Signed-off-by: David Li <li.davidm96@gmail.com>
…light service requests (apache#34815) ### Rationale for this change The interceptor applies to all methods. When receiving a method for a different service, we don't want to throw an error because the method doesn't exist. ### What changes are included in this PR? - Ensure added services work correctly - Add test to make sure registered services work correctly - Add documentation explaining how to add services ### Are these changes tested? Yes ### Are there any user-facing changes? Yes, documentation now explains how to add services * Closes: apache#34778 Authored-by: Diego Fernandez <aiguo.fernandez@gmail.com> Signed-off-by: David Li <li.davidm96@gmail.com>
Describe the enhancement requested
We want to add the gRPC health endpoint to our server. It looks like the ability to do this was added to the go server with this PR.. It would be great to have something similar for the Java server.
Component(s)
Java
The text was updated successfully, but these errors were encountered: