Skip to content

Commit ecfa2b6

Browse files
Address review around map
1 parent 60a197e commit ecfa2b6

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

server/src/main/java/org/elasticsearch/action/search/SearchResponse.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,8 @@ public Clusters(Map<String, Cluster> clusterInfoMap) {
615615
public Clusters(Map<String, Cluster> clusterInfoMap, boolean ccsMinimizeRoundtrips) {
616616
assert clusterInfoMap.size() > 0 : "this constructor should not be called with an empty Cluster info map";
617617
this.total = clusterInfoMap.size();
618-
this.clusterInfo = clusterInfoMap;
618+
this.clusterInfo = ConcurrentCollections.newConcurrentMap();
619+
this.clusterInfo.putAll(clusterInfoMap);
619620
this.successful = getClusterStateCount(Cluster.Status.SUCCESSFUL);
620621
this.skipped = getClusterStateCount(Cluster.Status.SKIPPED);
621622
// should only be called if "details" section of fromXContent is present (for ccsMinimizeRoundtrips)

server/src/main/java/org/elasticsearch/action/search/TransportSearchAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1020,7 +1020,7 @@ static SearchResponse.Clusters reconcileProjects(
10201020
expr -> expr.localExpressions().localIndexResolutionResult() == ResolvedIndexExpression.LocalIndexResolutionResult.SUCCESS
10211021
);
10221022

1023-
Map<String, SearchResponse.Cluster> reconciledMap = ConcurrentCollections.newConcurrentMap();
1023+
Map<String, SearchResponse.Cluster> reconciledMap = new HashMap<>();
10241024
for (String project : projects.getClusterAliases()) {
10251025
SearchResponse.Cluster computedProjectInfo = projects.getCluster(project);
10261026
/*

0 commit comments

Comments
 (0)