Class TransportUpgradeAction
java.lang.Object
org.elasticsearch.action.support.TransportAction<Request,Response>
org.elasticsearch.action.support.HandledTransportAction<Request,Response>
org.elasticsearch.action.support.broadcast.node.TransportBroadcastByNodeAction<UpgradeRequest,UpgradeResponse,org.elasticsearch.action.admin.indices.upgrade.post.ShardUpgradeResult>
org.elasticsearch.action.admin.indices.upgrade.post.TransportUpgradeAction
public class TransportUpgradeAction
extends TransportBroadcastByNodeAction<UpgradeRequest,UpgradeResponse,org.elasticsearch.action.admin.indices.upgrade.post.ShardUpgradeResult>
Upgrade index/indices action.
-
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
ConstructorDescriptionTransportUpgradeAction(ClusterService clusterService, TransportService transportService, IndicesService indicesService, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, NodeClient client)
-
Method Summary
Modifier and TypeMethodDescriptionprotected ClusterBlockException
checkGlobalBlock(ClusterState state, UpgradeRequest request)
Executes a global block check before polling the cluster state.protected ClusterBlockException
checkRequestBlock(ClusterState state, UpgradeRequest request, String[] concreteIndices)
Executes a global request-level check before polling the cluster state.protected void
doExecute(Task task, UpgradeRequest request, ActionListener<UpgradeResponse> listener)
protected UpgradeResponse
newResponse(UpgradeRequest request, int totalShards, int successfulShards, int failedShards, List<org.elasticsearch.action.admin.indices.upgrade.post.ShardUpgradeResult> shardUpgradeResults, List<DefaultShardOperationFailedException> shardFailures, ClusterState clusterState)
Creates a new response to the underlying request.protected UpgradeRequest
Deserialize a request from an input streamprotected org.elasticsearch.action.admin.indices.upgrade.post.ShardUpgradeResult
Deserialize a shard-level result from an input streamprotected void
shardOperation(UpgradeRequest request, ShardRouting shardRouting, Task task, ActionListener<org.elasticsearch.action.admin.indices.upgrade.post.ShardUpgradeResult> listener)
Executes the shard-level operation.protected ShardsIterator
shards(ClusterState clusterState, UpgradeRequest request, String[] concreteIndices)
The upgrade request works against *all* shards.Methods inherited from class org.elasticsearch.action.support.broadcast.node.TransportBroadcastByNodeAction
resolveConcreteIndexNames
Methods inherited from class org.elasticsearch.action.support.TransportAction
execute, execute, execute
-
Constructor Details
-
TransportUpgradeAction
@Inject public TransportUpgradeAction(ClusterService clusterService, TransportService transportService, IndicesService indicesService, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, NodeClient client)
-
-
Method Details
-
newResponse
protected UpgradeResponse newResponse(UpgradeRequest request, int totalShards, int successfulShards, int failedShards, List<org.elasticsearch.action.admin.indices.upgrade.post.ShardUpgradeResult> shardUpgradeResults, List<DefaultShardOperationFailedException> shardFailures, ClusterState clusterState)Description copied from class:TransportBroadcastByNodeAction
Creates a new response to the underlying request.- Specified by:
newResponse
in classTransportBroadcastByNodeAction<UpgradeRequest,UpgradeResponse,org.elasticsearch.action.admin.indices.upgrade.post.ShardUpgradeResult>
- 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 failedshardUpgradeResults
- the per-node aggregated shard-level resultsshardFailures
- the exceptions corresponding to shard operation failuresclusterState
- the cluster state- Returns:
- the response
-
shardOperation
protected void shardOperation(UpgradeRequest request, ShardRouting shardRouting, Task task, ActionListener<org.elasticsearch.action.admin.indices.upgrade.post.ShardUpgradeResult> listener)Description copied from class:TransportBroadcastByNodeAction
Executes the shard-level operation. This method is called once per shard serially on the receiving node. This method should not throw an exception, but pass the exception to the listener instead.- Specified by:
shardOperation
in classTransportBroadcastByNodeAction<UpgradeRequest,UpgradeResponse,org.elasticsearch.action.admin.indices.upgrade.post.ShardUpgradeResult>
- Parameters:
request
- the node-level requestshardRouting
- the shard on which to execute the operationtask
- the task for this node-level requestlistener
- the listener to notify with the result of the shard-level operation
-
readShardResult
protected org.elasticsearch.action.admin.indices.upgrade.post.ShardUpgradeResult readShardResult(StreamInput in) throws IOExceptionDescription copied from class:TransportBroadcastByNodeAction
Deserialize a shard-level result from an input stream- Specified by:
readShardResult
in classTransportBroadcastByNodeAction<UpgradeRequest,UpgradeResponse,org.elasticsearch.action.admin.indices.upgrade.post.ShardUpgradeResult>
- Parameters:
in
- input stream- Returns:
- a deserialized shard-level result
- Throws:
IOException
-
readRequestFrom
Description copied from class:TransportBroadcastByNodeAction
Deserialize a request from an input stream- Specified by:
readRequestFrom
in classTransportBroadcastByNodeAction<UpgradeRequest,UpgradeResponse,org.elasticsearch.action.admin.indices.upgrade.post.ShardUpgradeResult>
- Parameters:
in
- input stream- Returns:
- a de-serialized request
- Throws:
IOException
-
shards
protected ShardsIterator shards(ClusterState clusterState, UpgradeRequest request, String[] concreteIndices)The upgrade request works against *all* shards.- Specified by:
shards
in classTransportBroadcastByNodeAction<UpgradeRequest,UpgradeResponse,org.elasticsearch.action.admin.indices.upgrade.post.ShardUpgradeResult>
- Parameters:
clusterState
- 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:TransportBroadcastByNodeAction
Executes a global block check before polling the cluster state.- Specified by:
checkGlobalBlock
in classTransportBroadcastByNodeAction<UpgradeRequest,UpgradeResponse,org.elasticsearch.action.admin.indices.upgrade.post.ShardUpgradeResult>
- Parameters:
state
- the cluster staterequest
- the underlying request- Returns:
- a non-null exception if the operation is blocked
-
checkRequestBlock
protected ClusterBlockException checkRequestBlock(ClusterState state, UpgradeRequest request, String[] concreteIndices)Description copied from class:TransportBroadcastByNodeAction
Executes a global request-level check before polling the cluster state.- Specified by:
checkRequestBlock
in classTransportBroadcastByNodeAction<UpgradeRequest,UpgradeResponse,org.elasticsearch.action.admin.indices.upgrade.post.ShardUpgradeResult>
- 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
-
doExecute
protected void doExecute(Task task, UpgradeRequest request, ActionListener<UpgradeResponse> listener)- Overrides:
doExecute
in classTransportBroadcastByNodeAction<UpgradeRequest,UpgradeResponse,org.elasticsearch.action.admin.indices.upgrade.post.ShardUpgradeResult>
-