Adds ES searchable snapshots stats#815
Merged
pickypg merged 1 commit intoelastic:mainfrom Apr 10, 2025
Merged
Conversation
DaveCTurner
approved these changes
Apr 10, 2025
Member
DaveCTurner
left a comment
There was a problem hiding this comment.
LGTM tho why 7.13.0? This API was added in 7.10.0 AFAICT:
$ git show v7.10.0:x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/rest/RestSearchableSnapshotsStatsAction.java
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
package org.elasticsearch.xpack.searchablesnapshots.rest;
import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.Strings;
import org.elasticsearch.rest.BaseRestHandler;
import org.elasticsearch.rest.RestRequest;
import org.elasticsearch.rest.action.RestToXContentListener;
import org.elasticsearch.xpack.searchablesnapshots.action.SearchableSnapshotsStatsAction;
import org.elasticsearch.xpack.searchablesnapshots.action.SearchableSnapshotsStatsRequest;
import java.util.List;
import static java.util.Arrays.asList;
import static java.util.Collections.unmodifiableList;
public class RestSearchableSnapshotsStatsAction extends BaseRestHandler {
@Override
public List<Route> routes() {
return unmodifiableList(
asList(
new Route(RestRequest.Method.GET, "/_searchable_snapshots/stats"),
new Route(RestRequest.Method.GET, "/{index}/_searchable_snapshots/stats")
)
);
}
@Override
public String getName() {
return "searchable_snapshots_stats_action";
}
@Override
public RestChannelConsumer prepareRequest(final RestRequest restRequest, final NodeClient client) {
String[] indices = Strings.splitStringByCommaToArray(restRequest.param("index"));
return channel -> client.execute(
SearchableSnapshotsStatsAction.INSTANCE,
new SearchableSnapshotsStatsRequest(indices),
new RestToXContentListener<>(channel)
);
}
}
Contributor
Author
I picked 7.13 because that's also the ver for searchable snapshot cache stats, and the docs page for searchable snapshot stats https://www.elastic.co/guide/en/elasticsearch/reference/7.13/searchable-snapshots-api-stats.html starts to look right starting in 7.13 . Plus 7.13 is plenty old. |
Member
Yep, shouldn't really matter either way 👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.