org.elasticsearch.action.support.replication
Class TransportShardReplicationOperationAction<Request extends ShardReplicationOperationRequest,ReplicaRequest extends ActionRequest,Response extends ActionResponse>

java.lang.Object
  extended by org.elasticsearch.common.component.AbstractComponent
      extended by org.elasticsearch.action.support.TransportAction<Request,Response>
          extended by org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction<Request,ReplicaRequest,Response>
Direct Known Subclasses:
TransportDeleteAction, TransportIndexAction, TransportShardBulkAction, TransportShardDeleteAction, TransportShardDeleteByQueryAction

public abstract class TransportShardReplicationOperationAction<Request extends ShardReplicationOperationRequest,ReplicaRequest extends ActionRequest,Response extends ActionResponse>
extends TransportAction<Request,Response>


Nested Class Summary
protected  class TransportShardReplicationOperationAction.AsyncShardOperationAction
           
protected  class TransportShardReplicationOperationAction.PrimaryOperationRequest
           
static class TransportShardReplicationOperationAction.PrimaryResponse<Response,ReplicaRequest>
           
protected  class TransportShardReplicationOperationAction.ReplicaOperationRequest
           
 
Field Summary
protected  ClusterService clusterService
           
protected  ReplicationType defaultReplicationType
           
protected  WriteConsistencyLevel defaultWriteConsistencyLevel
           
protected  IndicesService indicesService
           
protected  ShardStateAction shardStateAction
           
protected  TransportRequestOptions transportOptions
           
protected  TransportService transportService
           
 
Fields inherited from class org.elasticsearch.action.support.TransportAction
threadPool
 
Fields inherited from class org.elasticsearch.common.component.AbstractComponent
componentSettings, logger, settings
 
Constructor Summary
protected TransportShardReplicationOperationAction(Settings settings, TransportService transportService, ClusterService clusterService, IndicesService indicesService, ThreadPool threadPool, ShardStateAction shardStateAction)
           
 
Method Summary
protected abstract  ClusterBlockException checkGlobalBlock(ClusterState state, Request request)
           
protected abstract  ClusterBlockException checkRequestBlock(ClusterState state, Request request)
           
protected abstract  boolean checkWriteConsistency()
           
protected  void doExecute(Request request, ActionListener<Response> listener)
           
protected abstract  String executor()
           
protected  boolean ignoreReplicas()
          Should the operations be performed on the replicas as well.
protected abstract  ReplicaRequest newReplicaRequestInstance()
           
protected abstract  Request newRequestInstance()
           
protected abstract  Response newResponseInstance()
           
protected  void postPrimaryOperation(Request request, TransportShardReplicationOperationAction.PrimaryResponse<Response,ReplicaRequest> response)
          Called once replica operations have been dispatched on the
protected  boolean resolveRequest(ClusterState state, Request request, ActionListener<Response> listener)
          Resolves the request, by default, simply setting the concrete index (if its aliased one).
protected  boolean retryPrimaryException(Throwable e)
           
protected abstract  TransportShardReplicationOperationAction.PrimaryResponse<Response,ReplicaRequest> shardOperationOnPrimary(ClusterState clusterState, TransportShardReplicationOperationAction.PrimaryOperationRequest shardRequest)
           
protected abstract  void shardOperationOnReplica(TransportShardReplicationOperationAction.ReplicaOperationRequest shardRequest)
           
protected abstract  ShardIterator shards(ClusterState clusterState, Request request)
           
protected abstract  String transportAction()
           
protected  TransportRequestOptions transportOptions()
           
 
Methods inherited from class org.elasticsearch.action.support.TransportAction
execute, execute
 
Methods inherited from class org.elasticsearch.common.component.AbstractComponent
nodeName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

transportService

protected final TransportService transportService

clusterService

protected final ClusterService clusterService

indicesService

protected final IndicesService indicesService

shardStateAction

protected final ShardStateAction shardStateAction

defaultReplicationType

protected final ReplicationType defaultReplicationType

defaultWriteConsistencyLevel

protected final WriteConsistencyLevel defaultWriteConsistencyLevel

transportOptions

protected final TransportRequestOptions transportOptions
Constructor Detail

TransportShardReplicationOperationAction

protected TransportShardReplicationOperationAction(Settings settings,
                                                   TransportService transportService,
                                                   ClusterService clusterService,
                                                   IndicesService indicesService,
                                                   ThreadPool threadPool,
                                                   ShardStateAction shardStateAction)
Method Detail

doExecute

protected void doExecute(Request request,
                         ActionListener<Response> listener)
Specified by:
doExecute in class TransportAction<Request extends ShardReplicationOperationRequest,Response extends ActionResponse>

newRequestInstance

protected abstract Request newRequestInstance()

newReplicaRequestInstance

protected abstract ReplicaRequest newReplicaRequestInstance()

newResponseInstance

protected abstract Response newResponseInstance()

transportAction

protected abstract String transportAction()

executor

protected abstract String executor()

shardOperationOnPrimary

protected abstract TransportShardReplicationOperationAction.PrimaryResponse<Response,ReplicaRequest> shardOperationOnPrimary(ClusterState clusterState,
                                                                                                                             TransportShardReplicationOperationAction.PrimaryOperationRequest shardRequest)

shardOperationOnReplica

protected abstract void shardOperationOnReplica(TransportShardReplicationOperationAction.ReplicaOperationRequest shardRequest)

postPrimaryOperation

protected void postPrimaryOperation(Request request,
                                    TransportShardReplicationOperationAction.PrimaryResponse<Response,ReplicaRequest> response)
Called once replica operations have been dispatched on the


shards

protected abstract ShardIterator shards(ClusterState clusterState,
                                        Request request)
                                 throws ElasticSearchException
Throws:
ElasticSearchException

checkWriteConsistency

protected abstract boolean checkWriteConsistency()

checkGlobalBlock

protected abstract ClusterBlockException checkGlobalBlock(ClusterState state,
                                                          Request request)

checkRequestBlock

protected abstract ClusterBlockException checkRequestBlock(ClusterState state,
                                                           Request request)

resolveRequest

protected boolean resolveRequest(ClusterState state,
                                 Request request,
                                 ActionListener<Response> listener)
Resolves the request, by default, simply setting the concrete index (if its aliased one). If the resolve means a different execution, then return false here to indicate not to continue and execute this request.


transportOptions

protected TransportRequestOptions transportOptions()

ignoreReplicas

protected boolean ignoreReplicas()
Should the operations be performed on the replicas as well. Defaults to false meaning operations will be executed on the replica.


retryPrimaryException

protected boolean retryPrimaryException(Throwable e)


Copyright © 2009-2012. All Rights Reserved.