Skip to content

Commit 85fd019

Browse files
committed
Don't report heap usage in ClusterInfo serialization
1 parent 7275acb commit 85fd019

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

server/src/main/java/org/elasticsearch/cluster/ClusterInfo.java

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
import static org.elasticsearch.cluster.routing.ShardRouting.newUnassigned;
3737
import static org.elasticsearch.cluster.routing.UnassignedInfo.Reason.REINITIALIZED;
3838
import static org.elasticsearch.common.xcontent.ChunkedToXContentHelper.chunk;
39-
import static org.elasticsearch.common.xcontent.ChunkedToXContentHelper.endObject;
39+
import static org.elasticsearch.common.xcontent.ChunkedToXContentHelper.endArray;
4040
import static org.elasticsearch.common.xcontent.ChunkedToXContentHelper.startObject;
4141

4242
/**
@@ -203,17 +203,7 @@ public Iterator<? extends ToXContent> toXContentChunked(ToXContent.Params params
203203
}
204204
return builder.endObject(); // NodeAndPath
205205
}),
206-
chunk(
207-
(builder, p) -> builder.endArray() // end "reserved_sizes"
208-
.startObject("heap_usage")
209-
),
210-
Iterators.map(nodesHeapUsage.entrySet().iterator(), c -> (builder, p) -> {
211-
builder.startObject(c.getKey());
212-
c.getValue().toShortXContent(builder);
213-
builder.endObject();
214-
return builder;
215-
}),
216-
endObject() // end "heap_usage"
206+
endArray() // end "reserved_sizes"
217207
);
218208
}
219209

@@ -334,8 +324,7 @@ public String toString() {
334324

335325
// exposed for tests, computed here rather than exposing all the collections separately
336326
int getChunkCount() {
337-
return leastAvailableSpaceUsage.size() + shardSizes.size() + shardDataSetSizes.size() + dataPath.size() + reservedSpace.size()
338-
+ nodesHeapUsage.size() + 7;
327+
return leastAvailableSpaceUsage.size() + shardSizes.size() + shardDataSetSizes.size() + dataPath.size() + reservedSpace.size() + 6;
339328
}
340329

341330
public record NodeAndShard(String nodeId, ShardId shardId) implements Writeable {

0 commit comments

Comments
 (0)