Class TransportRecoveryAction
java.lang.Object
org.elasticsearch.action.support.TransportAction<Request,Response>
org.elasticsearch.action.support.HandledTransportAction<Request,Response>
org.elasticsearch.action.support.broadcast.node.TransportBroadcastByNodeAction<RecoveryRequest,RecoveryResponse,RecoveryState>
org.elasticsearch.action.admin.indices.recovery.TransportRecoveryAction
public class TransportRecoveryAction extends TransportBroadcastByNodeAction<RecoveryRequest,RecoveryResponse,RecoveryState>
Transport action for shard recovery operation. This transport action does not actually
perform shard recovery, it only reports on recoveries (both active and complete).
-
Nested Class Summary
Nested classes/interfaces inherited from class org.elasticsearch.action.support.broadcast.node.TransportBroadcastByNodeAction
TransportBroadcastByNodeAction.AsyncAction, TransportBroadcastByNodeAction.EmptyResult, TransportBroadcastByNodeAction.NodeRequest -
Field Summary
Fields inherited from class org.elasticsearch.action.support.TransportAction
actionName, localConnection, logger, taskManager -
Constructor Summary
Constructors Constructor Description TransportRecoveryAction(ClusterService clusterService, TransportService transportService, IndicesService indicesService, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) -
Method Summary
Modifier and Type Method Description protected ClusterBlockExceptioncheckGlobalBlock(ClusterState state, RecoveryRequest request)Executes a global block check before polling the cluster state.protected ClusterBlockExceptioncheckRequestBlock(ClusterState state, RecoveryRequest request, java.lang.String[] concreteIndices)Executes a global request-level check before polling the cluster state.protected RecoveryResponsenewResponse(RecoveryRequest request, int totalShards, int successfulShards, int failedShards, java.util.List<RecoveryState> responses, java.util.List<DefaultShardOperationFailedException> shardFailures, ClusterState clusterState)Creates a new response to the underlying request.protected RecoveryRequestreadRequestFrom(StreamInput in)Deserialize a request from an input streamprotected RecoveryStatereadShardResult(StreamInput in)Deserialize a shard-level result from an input streamprotected RecoveryStateshardOperation(RecoveryRequest request, ShardRouting shardRouting, Task task)Executes the shard-level operation.protected ShardsIteratorshards(ClusterState state, RecoveryRequest request, java.lang.String[] concreteIndices)Determines the shards on which this operation will be executed on.Methods inherited from class org.elasticsearch.action.support.broadcast.node.TransportBroadcastByNodeAction
doExecute, resolveConcreteIndexNamesMethods inherited from class org.elasticsearch.action.support.TransportAction
execute, execute, executeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
TransportRecoveryAction
@Inject public TransportRecoveryAction(ClusterService clusterService, TransportService transportService, IndicesService indicesService, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver)
-
-
Method Details
-
readShardResult
Description copied from class:TransportBroadcastByNodeActionDeserialize a shard-level result from an input stream- Specified by:
readShardResultin classTransportBroadcastByNodeAction<RecoveryRequest,RecoveryResponse,RecoveryState>- Parameters:
in- input stream- Returns:
- a deserialized shard-level result
- Throws:
java.io.IOException
-
newResponse
protected RecoveryResponse newResponse(RecoveryRequest request, int totalShards, int successfulShards, int failedShards, java.util.List<RecoveryState> responses, java.util.List<DefaultShardOperationFailedException> shardFailures, ClusterState clusterState)Description copied from class:TransportBroadcastByNodeActionCreates a new response to the underlying request.- Specified by:
newResponsein classTransportBroadcastByNodeAction<RecoveryRequest,RecoveryResponse,RecoveryState>- Parameters:
request- the underlying requesttotalShards- the total number of shards considered for execution of the operationsuccessfulShards- the total number of shards for which execution of the operation was successfulfailedShards- the total number of shards for which execution of the operation failedresponses- the per-node aggregated shard-level resultsshardFailures- the exceptions corresponding to shard operation failuresclusterState- the cluster state- Returns:
- the response
-
readRequestFrom
Description copied from class:TransportBroadcastByNodeActionDeserialize a request from an input stream- Specified by:
readRequestFromin classTransportBroadcastByNodeAction<RecoveryRequest,RecoveryResponse,RecoveryState>- Parameters:
in- input stream- Returns:
- a de-serialized request
- Throws:
java.io.IOException
-
shardOperation
protected RecoveryState shardOperation(RecoveryRequest request, ShardRouting shardRouting, Task task)Description copied from class:TransportBroadcastByNodeActionExecutes the shard-level operation. This method is called once per shard serially on the receiving node.- Specified by:
shardOperationin classTransportBroadcastByNodeAction<RecoveryRequest,RecoveryResponse,RecoveryState>- Parameters:
request- the node-level requestshardRouting- the shard on which to execute the operationtask- the task for this node-level request- Returns:
- the result of the shard-level operation for the shard
-
shards
protected ShardsIterator shards(ClusterState state, RecoveryRequest request, java.lang.String[] concreteIndices)Description copied from class:TransportBroadcastByNodeActionDetermines the shards on which this operation will be executed on. The operation is executed once per shard.- Specified by:
shardsin classTransportBroadcastByNodeAction<RecoveryRequest,RecoveryResponse,RecoveryState>- Parameters:
state- the cluster staterequest- the underlying requestconcreteIndices- the concrete indices on which to execute the operation- Returns:
- the shards on which to execute the operation
-
checkGlobalBlock
Description copied from class:TransportBroadcastByNodeActionExecutes a global block check before polling the cluster state.- Specified by:
checkGlobalBlockin classTransportBroadcastByNodeAction<RecoveryRequest,RecoveryResponse,RecoveryState>- Parameters:
state- the cluster staterequest- the underlying request- Returns:
- a non-null exception if the operation is blocked
-
checkRequestBlock
protected ClusterBlockException checkRequestBlock(ClusterState state, RecoveryRequest request, java.lang.String[] concreteIndices)Description copied from class:TransportBroadcastByNodeActionExecutes a global request-level check before polling the cluster state.- Specified by:
checkRequestBlockin classTransportBroadcastByNodeAction<RecoveryRequest,RecoveryResponse,RecoveryState>- Parameters:
state- the cluster staterequest- the underlying requestconcreteIndices- the concrete indices on which to execute the operation- Returns:
- a non-null exception if the operation if blocked
-