Skip to content

Don't capture ClusterState in all TransportBroadcastByNodeAction #90740

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
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 @@ -14,7 +14,7 @@
import org.elasticsearch.action.datastreams.DataStreamsStatsAction;
import org.elasticsearch.action.support.ActionFilters;
import org.elasticsearch.action.support.DefaultShardOperationFailedException;
import org.elasticsearch.action.support.broadcast.node.TransportBroadcastByNodeAction;
import org.elasticsearch.action.support.broadcast.node.AbstractTransportBroadcastByNodeAction;
import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.cluster.block.ClusterBlockException;
import org.elasticsearch.cluster.block.ClusterBlockLevel;
Expand Down Expand Up @@ -46,7 +46,7 @@
import java.util.SortedMap;
import java.util.stream.Stream;

public class DataStreamsStatsTransportAction extends TransportBroadcastByNodeAction<
public class DataStreamsStatsTransportAction extends AbstractTransportBroadcastByNodeAction<
DataStreamsStatsAction.Request,
DataStreamsStatsAction.Response,
DataStreamsStatsAction.DataStreamShardStats> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.support.ActionFilters;
import org.elasticsearch.action.support.DefaultShardOperationFailedException;
import org.elasticsearch.action.support.broadcast.node.AbstractTransportBroadcastByNodeAction;
import org.elasticsearch.action.support.broadcast.node.TransportBroadcastByNodeAction;
import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.cluster.block.ClusterBlockException;
Expand All @@ -35,7 +36,7 @@
public class TransportClearIndicesCacheAction extends TransportBroadcastByNodeAction<
ClearIndicesCacheRequest,
ClearIndicesCacheResponse,
TransportBroadcastByNodeAction.EmptyResult> {
AbstractTransportBroadcastByNodeAction.EmptyResult> {

private final IndicesService indicesService;

Expand Down Expand Up @@ -72,8 +73,7 @@ protected ClearIndicesCacheResponse newResponse(
int successfulShards,
int failedShards,
List<EmptyResult> responses,
List<DefaultShardOperationFailedException> shardFailures,
ClusterState clusterState
List<DefaultShardOperationFailedException> shardFailures
) {
return new ClearIndicesCacheResponse(totalShards, successfulShards, failedShards, shardFailures);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import org.elasticsearch.action.ActionRunnable;
import org.elasticsearch.action.support.ActionFilters;
import org.elasticsearch.action.support.DefaultShardOperationFailedException;
import org.elasticsearch.action.support.broadcast.node.AbstractTransportBroadcastByNodeAction;
import org.elasticsearch.action.support.broadcast.node.TransportBroadcastByNodeAction;
import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.cluster.block.ClusterBlockException;
Expand All @@ -38,7 +39,7 @@
public class TransportForceMergeAction extends TransportBroadcastByNodeAction<
ForceMergeRequest,
ForceMergeResponse,
TransportBroadcastByNodeAction.EmptyResult> {
AbstractTransportBroadcastByNodeAction.EmptyResult> {

private final IndicesService indicesService;
private final ThreadPool threadPool;
Expand Down Expand Up @@ -76,8 +77,7 @@ protected ForceMergeResponse newResponse(
int successfulShards,
int failedShards,
List<EmptyResult> responses,
List<DefaultShardOperationFailedException> shardFailures,
ClusterState clusterState
List<DefaultShardOperationFailedException> shardFailures
) {
return new ForceMergeResponse(totalShards, successfulShards, failedShards, shardFailures);
}
Expand All @@ -92,7 +92,7 @@ protected void shardOperation(
ForceMergeRequest request,
ShardRouting shardRouting,
Task task,
ActionListener<TransportBroadcastByNodeAction.EmptyResult> listener
ActionListener<AbstractTransportBroadcastByNodeAction.EmptyResult> listener
) {
assert (task instanceof CancellableTask) == false; // TODO: add cancellation handling here once the task supports it
threadPool.executor(ThreadPool.Names.FORCE_MERGE).execute(ActionRunnable.supply(listener, () -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ protected RecoveryResponse newResponse(
int successfulShards,
int failedShards,
List<RecoveryState> responses,
List<DefaultShardOperationFailedException> shardFailures,
ClusterState clusterState
List<DefaultShardOperationFailedException> shardFailures
) {
Map<String, List<RecoveryState>> shardResponses = new HashMap<>();
for (RecoveryState recoveryState : responses) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@ protected IndicesSegmentResponse newResponse(
int successfulShards,
int failedShards,
List<ShardSegments> results,
List<DefaultShardOperationFailedException> shardFailures,
ClusterState clusterState
List<DefaultShardOperationFailedException> shardFailures
) {
return new IndicesSegmentResponse(
results.toArray(new ShardSegments[results.size()]),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ protected FieldUsageStatsResponse newResponse(
int successfulShards,
int failedShards,
List<FieldUsageShardResponse> fieldUsages,
List<DefaultShardOperationFailedException> shardFailures,
ClusterState clusterState
List<DefaultShardOperationFailedException> shardFailures
) {
final Map<String, List<FieldUsageShardResponse>> combined = new HashMap<>();
for (FieldUsageShardResponse response : fieldUsages) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.support.ActionFilters;
import org.elasticsearch.action.support.DefaultShardOperationFailedException;
import org.elasticsearch.action.support.broadcast.node.TransportBroadcastByNodeAction;
import org.elasticsearch.action.support.broadcast.node.AbstractTransportBroadcastByNodeAction;
import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.cluster.block.ClusterBlockException;
import org.elasticsearch.cluster.block.ClusterBlockLevel;
Expand All @@ -37,7 +37,10 @@
import java.io.IOException;
import java.util.List;

public class TransportIndicesStatsAction extends TransportBroadcastByNodeAction<IndicesStatsRequest, IndicesStatsResponse, ShardStats> {
public class TransportIndicesStatsAction extends AbstractTransportBroadcastByNodeAction<
IndicesStatsRequest,
IndicesStatsResponse,
ShardStats> {

private final IndicesService indicesService;

Expand Down
Loading