Skip to content
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

Add nodeInfo grpc endpoint #765

Merged
merged 2 commits into from
Oct 17, 2024
Merged

Conversation

aprudhomme
Copy link
Contributor

Added the grpc endpoint nodeInfo. This allows you to get the node name, service name, host name, nrtsearch version, and ephemeral id of a running node.

I added the utility method handleUnaryRequest to the Handler to try to standardize basic error handling and logging for grpc requests. The plan is to migrate more requests to use this in the (near) future.

@aprudhomme aprudhomme requested a review from sarthakn7 October 15, 2024 23:13
void handleUnaryRequest(
String name, T protoRequest, StreamObserver<S> responseObserver, Handler<T, S> handler) {
try {
handler.handle(protoRequest, responseObserver);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If doing this, do you want to add another handle method that returns the response and doesn't need responseObserver? It's currently passed just for error handling.

assertEquals("serviceName", response.getServiceName());
assertEquals("hostName", response.getHostName());
assertEquals("ephemeralId", response.getEphemeralId());
assertFalse(response.getVersion().isEmpty());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can assert the version to be equal to Version.CURRENT.toString()

@aprudhomme aprudhomme requested a review from sarthakn7 October 17, 2024 17:31
@aprudhomme aprudhomme merged commit 0fa982e into Yelp:main Oct 17, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants