diff --git a/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/status/TransportNodesSnapshotsStatus.java b/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/status/TransportNodesSnapshotsStatus.java index da93831c7a8..14265bf786d 100644 --- a/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/status/TransportNodesSnapshotsStatus.java +++ b/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/status/TransportNodesSnapshotsStatus.java @@ -22,7 +22,7 @@ package org.elasticsearch.action.admin.cluster.snapshots.status; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; import org.elasticsearch.ElasticsearchException; -import org.elasticsearch.action.ActionListener; +import org.elasticsearch.action.ActionRequest; import org.elasticsearch.action.FailedNodeException; import org.elasticsearch.action.support.ActionFilters; import org.elasticsearch.action.support.nodes.*; @@ -30,12 +30,10 @@ import org.elasticsearch.cluster.ClusterName; import org.elasticsearch.cluster.ClusterService; import org.elasticsearch.cluster.metadata.SnapshotId; import org.elasticsearch.cluster.node.DiscoveryNode; -import org.elasticsearch.common.Nullable; import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.index.snapshots.IndexShardSnapshotStatus; import org.elasticsearch.snapshots.SnapshotsService; @@ -61,10 +59,6 @@ public class TransportNodesSnapshotsStatus extends TransportNodesOperationAction this.snapshotsService = snapshotsService; } - public void status(String[] nodesIds, SnapshotId[] snapshotIds, @Nullable TimeValue timeout, ActionListener listener) { - execute(new Request(nodesIds).snapshotIds(snapshotIds).timeout(timeout), listener); - } - @Override protected String executor() { return ThreadPool.Names.GENERIC; @@ -155,8 +149,8 @@ public class TransportNodesSnapshotsStatus extends TransportNodesOperationAction public Request() { } - public Request(String[] nodesIds) { - super(nodesIds); + public Request(ActionRequest request, String[] nodesIds) { + super(request, nodesIds); } public Request snapshotIds(SnapshotId[] snapshotIds) { diff --git a/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/status/TransportSnapshotsStatusAction.java b/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/status/TransportSnapshotsStatusAction.java index e60d8b63d72..967ac3808ec 100644 --- a/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/status/TransportSnapshotsStatusAction.java +++ b/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/status/TransportSnapshotsStatusAction.java @@ -21,7 +21,6 @@ package org.elasticsearch.action.admin.cluster.snapshots.status; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; -import org.elasticsearch.ElasticsearchException; import org.elasticsearch.ElasticsearchIllegalArgumentException; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.support.ActionFilters; @@ -111,8 +110,9 @@ public class TransportSnapshotsStatusAction extends TransportMasterNodeOperation snapshotIds[i] = currentSnapshots.get(i).snapshotId(); } - transportNodesSnapshotsStatus.status(nodesIds.toArray(new String[nodesIds.size()]), - snapshotIds, request.masterNodeTimeout(), new ActionListener() { + TransportNodesSnapshotsStatus.Request nodesRequest = new TransportNodesSnapshotsStatus.Request(request, nodesIds.toArray(new String[nodesIds.size()])) + .snapshotIds(snapshotIds).timeout(request.masterNodeTimeout()); + transportNodesSnapshotsStatus.execute(nodesRequest, new ActionListener() { @Override public void onResponse(TransportNodesSnapshotsStatus.NodesSnapshotStatus nodeSnapshotStatuses) { try { diff --git a/src/main/java/org/elasticsearch/action/support/nodes/NodesOperationRequest.java b/src/main/java/org/elasticsearch/action/support/nodes/NodesOperationRequest.java index f92f7c2ec4c..113e03f1f3c 100644 --- a/src/main/java/org/elasticsearch/action/support/nodes/NodesOperationRequest.java +++ b/src/main/java/org/elasticsearch/action/support/nodes/NodesOperationRequest.java @@ -43,6 +43,11 @@ public abstract class NodesOperationRequest ext } + protected NodesOperationRequest(ActionRequest request, String... nodesIds) { + super(request); + this.nodesIds = nodesIds; + } + protected NodesOperationRequest(String... nodesIds) { this.nodesIds = nodesIds; }