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

extend cat api to get shards information for a specific index #18189

Merged
merged 14 commits into from
Feb 15, 2024

Conversation

kodjo-anipah
Copy link
Contributor

@kodjo-anipah kodjo-anipah commented Feb 7, 2024

Extending the internal cat api to return shards information for a specific index

part of https://github.com/Graylog2/graylog-plugin-enterprise/issues/6510
part of https://github.com/Graylog2/graylog-plugin-enterprise/issues/6273
/nocl

@kodjo-anipah kodjo-anipah marked this pull request as ready for review February 8, 2024 10:48
Copy link
Contributor

@mpfz0r mpfz0r left a comment

Choose a reason for hiding this comment

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

This could use an integration test.

ClusterIT maybe?

@kodjo-anipah kodjo-anipah requested a review from mpfz0r February 15, 2024 07:54
int shard =jsonNode.get("shard").asInt();

String ipString = getValueOrDefault(jsonNode, "ip", JsonNode::asText, null);
InetAddress ip = ipString != null ? InetAddress.getByName(ipString) : null;
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if that's worth the complexity of having to handle UnknownHostException.
Couldn't we just return the string and let the consumer deal with potentially converting it?

Copy link
Contributor

@mpfz0r mpfz0r left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@kodjo-anipah kodjo-anipah merged commit d2774a7 into master Feb 15, 2024
5 checks passed
@kodjo-anipah kodjo-anipah deleted the extend_cat_api_to_get_shards_info branch February 15, 2024 13:45
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