org.elasticsearch.action.index
Class TransportIndexAction

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<IndexRequest,IndexRequest,IndexResponse>
              extended by org.elasticsearch.action.index.TransportIndexAction

public class TransportIndexAction
extends TransportShardReplicationOperationAction<IndexRequest,IndexRequest,IndexResponse>

Performs the index operation.

Allows for the following settings:


Nested Class Summary
 
Nested classes/interfaces inherited from class org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction
TransportShardReplicationOperationAction.AsyncShardOperationAction, TransportShardReplicationOperationAction.PrimaryOperationRequest, TransportShardReplicationOperationAction.PrimaryResponse<Response,ReplicaRequest>, TransportShardReplicationOperationAction.ReplicaOperationRequest
 
Field Summary
 
Fields inherited from class org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction
clusterService, defaultReplicationType, defaultWriteConsistencyLevel, indicesService, shardStateAction, transportOptions, 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
TransportIndexAction(Settings settings, TransportService transportService, ClusterService clusterService, IndicesService indicesService, ThreadPool threadPool, ShardStateAction shardStateAction, TransportCreateIndexAction createIndexAction, MappingUpdatedAction mappingUpdatedAction)
           
 
Method Summary
protected  ClusterBlockException checkGlobalBlock(ClusterState state, IndexRequest request)
           
protected  ClusterBlockException checkRequestBlock(ClusterState state, IndexRequest request)
           
protected  boolean checkWriteConsistency()
           
protected  void doExecute(IndexRequest request, ActionListener<IndexResponse> listener)
           
protected  String executor()
           
protected  IndexRequest newReplicaRequestInstance()
           
protected  IndexRequest newRequestInstance()
           
protected  IndexResponse newResponseInstance()
           
protected  void postPrimaryOperation(IndexRequest request, TransportShardReplicationOperationAction.PrimaryResponse<IndexResponse,IndexRequest> response)
          Called once replica operations have been dispatched on the
protected  boolean resolveRequest(ClusterState state, IndexRequest request, ActionListener<IndexResponse> indexResponseActionListener)
          Resolves the request, by default, simply setting the concrete index (if its aliased one).
protected  TransportShardReplicationOperationAction.PrimaryResponse<IndexResponse,IndexRequest> shardOperationOnPrimary(ClusterState clusterState, TransportShardReplicationOperationAction.PrimaryOperationRequest shardRequest)
           
protected  void shardOperationOnReplica(TransportShardReplicationOperationAction.ReplicaOperationRequest shardRequest)
           
protected  ShardIterator shards(ClusterState clusterState, IndexRequest request)
           
protected  String transportAction()
           
 
Methods inherited from class org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction
ignoreReplicas, retryPrimaryException, 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
 

Constructor Detail

TransportIndexAction

@Inject
public TransportIndexAction(Settings settings,
                                   TransportService transportService,
                                   ClusterService clusterService,
                                   IndicesService indicesService,
                                   ThreadPool threadPool,
                                   ShardStateAction shardStateAction,
                                   TransportCreateIndexAction createIndexAction,
                                   MappingUpdatedAction mappingUpdatedAction)
Method Detail

doExecute

protected void doExecute(IndexRequest request,
                         ActionListener<IndexResponse> listener)
Overrides:
doExecute in class TransportShardReplicationOperationAction<IndexRequest,IndexRequest,IndexResponse>

resolveRequest

protected boolean resolveRequest(ClusterState state,
                                 IndexRequest request,
                                 ActionListener<IndexResponse> indexResponseActionListener)
Description copied from class: TransportShardReplicationOperationAction
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.

Overrides:
resolveRequest in class TransportShardReplicationOperationAction<IndexRequest,IndexRequest,IndexResponse>

checkWriteConsistency

protected boolean checkWriteConsistency()
Specified by:
checkWriteConsistency in class TransportShardReplicationOperationAction<IndexRequest,IndexRequest,IndexResponse>

newRequestInstance

protected IndexRequest newRequestInstance()
Specified by:
newRequestInstance in class TransportShardReplicationOperationAction<IndexRequest,IndexRequest,IndexResponse>

newReplicaRequestInstance

protected IndexRequest newReplicaRequestInstance()
Specified by:
newReplicaRequestInstance in class TransportShardReplicationOperationAction<IndexRequest,IndexRequest,IndexResponse>

newResponseInstance

protected IndexResponse newResponseInstance()
Specified by:
newResponseInstance in class TransportShardReplicationOperationAction<IndexRequest,IndexRequest,IndexResponse>

transportAction

protected String transportAction()
Specified by:
transportAction in class TransportShardReplicationOperationAction<IndexRequest,IndexRequest,IndexResponse>

executor

protected String executor()
Specified by:
executor in class TransportShardReplicationOperationAction<IndexRequest,IndexRequest,IndexResponse>

checkGlobalBlock

protected ClusterBlockException checkGlobalBlock(ClusterState state,
                                                 IndexRequest request)
Specified by:
checkGlobalBlock in class TransportShardReplicationOperationAction<IndexRequest,IndexRequest,IndexResponse>

checkRequestBlock

protected ClusterBlockException checkRequestBlock(ClusterState state,
                                                  IndexRequest request)
Specified by:
checkRequestBlock in class TransportShardReplicationOperationAction<IndexRequest,IndexRequest,IndexResponse>

shards

protected ShardIterator shards(ClusterState clusterState,
                               IndexRequest request)
Specified by:
shards in class TransportShardReplicationOperationAction<IndexRequest,IndexRequest,IndexResponse>

shardOperationOnPrimary

protected TransportShardReplicationOperationAction.PrimaryResponse<IndexResponse,IndexRequest> shardOperationOnPrimary(ClusterState clusterState,
                                                                                                                       TransportShardReplicationOperationAction.PrimaryOperationRequest shardRequest)
Specified by:
shardOperationOnPrimary in class TransportShardReplicationOperationAction<IndexRequest,IndexRequest,IndexResponse>

postPrimaryOperation

protected void postPrimaryOperation(IndexRequest request,
                                    TransportShardReplicationOperationAction.PrimaryResponse<IndexResponse,IndexRequest> response)
Description copied from class: TransportShardReplicationOperationAction
Called once replica operations have been dispatched on the

Overrides:
postPrimaryOperation in class TransportShardReplicationOperationAction<IndexRequest,IndexRequest,IndexResponse>

shardOperationOnReplica

protected void shardOperationOnReplica(TransportShardReplicationOperationAction.ReplicaOperationRequest shardRequest)
Specified by:
shardOperationOnReplica in class TransportShardReplicationOperationAction<IndexRequest,IndexRequest,IndexResponse>


Copyright © 2009-2012. All Rights Reserved.