Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@

package org.elasticsearch.rest.action.cat;

import com.carrotsearch.hppc.ObjectIntScatterMap;

import org.elasticsearch.action.admin.cluster.node.stats.NodeStats;
import org.elasticsearch.action.admin.cluster.node.stats.NodesStatsRequest;
import org.elasticsearch.action.admin.cluster.node.stats.NodesStatsResponse;
Expand All @@ -27,7 +25,9 @@
import org.elasticsearch.rest.action.RestActionListener;
import org.elasticsearch.rest.action.RestResponseListener;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import static org.elasticsearch.rest.RestRequest.Method.GET;

Expand Down Expand Up @@ -94,7 +94,7 @@ protected Table getTableWithHeader(final RestRequest request) {
}

private Table buildTable(RestRequest request, final ClusterStateResponse state, final NodesStatsResponse stats) {
final ObjectIntScatterMap<String> allocs = new ObjectIntScatterMap<>();
final Map<String, Integer> allocs = new HashMap<>();

for (ShardRouting shard : state.getState().routingTable().allShards()) {
String nodeId = "UNASSIGNED";
Expand All @@ -103,7 +103,7 @@ private Table buildTable(RestRequest request, final ClusterStateResponse state,
nodeId = shard.currentNodeId();
}

allocs.addTo(nodeId, 1);
allocs.merge(nodeId, 1, Integer::sum);
}

Table table = getTableWithHeader(request);
Expand Down