From 7180e539def5effb02cb89739eb52603ef2c110b Mon Sep 17 00:00:00 2001 From: Scott Somerville Date: Fri, 5 Jan 2018 08:19:09 -0500 Subject: [PATCH] Add getWarmer and getTranslog method to NodeIndicesStats (#28092) When calling the node stats action via the Java API it was not able to return information about warmers and translog even though that is available through the REST API. This change adds methods to make the responses more consistent. --- .../org/elasticsearch/indices/NodeIndicesStats.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/org/elasticsearch/indices/NodeIndicesStats.java b/core/src/main/java/org/elasticsearch/indices/NodeIndicesStats.java index a08e97ab133..fa52c88c02b 100644 --- a/core/src/main/java/org/elasticsearch/indices/NodeIndicesStats.java +++ b/core/src/main/java/org/elasticsearch/indices/NodeIndicesStats.java @@ -26,7 +26,6 @@ import org.elasticsearch.common.Nullable; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Streamable; -import org.elasticsearch.common.xcontent.ToXContent.Params; import org.elasticsearch.common.xcontent.ToXContentFragment; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.index.Index; @@ -43,6 +42,8 @@ import org.elasticsearch.index.search.stats.SearchStats; import org.elasticsearch.index.shard.DocsStats; import org.elasticsearch.index.shard.IndexingStats; import org.elasticsearch.index.store.StoreStats; +import org.elasticsearch.index.translog.TranslogStats; +import org.elasticsearch.index.warmer.WarmerStats; import org.elasticsearch.search.suggest.completion.CompletionStats; import java.io.IOException; @@ -117,6 +118,11 @@ public class NodeIndicesStats implements Streamable, ToXContentFragment { return stats.getFlush(); } + @Nullable + public WarmerStats getWarmer() { + return stats.getWarmer(); + } + @Nullable public FieldDataStats getFieldData() { return stats.getFieldData(); @@ -142,6 +148,11 @@ public class NodeIndicesStats implements Streamable, ToXContentFragment { return stats.getSegments(); } + @Nullable + public TranslogStats getTranslog() { + return stats.getTranslog(); + } + @Nullable public RecoveryStats getRecoveryStats() { return stats.getRecoveryStats();