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

java.lang.Object
  extended by org.elasticsearch.common.component.AbstractComponent
      extended by org.elasticsearch.action.support.BaseAction<Request,Response>
          extended by org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction<Request,Response>
All Implemented Interfaces:
Action<Request,Response>
Direct Known Subclasses:
TransportDeleteAction, TransportIndexAction, TransportShardBulkAction, TransportShardDeleteAction, TransportShardDeleteByQueryAction, TransportShardReplicationPingAction

public abstract class TransportShardReplicationOperationAction<Request extends ShardReplicationOperationRequest,Response extends ActionResponse>
extends BaseAction<Request,Response>


Nested Class Summary
protected  class TransportShardReplicationOperationAction.AsyncShardOperationAction
           
protected  class TransportShardReplicationOperationAction.ShardOperationRequest
           
 
Field Summary
protected  ClusterService clusterService
           
protected  ReplicationType defaultReplicationType
           
protected  WriteConsistencyLevel defaultWriteConsistencyLevel
           
protected  IndicesService indicesService
           
protected  ShardStateAction shardStateAction
           
protected  ThreadPool threadPool
           
protected  TransportService transportService
           
 
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  void checkBlock(Request request, ClusterState state)
           
protected abstract  boolean checkWriteConsistency()
           
protected  void doExecute(Request request, ActionListener<Response> listener)
           
protected  boolean ignoreReplicas()
          Should the operations be performed on the replicas as well.
protected  IndexShard indexShard(TransportShardReplicationOperationAction.ShardOperationRequest shardRequest)
           
protected abstract  Request newRequestInstance()
           
protected abstract  Response newResponseInstance()
           
protected abstract  Response shardOperationOnPrimary(ClusterState clusterState, TransportShardReplicationOperationAction.ShardOperationRequest shardRequest)
           
protected abstract  void shardOperationOnReplica(TransportShardReplicationOperationAction.ShardOperationRequest shardRequest)
           
protected abstract  ShardsIterator shards(ClusterState clusterState, Request request)
           
protected abstract  java.lang.String transportAction()
           
protected  TransportRequestOptions transportOptions()
           
 
Methods inherited from class org.elasticsearch.action.support.BaseAction
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

threadPool

protected final ThreadPool threadPool

shardStateAction

protected final ShardStateAction shardStateAction

defaultReplicationType

protected final ReplicationType defaultReplicationType

defaultWriteConsistencyLevel

protected final WriteConsistencyLevel defaultWriteConsistencyLevel
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 BaseAction<Request extends ShardReplicationOperationRequest,Response extends ActionResponse>

newRequestInstance

protected abstract Request newRequestInstance()

newResponseInstance

protected abstract Response newResponseInstance()

transportAction

protected abstract java.lang.String transportAction()

shardOperationOnPrimary

protected abstract Response shardOperationOnPrimary(ClusterState clusterState,
                                                    TransportShardReplicationOperationAction.ShardOperationRequest shardRequest)

shardOperationOnReplica

protected abstract void shardOperationOnReplica(TransportShardReplicationOperationAction.ShardOperationRequest shardRequest)

shards

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

checkWriteConsistency

protected abstract boolean checkWriteConsistency()

checkBlock

protected void checkBlock(Request request,
                          ClusterState state)

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.


indexShard

protected IndexShard indexShard(TransportShardReplicationOperationAction.ShardOperationRequest shardRequest)