Skip to content

Commit 4974603

Browse files
committed
Merge branch '6.x' into ccr-6.x
* 6.x: Trim down usages of `ShardOperationFailedException` interface (#28312) Clean up commits when global checkpoint advanced (#28140) Do not return all indices if a specific alias is requested via get aliases api. CountedBitSet doesn't need to extend BitSet. (#28239) Calculate sum in Kahan summation algorithm in aggregations (#27807) (#27848)
2 parents 88a320f + 1dc8cb0 commit 4974603

File tree

68 files changed

+788
-213
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+788
-213
lines changed

server/src/main/java/org/elasticsearch/action/admin/indices/alias/get/TransportGetAliasesAction.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@ protected GetAliasesResponse newResponse() {
6262
@Override
6363
protected void masterOperation(GetAliasesRequest request, ClusterState state, ActionListener<GetAliasesResponse> listener) {
6464
String[] concreteIndices = indexNameExpressionResolver.concreteIndexNames(state, request);
65-
@SuppressWarnings("unchecked")
66-
ImmutableOpenMap<String, List<AliasMetaData>> result = (ImmutableOpenMap) state.metaData().findAliases(request.aliases(), concreteIndices);
65+
ImmutableOpenMap<String, List<AliasMetaData>> result = state.metaData().findAliases(request.aliases(), concreteIndices);
6766
listener.onResponse(new GetAliasesResponse(result));
6867
}
6968

server/src/main/java/org/elasticsearch/action/admin/indices/cache/clear/ClearIndicesCacheResponse.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
package org.elasticsearch.action.admin.indices.cache.clear;
2121

22-
import org.elasticsearch.action.ShardOperationFailedException;
22+
import org.elasticsearch.action.support.DefaultShardOperationFailedException;
2323
import org.elasticsearch.action.support.broadcast.BroadcastResponse;
2424
import org.elasticsearch.common.io.stream.StreamInput;
2525
import org.elasticsearch.common.io.stream.StreamOutput;
@@ -38,7 +38,8 @@ public class ClearIndicesCacheResponse extends BroadcastResponse {
3838

3939
}
4040

41-
ClearIndicesCacheResponse(int totalShards, int successfulShards, int failedShards, List<ShardOperationFailedException> shardFailures) {
41+
ClearIndicesCacheResponse(int totalShards, int successfulShards, int failedShards,
42+
List<DefaultShardOperationFailedException> shardFailures) {
4243
super(totalShards, successfulShards, failedShards, shardFailures);
4344
}
4445

server/src/main/java/org/elasticsearch/action/admin/indices/cache/clear/TransportClearIndicesCacheAction.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919

2020
package org.elasticsearch.action.admin.indices.cache.clear;
2121

22-
import org.elasticsearch.action.ShardOperationFailedException;
2322
import org.elasticsearch.action.support.ActionFilters;
23+
import org.elasticsearch.action.support.DefaultShardOperationFailedException;
2424
import org.elasticsearch.action.support.broadcast.node.TransportBroadcastByNodeAction;
2525
import org.elasticsearch.cluster.ClusterState;
2626
import org.elasticsearch.cluster.block.ClusterBlockException;
@@ -65,7 +65,7 @@ protected EmptyResult readShardResult(StreamInput in) throws IOException {
6565
@Override
6666
protected ClearIndicesCacheResponse newResponse(ClearIndicesCacheRequest request, int totalShards, int successfulShards,
6767
int failedShards, List<EmptyResult> responses,
68-
List<ShardOperationFailedException> shardFailures, ClusterState clusterState) {
68+
List<DefaultShardOperationFailedException> shardFailures, ClusterState clusterState) {
6969
return new ClearIndicesCacheResponse(totalShards, successfulShards, failedShards, shardFailures);
7070
}
7171

server/src/main/java/org/elasticsearch/action/admin/indices/flush/FlushResponse.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
package org.elasticsearch.action.admin.indices.flush;
2121

22-
import org.elasticsearch.action.ShardOperationFailedException;
22+
import org.elasticsearch.action.support.DefaultShardOperationFailedException;
2323
import org.elasticsearch.action.support.broadcast.BroadcastResponse;
2424

2525
import java.util.List;
@@ -35,7 +35,7 @@ public class FlushResponse extends BroadcastResponse {
3535

3636
}
3737

38-
FlushResponse(int totalShards, int successfulShards, int failedShards, List<ShardOperationFailedException> shardFailures) {
38+
FlushResponse(int totalShards, int successfulShards, int failedShards, List<DefaultShardOperationFailedException> shardFailures) {
3939
super(totalShards, successfulShards, failedShards, shardFailures);
4040
}
4141

server/src/main/java/org/elasticsearch/action/admin/indices/flush/TransportFlushAction.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919

2020
package org.elasticsearch.action.admin.indices.flush;
2121

22-
import org.elasticsearch.action.ShardOperationFailedException;
2322
import org.elasticsearch.action.support.ActionFilters;
23+
import org.elasticsearch.action.support.DefaultShardOperationFailedException;
2424
import org.elasticsearch.action.support.replication.ReplicationResponse;
2525
import org.elasticsearch.action.support.replication.TransportBroadcastReplicationAction;
2626
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
@@ -57,7 +57,8 @@ protected ShardFlushRequest newShardRequest(FlushRequest request, ShardId shardI
5757
}
5858

5959
@Override
60-
protected FlushResponse newResponse(int successfulShards, int failedShards, int totalNumCopies, List<ShardOperationFailedException> shardFailures) {
60+
protected FlushResponse newResponse(int successfulShards, int failedShards, int totalNumCopies, List
61+
<DefaultShardOperationFailedException> shardFailures) {
6162
return new FlushResponse(totalNumCopies, successfulShards, failedShards, shardFailures);
6263
}
6364
}

server/src/main/java/org/elasticsearch/action/admin/indices/forcemerge/ForceMergeResponse.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
package org.elasticsearch.action.admin.indices.forcemerge;
2121

22-
import org.elasticsearch.action.ShardOperationFailedException;
22+
import org.elasticsearch.action.support.DefaultShardOperationFailedException;
2323
import org.elasticsearch.action.support.broadcast.BroadcastResponse;
2424

2525
import java.util.List;
@@ -32,7 +32,7 @@ public class ForceMergeResponse extends BroadcastResponse {
3232
ForceMergeResponse() {
3333
}
3434

35-
ForceMergeResponse(int totalShards, int successfulShards, int failedShards, List<ShardOperationFailedException> shardFailures) {
35+
ForceMergeResponse(int totalShards, int successfulShards, int failedShards, List<DefaultShardOperationFailedException> shardFailures) {
3636
super(totalShards, successfulShards, failedShards, shardFailures);
3737
}
3838
}

server/src/main/java/org/elasticsearch/action/admin/indices/forcemerge/TransportForceMergeAction.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919

2020
package org.elasticsearch.action.admin.indices.forcemerge;
2121

22-
import org.elasticsearch.action.ShardOperationFailedException;
2322
import org.elasticsearch.action.support.ActionFilters;
23+
import org.elasticsearch.action.support.DefaultShardOperationFailedException;
2424
import org.elasticsearch.action.support.broadcast.node.TransportBroadcastByNodeAction;
2525
import org.elasticsearch.cluster.ClusterState;
2626
import org.elasticsearch.cluster.block.ClusterBlockException;
@@ -62,7 +62,7 @@ protected EmptyResult readShardResult(StreamInput in) throws IOException {
6262
}
6363

6464
@Override
65-
protected ForceMergeResponse newResponse(ForceMergeRequest request, int totalShards, int successfulShards, int failedShards, List<EmptyResult> responses, List<ShardOperationFailedException> shardFailures, ClusterState clusterState) {
65+
protected ForceMergeResponse newResponse(ForceMergeRequest request, int totalShards, int successfulShards, int failedShards, List<EmptyResult> responses, List<DefaultShardOperationFailedException> shardFailures, ClusterState clusterState) {
6666
return new ForceMergeResponse(totalShards, successfulShards, failedShards, shardFailures);
6767
}
6868

server/src/main/java/org/elasticsearch/action/admin/indices/recovery/RecoveryResponse.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
package org.elasticsearch.action.admin.indices.recovery;
2121

22-
import org.elasticsearch.action.ShardOperationFailedException;
22+
import org.elasticsearch.action.support.DefaultShardOperationFailedException;
2323
import org.elasticsearch.action.support.broadcast.BroadcastResponse;
2424
import org.elasticsearch.common.Strings;
2525
import org.elasticsearch.common.io.stream.StreamInput;
@@ -56,7 +56,8 @@ public RecoveryResponse() { }
5656
* @param shardFailures List of failures processing shards
5757
*/
5858
public RecoveryResponse(int totalShards, int successfulShards, int failedShards, boolean detailed,
59-
Map<String, List<RecoveryState>> shardRecoveryStates, List<ShardOperationFailedException> shardFailures) {
59+
Map<String, List<RecoveryState>> shardRecoveryStates,
60+
List<DefaultShardOperationFailedException> shardFailures) {
6061
super(totalShards, successfulShards, failedShards, shardFailures);
6162
this.shardRecoveryStates = shardRecoveryStates;
6263
this.detailed = detailed;

server/src/main/java/org/elasticsearch/action/admin/indices/recovery/TransportRecoveryAction.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919

2020
package org.elasticsearch.action.admin.indices.recovery;
2121

22-
import org.elasticsearch.action.ShardOperationFailedException;
2322
import org.elasticsearch.action.support.ActionFilters;
23+
import org.elasticsearch.action.support.DefaultShardOperationFailedException;
2424
import org.elasticsearch.action.support.broadcast.node.TransportBroadcastByNodeAction;
2525
import org.elasticsearch.cluster.ClusterState;
2626
import org.elasticsearch.cluster.block.ClusterBlockException;
@@ -69,7 +69,7 @@ protected RecoveryState readShardResult(StreamInput in) throws IOException {
6969

7070

7171
@Override
72-
protected RecoveryResponse newResponse(RecoveryRequest request, int totalShards, int successfulShards, int failedShards, List<RecoveryState> responses, List<ShardOperationFailedException> shardFailures, ClusterState clusterState) {
72+
protected RecoveryResponse newResponse(RecoveryRequest request, int totalShards, int successfulShards, int failedShards, List<RecoveryState> responses, List<DefaultShardOperationFailedException> shardFailures, ClusterState clusterState) {
7373
Map<String, List<RecoveryState>> shardResponses = new HashMap<>();
7474
for (RecoveryState recoveryState : responses) {
7575
if (recoveryState == null) {

server/src/main/java/org/elasticsearch/action/admin/indices/refresh/RefreshResponse.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
package org.elasticsearch.action.admin.indices.refresh;
2121

22-
import org.elasticsearch.action.ShardOperationFailedException;
22+
import org.elasticsearch.action.support.DefaultShardOperationFailedException;
2323
import org.elasticsearch.action.support.broadcast.BroadcastResponse;
2424

2525
import java.util.List;
@@ -32,7 +32,7 @@ public class RefreshResponse extends BroadcastResponse {
3232
RefreshResponse() {
3333
}
3434

35-
RefreshResponse(int totalShards, int successfulShards, int failedShards, List<ShardOperationFailedException> shardFailures) {
35+
RefreshResponse(int totalShards, int successfulShards, int failedShards, List<DefaultShardOperationFailedException> shardFailures) {
3636
super(totalShards, successfulShards, failedShards, shardFailures);
3737
}
3838
}

server/src/main/java/org/elasticsearch/action/admin/indices/refresh/TransportRefreshAction.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919

2020
package org.elasticsearch.action.admin.indices.refresh;
2121

22-
import org.elasticsearch.action.ShardOperationFailedException;
2322
import org.elasticsearch.action.support.ActionFilters;
2423
import org.elasticsearch.action.support.ActiveShardCount;
24+
import org.elasticsearch.action.support.DefaultShardOperationFailedException;
2525
import org.elasticsearch.action.support.replication.BasicReplicationRequest;
2626
import org.elasticsearch.action.support.replication.ReplicationResponse;
2727
import org.elasticsearch.action.support.replication.TransportBroadcastReplicationAction;
@@ -61,7 +61,8 @@ protected BasicReplicationRequest newShardRequest(RefreshRequest request, ShardI
6161
}
6262

6363
@Override
64-
protected RefreshResponse newResponse(int successfulShards, int failedShards, int totalNumCopies, List<ShardOperationFailedException> shardFailures) {
64+
protected RefreshResponse newResponse(int successfulShards, int failedShards, int totalNumCopies,
65+
List<DefaultShardOperationFailedException> shardFailures) {
6566
return new RefreshResponse(totalNumCopies, successfulShards, failedShards, shardFailures);
6667
}
6768
}

server/src/main/java/org/elasticsearch/action/admin/indices/segments/IndicesSegmentResponse.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import org.apache.lucene.search.SortedNumericSortField;
2525
import org.apache.lucene.search.SortedSetSortField;
2626
import org.apache.lucene.util.Accountable;
27-
import org.elasticsearch.action.ShardOperationFailedException;
27+
import org.elasticsearch.action.support.DefaultShardOperationFailedException;
2828
import org.elasticsearch.action.support.broadcast.BroadcastResponse;
2929
import org.elasticsearch.common.io.stream.StreamInput;
3030
import org.elasticsearch.common.io.stream.StreamOutput;
@@ -53,7 +53,8 @@ public class IndicesSegmentResponse extends BroadcastResponse implements ToXCont
5353

5454
}
5555

56-
IndicesSegmentResponse(ShardSegments[] shards, int totalShards, int successfulShards, int failedShards, List<ShardOperationFailedException> shardFailures) {
56+
IndicesSegmentResponse(ShardSegments[] shards, int totalShards, int successfulShards, int failedShards,
57+
List<DefaultShardOperationFailedException> shardFailures) {
5758
super(totalShards, successfulShards, failedShards, shardFailures);
5859
this.shards = shards;
5960
}

server/src/main/java/org/elasticsearch/action/admin/indices/segments/TransportIndicesSegmentsAction.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919

2020
package org.elasticsearch.action.admin.indices.segments;
2121

22-
import org.elasticsearch.action.ShardOperationFailedException;
2322
import org.elasticsearch.action.support.ActionFilters;
23+
import org.elasticsearch.action.support.DefaultShardOperationFailedException;
2424
import org.elasticsearch.action.support.broadcast.node.TransportBroadcastByNodeAction;
2525
import org.elasticsearch.cluster.ClusterState;
2626
import org.elasticsearch.cluster.block.ClusterBlockException;
@@ -77,7 +77,7 @@ protected ShardSegments readShardResult(StreamInput in) throws IOException {
7777
}
7878

7979
@Override
80-
protected IndicesSegmentResponse newResponse(IndicesSegmentsRequest request, int totalShards, int successfulShards, int failedShards, List<ShardSegments> results, List<ShardOperationFailedException> shardFailures, ClusterState clusterState) {
80+
protected IndicesSegmentResponse newResponse(IndicesSegmentsRequest request, int totalShards, int successfulShards, int failedShards, List<ShardSegments> results, List<DefaultShardOperationFailedException> shardFailures, ClusterState clusterState) {
8181
return new IndicesSegmentResponse(results.toArray(new ShardSegments[results.size()]), totalShards, successfulShards, failedShards, shardFailures);
8282
}
8383

server/src/main/java/org/elasticsearch/action/admin/indices/shards/IndicesShardStoresResponse.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import org.elasticsearch.ElasticsearchException;
2626
import org.elasticsearch.Version;
2727
import org.elasticsearch.action.ActionResponse;
28-
import org.elasticsearch.action.ShardOperationFailedException;
2928
import org.elasticsearch.action.support.DefaultShardOperationFailedException;
3029
import org.elasticsearch.cluster.node.DiscoveryNode;
3130
import org.elasticsearch.common.collect.ImmutableOpenIntMap;
@@ -348,7 +347,7 @@ public void writeTo(StreamOutput out) throws IOException {
348347
}
349348
}
350349
out.writeVInt(failures.size());
351-
for (ShardOperationFailedException failure : failures) {
350+
for (Failure failure : failures) {
352351
failure.writeTo(out);
353352
}
354353
}
@@ -357,7 +356,7 @@ public void writeTo(StreamOutput out) throws IOException {
357356
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
358357
if (failures.size() > 0) {
359358
builder.startArray(Fields.FAILURES);
360-
for (ShardOperationFailedException failure : failures) {
359+
for (Failure failure : failures) {
361360
builder.startObject();
362361
failure.toXContent(builder, params);
363362
builder.endObject();

server/src/main/java/org/elasticsearch/action/admin/indices/stats/IndicesStatsResponse.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
package org.elasticsearch.action.admin.indices.stats;
2121

22-
import org.elasticsearch.action.ShardOperationFailedException;
22+
import org.elasticsearch.action.support.DefaultShardOperationFailedException;
2323
import org.elasticsearch.action.support.broadcast.BroadcastResponse;
2424
import org.elasticsearch.cluster.routing.ShardRouting;
2525
import org.elasticsearch.common.io.stream.StreamInput;
@@ -48,7 +48,8 @@ public class IndicesStatsResponse extends BroadcastResponse implements ToXConten
4848

4949
}
5050

51-
IndicesStatsResponse(ShardStats[] shards, int totalShards, int successfulShards, int failedShards, List<ShardOperationFailedException> shardFailures) {
51+
IndicesStatsResponse(ShardStats[] shards, int totalShards, int successfulShards, int failedShards,
52+
List<DefaultShardOperationFailedException> shardFailures) {
5253
super(totalShards, successfulShards, failedShards, shardFailures);
5354
this.shards = shards;
5455
}

server/src/main/java/org/elasticsearch/action/admin/indices/stats/TransportIndicesStatsAction.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919

2020
package org.elasticsearch.action.admin.indices.stats;
2121

22-
import org.elasticsearch.action.ShardOperationFailedException;
2322
import org.elasticsearch.action.support.ActionFilters;
23+
import org.elasticsearch.action.support.DefaultShardOperationFailedException;
2424
import org.elasticsearch.action.support.broadcast.node.TransportBroadcastByNodeAction;
2525
import org.elasticsearch.cluster.ClusterState;
2626
import org.elasticsearch.cluster.block.ClusterBlockException;
@@ -79,7 +79,7 @@ protected ShardStats readShardResult(StreamInput in) throws IOException {
7979
}
8080

8181
@Override
82-
protected IndicesStatsResponse newResponse(IndicesStatsRequest request, int totalShards, int successfulShards, int failedShards, List<ShardStats> responses, List<ShardOperationFailedException> shardFailures, ClusterState clusterState) {
82+
protected IndicesStatsResponse newResponse(IndicesStatsRequest request, int totalShards, int successfulShards, int failedShards, List<ShardStats> responses, List<DefaultShardOperationFailedException> shardFailures, ClusterState clusterState) {
8383
return new IndicesStatsResponse(responses.toArray(new ShardStats[responses.size()]), totalShards, successfulShards, failedShards, shardFailures);
8484
}
8585

server/src/main/java/org/elasticsearch/action/admin/indices/upgrade/get/TransportUpgradeStatusAction.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
package org.elasticsearch.action.admin.indices.upgrade.get;
2121

2222
import org.elasticsearch.Version;
23-
import org.elasticsearch.action.ShardOperationFailedException;
2423
import org.elasticsearch.action.support.ActionFilters;
24+
import org.elasticsearch.action.support.DefaultShardOperationFailedException;
2525
import org.elasticsearch.action.support.broadcast.node.TransportBroadcastByNodeAction;
2626
import org.elasticsearch.cluster.ClusterState;
2727
import org.elasticsearch.cluster.block.ClusterBlockException;
@@ -79,7 +79,7 @@ protected ShardUpgradeStatus readShardResult(StreamInput in) throws IOException
7979
}
8080

8181
@Override
82-
protected UpgradeStatusResponse newResponse(UpgradeStatusRequest request, int totalShards, int successfulShards, int failedShards, List<ShardUpgradeStatus> responses, List<ShardOperationFailedException> shardFailures, ClusterState clusterState) {
82+
protected UpgradeStatusResponse newResponse(UpgradeStatusRequest request, int totalShards, int successfulShards, int failedShards, List<ShardUpgradeStatus> responses, List<DefaultShardOperationFailedException> shardFailures, ClusterState clusterState) {
8383
return new UpgradeStatusResponse(responses.toArray(new ShardUpgradeStatus[responses.size()]), totalShards, successfulShards, failedShards, shardFailures);
8484
}
8585

server/src/main/java/org/elasticsearch/action/admin/indices/upgrade/get/UpgradeStatusResponse.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,10 @@
1919

2020
package org.elasticsearch.action.admin.indices.upgrade.get;
2121

22-
import org.elasticsearch.action.ShardOperationFailedException;
22+
import org.elasticsearch.action.support.DefaultShardOperationFailedException;
2323
import org.elasticsearch.action.support.broadcast.BroadcastResponse;
2424
import org.elasticsearch.common.io.stream.StreamInput;
2525
import org.elasticsearch.common.io.stream.StreamOutput;
26-
import org.elasticsearch.common.xcontent.ToXContent.Params;
2726
import org.elasticsearch.common.xcontent.ToXContentFragment;
2827
import org.elasticsearch.common.xcontent.XContentBuilder;
2928

@@ -43,7 +42,8 @@ public class UpgradeStatusResponse extends BroadcastResponse implements ToXConte
4342
UpgradeStatusResponse() {
4443
}
4544

46-
UpgradeStatusResponse(ShardUpgradeStatus[] shards, int totalShards, int successfulShards, int failedShards, List<ShardOperationFailedException> shardFailures) {
45+
UpgradeStatusResponse(ShardUpgradeStatus[] shards, int totalShards, int successfulShards, int failedShards,
46+
List<DefaultShardOperationFailedException> shardFailures) {
4747
super(totalShards, successfulShards, failedShards, shardFailures);
4848
this.shards = shards;
4949
}

0 commit comments

Comments
 (0)