Module org.elasticsearch.server
Class TransportClearIndicesCacheAction
java.lang.Object
org.elasticsearch.action.support.TransportAction<ClearIndicesCacheRequest,BroadcastResponse>
org.elasticsearch.action.support.HandledTransportAction<ClearIndicesCacheRequest,BroadcastResponse>
org.elasticsearch.action.support.broadcast.node.TransportBroadcastByNodeAction<ClearIndicesCacheRequest,BroadcastResponse,TransportBroadcastByNodeAction.EmptyResult>
org.elasticsearch.action.admin.indices.cache.clear.TransportClearIndicesCacheAction
public class TransportClearIndicesCacheAction
extends TransportBroadcastByNodeAction<ClearIndicesCacheRequest,BroadcastResponse,TransportBroadcastByNodeAction.EmptyResult>
Indices clear cache action.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.elasticsearch.action.support.broadcast.node.TransportBroadcastByNodeAction
TransportBroadcastByNodeAction.EmptyResult, TransportBroadcastByNodeAction.NodeResponse, TransportBroadcastByNodeAction.ResponseFactory<Response,ShardOperationResult> -
Field Summary
FieldsFields inherited from class org.elasticsearch.action.support.broadcast.node.TransportBroadcastByNodeAction
clusterService, indexNameExpressionResolver, transportServiceFields inherited from class org.elasticsearch.action.support.TransportAction
actionName, taskManager -
Constructor Summary
ConstructorsConstructorDescriptionTransportClearIndicesCacheAction(ClusterService clusterService, TransportService transportService, IndicesService indicesService, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) -
Method Summary
Modifier and TypeMethodDescriptionprotected ClusterBlockExceptioncheckGlobalBlock(ClusterState state, ClearIndicesCacheRequest request) Executes a global block check before polling the cluster state.protected ClusterBlockExceptioncheckRequestBlock(ClusterState state, ClearIndicesCacheRequest request, String[] concreteIndices) Executes a global request-level check before polling the cluster state.protected TransportBroadcastByNodeAction.ResponseFactory<BroadcastResponse, TransportBroadcastByNodeAction.EmptyResult> getResponseFactory(ClearIndicesCacheRequest request, ClusterState clusterState) Create a response factory based on the requst and the cluster state captured at the time the request was handled.protected ClearIndicesCacheRequestDeserialize a request from an input streamDeserialize a shard-level result from an input streamprotected voidshardOperation(ClearIndicesCacheRequest request, ShardRouting shardRouting, Task task, ActionListener<TransportBroadcastByNodeAction.EmptyResult> listener) Executes the shard-level operation.protected ShardsIteratorshards(ClusterState clusterState, ClearIndicesCacheRequest request, String[] concreteIndices) The indices clear cache 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, executeDirect, localOnly
-
Field Details
-
TYPE
-
-
Constructor Details
-
TransportClearIndicesCacheAction
@Inject public TransportClearIndicesCacheAction(ClusterService clusterService, TransportService transportService, IndicesService indicesService, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver)
-
-
Method Details
-
readShardResult
protected TransportBroadcastByNodeAction.EmptyResult readShardResult(StreamInput in) throws IOException Description copied from class:TransportBroadcastByNodeActionDeserialize a shard-level result from an input stream- Specified by:
readShardResultin classTransportBroadcastByNodeAction<ClearIndicesCacheRequest,BroadcastResponse, TransportBroadcastByNodeAction.EmptyResult> - Parameters:
in- input stream- Returns:
- a deserialized shard-level result
- Throws:
IOException
-
getResponseFactory
protected TransportBroadcastByNodeAction.ResponseFactory<BroadcastResponse,TransportBroadcastByNodeAction.EmptyResult> getResponseFactory(ClearIndicesCacheRequest request, ClusterState clusterState) Description copied from class:TransportBroadcastByNodeActionCreate a response factory based on the requst and the cluster state captured at the time the request was handled. Implementations must avoid capturing the full cluster state if possible. -
readRequestFrom
Description copied from class:TransportBroadcastByNodeActionDeserialize a request from an input stream- Specified by:
readRequestFromin classTransportBroadcastByNodeAction<ClearIndicesCacheRequest,BroadcastResponse, TransportBroadcastByNodeAction.EmptyResult> - Parameters:
in- input stream- Returns:
- a de-serialized request
- Throws:
IOException
-
shardOperation
protected void shardOperation(ClearIndicesCacheRequest 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<ClearIndicesCacheRequest,BroadcastResponse, 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, ClearIndicesCacheRequest request, String[] concreteIndices) The indices clear cache request works against *all* shards.- Specified by:
shardsin classTransportBroadcastByNodeAction<ClearIndicesCacheRequest,BroadcastResponse, 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
protected ClusterBlockException checkGlobalBlock(ClusterState state, ClearIndicesCacheRequest request) Description copied from class:TransportBroadcastByNodeActionExecutes a global block check before polling the cluster state.- Specified by:
checkGlobalBlockin classTransportBroadcastByNodeAction<ClearIndicesCacheRequest,BroadcastResponse, 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, ClearIndicesCacheRequest request, String[] concreteIndices) Description copied from class:TransportBroadcastByNodeActionExecutes a global request-level check before polling the cluster state.- Specified by:
checkRequestBlockin classTransportBroadcastByNodeAction<ClearIndicesCacheRequest,BroadcastResponse, 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
-