-
Notifications
You must be signed in to change notification settings - Fork 25.1k
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 _cat/nodeattrs API #12534
Add _cat/nodeattrs API #12534
Conversation
Looks good to me. I'm surprised it takes three requests to get that but I don't really mind it. |
table.addCell("ip", "alias:i;desc:ip address"); | ||
table.addCell("port", "default:false;alias:po;desc:bound transport port"); | ||
table.addCell("attr.name"); | ||
table.addCell("attr.value"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that I'm seeing these, I wonder if the default names should be attr
and value
. We could add aliases if we need longer. Since it's such a small API it's probably fine with the short versions.
Updated with @drewr's suggestions. How do I go about getting a doc for http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-nodeattrs.html ? |
Make one in docs/reference/cat I believe. |
thanks @nik9000 |
Do it as part of this pull request if you can! Its better to commit the docs at the same time. This has documentation on how to build them: https://github.com/elastic/docs |
Updated w/ asciidoc |
Do you need to add a link in the cat.asciidoc? |
yes, indeed I do. |
clusterStateRequest.local(request.paramAsBoolean("local", clusterStateRequest.local())); | ||
clusterStateRequest.masterNodeTimeout(request.paramAsTime("master_timeout", clusterStateRequest.masterNodeTimeout())); | ||
|
||
client.admin().cluster().state(clusterStateRequest, new RestActionListener<ClusterStateResponse>(channel) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if we want this optimization, but we could always run these three requests in parallel, putting the responses in three AtomicReference
s and using three CountDownLatch
s to wait until all three complete.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I implemented the early cat APIs that way and @kimchy wanted to nest instead. If the cluster's busy then you only have one dangling request.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That works for me!
shall I squash and merge? |
Yep, LGTM, can you also add the |
This provides a _cat/nodeattrs API call, which presents custom node attributes in a denormalized table. Closes #8000
This provides a
_cat/nodeattrs
API call, which presents custom node attributes in a denormalized table.This was added in addition to the
_cat/nodes
endpoint as we don't want to create dynamic columns for each user defined attribute in_cat/nodes
.Closes #8000
cc @drewr