Class TransportForceMergeAction
java.lang.Object
org.elasticsearch.action.support.TransportAction<Request,Response>
org.elasticsearch.action.support.HandledTransportAction<Request,Response>
org.elasticsearch.action.support.broadcast.node.TransportBroadcastByNodeAction<ForceMergeRequest,ForceMergeResponse,TransportBroadcastByNodeAction.EmptyResult>
org.elasticsearch.action.admin.indices.forcemerge.TransportForceMergeAction
public class TransportForceMergeAction
extends TransportBroadcastByNodeAction<ForceMergeRequest,ForceMergeResponse,TransportBroadcastByNodeAction.EmptyResult>
ForceMerge 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
ConstructorsConstructorDescriptionTransportForceMergeAction(ClusterService clusterService, TransportService transportService, IndicesService indicesService, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) -
Method Summary
Modifier and TypeMethodDescriptionprotected ClusterBlockExceptioncheckGlobalBlock(ClusterState state, ForceMergeRequest request)Executes a global block check before polling the cluster state.protected ClusterBlockExceptioncheckRequestBlock(ClusterState state, ForceMergeRequest request, String[] concreteIndices)Executes a global request-level check before polling the cluster state.protected ForceMergeResponsenewResponse(ForceMergeRequest request, int totalShards, int successfulShards, int failedShards, List<TransportBroadcastByNodeAction.EmptyResult> responses, List<DefaultShardOperationFailedException> shardFailures, ClusterState clusterState)Creates a new response to the underlying request.protected ForceMergeRequestDeserialize a request from an input streamDeserialize a shard-level result from an input streamprotected voidshardOperation(ForceMergeRequest request, ShardRouting shardRouting, Task task, ActionListener<TransportBroadcastByNodeAction.EmptyResult> listener)Executes the shard-level operation.protected ShardsIteratorshards(ClusterState clusterState, ForceMergeRequest request, String[] concreteIndices)The refresh request works against *all* shards.Methods inherited from class org.elasticsearch.action.support.broadcast.node.TransportBroadcastByNodeAction
doExecute, resolveConcreteIndexNamesMethods inherited from class org.elasticsearch.action.support.TransportAction
execute, execute, execute
-
Constructor Details
-
TransportForceMergeAction
@Inject public TransportForceMergeAction(ClusterService clusterService, TransportService transportService, IndicesService indicesService, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver)
-
-
Method Details
-
readShardResult
protected TransportBroadcastByNodeAction.EmptyResult readShardResult(StreamInput in) throws IOExceptionDescription copied from class:TransportBroadcastByNodeActionDeserialize a shard-level result from an input stream- Specified by:
readShardResultin classTransportBroadcastByNodeAction<ForceMergeRequest,ForceMergeResponse,TransportBroadcastByNodeAction.EmptyResult>- Parameters:
in- input stream- Returns:
- a deserialized shard-level result
- Throws:
IOException
-
newResponse
protected ForceMergeResponse newResponse(ForceMergeRequest request, int totalShards, int successfulShards, int failedShards, List<TransportBroadcastByNodeAction.EmptyResult> responses, List<DefaultShardOperationFailedException> shardFailures, ClusterState clusterState)Description copied from class:TransportBroadcastByNodeActionCreates a new response to the underlying request.- Specified by:
newResponsein classTransportBroadcastByNodeAction<ForceMergeRequest,ForceMergeResponse,TransportBroadcastByNodeAction.EmptyResult>- 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<ForceMergeRequest,ForceMergeResponse,TransportBroadcastByNodeAction.EmptyResult>- Parameters:
in- input stream- Returns:
- a de-serialized request
- Throws:
IOException
-
shardOperation
protected void shardOperation(ForceMergeRequest request, ShardRouting shardRouting, Task task, ActionListener<TransportBroadcastByNodeAction.EmptyResult> listener)Description copied from class:TransportBroadcastByNodeActionExecutes 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:
shardOperationin classTransportBroadcastByNodeAction<ForceMergeRequest,ForceMergeResponse,TransportBroadcastByNodeAction.EmptyResult>- 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
-
shards
protected ShardsIterator shards(ClusterState clusterState, ForceMergeRequest request, String[] concreteIndices)The refresh request works against *all* shards.- Specified by:
shardsin classTransportBroadcastByNodeAction<ForceMergeRequest,ForceMergeResponse,TransportBroadcastByNodeAction.EmptyResult>- 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:TransportBroadcastByNodeActionExecutes a global block check before polling the cluster state.- Specified by:
checkGlobalBlockin classTransportBroadcastByNodeAction<ForceMergeRequest,ForceMergeResponse,TransportBroadcastByNodeAction.EmptyResult>- Parameters:
state- the cluster staterequest- the underlying request- Returns:
- a non-null exception if the operation is blocked
-
checkRequestBlock
protected ClusterBlockException checkRequestBlock(ClusterState state, ForceMergeRequest request, String[] concreteIndices)Description copied from class:TransportBroadcastByNodeActionExecutes a global request-level check before polling the cluster state.- Specified by:
checkRequestBlockin classTransportBroadcastByNodeAction<ForceMergeRequest,ForceMergeResponse,TransportBroadcastByNodeAction.EmptyResult>- 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
-