diff --git a/core/src/main/java/org/elasticsearch/action/admin/cluster/stats/ClusterStatsNodes.java b/core/src/main/java/org/elasticsearch/action/admin/cluster/stats/ClusterStatsNodes.java index 5604616ed39..6020aa1a104 100644 --- a/core/src/main/java/org/elasticsearch/action/admin/cluster/stats/ClusterStatsNodes.java +++ b/core/src/main/java/org/elasticsearch/action/admin/cluster/stats/ClusterStatsNodes.java @@ -302,7 +302,6 @@ public class ClusterStatsNodes implements ToXContent, Streamable { int availableProcessors; int allocatedProcessors; - long availableMemory; final ObjectIntHashMap names; public OsStats() { @@ -326,15 +325,10 @@ public class ClusterStatsNodes implements ToXContent, Streamable { return allocatedProcessors; } - public ByteSizeValue getAvailableMemory() { - return new ByteSizeValue(availableMemory); - } - @Override public void readFrom(StreamInput in) throws IOException { availableProcessors = in.readVInt(); allocatedProcessors = in.readVInt(); - availableMemory = in.readLong(); int size = in.readVInt(); names.clear(); for (int i = 0; i < size; i++) { @@ -346,7 +340,6 @@ public class ClusterStatsNodes implements ToXContent, Streamable { public void writeTo(StreamOutput out) throws IOException { out.writeVInt(availableProcessors); out.writeVInt(allocatedProcessors); - out.writeLong(availableMemory); out.writeVInt(names.size()); for (ObjectIntCursor name : names) { out.writeString(name.key); @@ -365,9 +358,6 @@ public class ClusterStatsNodes implements ToXContent, Streamable { static final XContentBuilderString ALLOCATED_PROCESSORS = new XContentBuilderString("allocated_processors"); static final XContentBuilderString NAME = new XContentBuilderString("name"); static final XContentBuilderString NAMES = new XContentBuilderString("names"); - static final XContentBuilderString MEM = new XContentBuilderString("mem"); - static final XContentBuilderString TOTAL = new XContentBuilderString("total"); - static final XContentBuilderString TOTAL_IN_BYTES = new XContentBuilderString("total_in_bytes"); static final XContentBuilderString COUNT = new XContentBuilderString("count"); } @@ -375,10 +365,6 @@ public class ClusterStatsNodes implements ToXContent, Streamable { public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { builder.field(Fields.AVAILABLE_PROCESSORS, availableProcessors); builder.field(Fields.ALLOCATED_PROCESSORS, allocatedProcessors); - builder.startObject(Fields.MEM); - builder.byteSizeField(Fields.TOTAL_IN_BYTES, Fields.TOTAL, availableMemory); - builder.endObject(); - builder.startArray(Fields.NAMES); for (ObjectIntCursor name : names) { builder.startObject(); diff --git a/docs/reference/migration/migrate_5_0/java.asciidoc b/docs/reference/migration/migrate_5_0/java.asciidoc index df526740f33..d7c580bd008 100644 --- a/docs/reference/migration/migrate_5_0/java.asciidoc +++ b/docs/reference/migration/migrate_5_0/java.asciidoc @@ -299,3 +299,8 @@ requests can now be validated at call time which results in much clearer errors. ==== ExplainRequestBuilder The `setQuery(BytesReference)` method have been removed in favor of using `setQuery(QueryBuilder)` + +=== ClusterStatsResponse + +Removed the `getMemoryAvailable` method from `OsStats`, which could be previously accessed calling +`clusterStatsResponse.getNodesStats().getOs().getMemoryAvailable()`. diff --git a/docs/reference/migration/migrate_5_0/rest.asciidoc b/docs/reference/migration/migrate_5_0/rest.asciidoc index 590a097f021..0b8d76ea10f 100644 --- a/docs/reference/migration/migrate_5_0/rest.asciidoc +++ b/docs/reference/migration/migrate_5_0/rest.asciidoc @@ -15,3 +15,8 @@ endpoint should be used in lieu of optimize. The `GET` HTTP verb for `/_forcemerge` is no longer supported, please use the `POST` HTTP verb. +==== Removed `mem` section from `/_cluster/stats` response + +The `mem` section contained only one value, the total memory available +throughout all nodes in the cluster. The section was removed as it didn't +prove useful.