Package org.elasticsearch.action.resync
Class TransportResyncReplicationAction
- java.lang.Object
-
- org.elasticsearch.common.component.AbstractComponent
-
- org.elasticsearch.action.support.TransportAction<Request,Response>
-
- org.elasticsearch.action.support.replication.TransportReplicationAction<Request,ReplicaRequest,Response>
-
- org.elasticsearch.action.support.replication.TransportWriteAction<ResyncReplicationRequest,ResyncReplicationRequest,ResyncReplicationResponse>
-
- org.elasticsearch.action.resync.TransportResyncReplicationAction
-
- All Implemented Interfaces:
PrimaryReplicaSyncer.SyncAction
public class TransportResyncReplicationAction extends TransportWriteAction<ResyncReplicationRequest,ResyncReplicationRequest,ResyncReplicationResponse> implements PrimaryReplicaSyncer.SyncAction
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.elasticsearch.action.support.replication.TransportWriteAction
TransportWriteAction.WritePrimaryResult<ReplicaRequest extends ReplicatedWriteRequest<ReplicaRequest>,Response extends ReplicationResponse & WriteResponse>, TransportWriteAction.WriteReplicaResult<ReplicaRequest extends ReplicatedWriteRequest<ReplicaRequest>>
-
Nested classes/interfaces inherited from class org.elasticsearch.action.support.replication.TransportReplicationAction
TransportReplicationAction.ConcreteReplicaRequest<R extends TransportRequest>, TransportReplicationAction.ConcreteShardRequest<R extends TransportRequest>, TransportReplicationAction.OperationTransportHandler, TransportReplicationAction.PrimaryOperationTransportHandler, TransportReplicationAction.PrimaryResult<ReplicaRequest extends ReplicationRequest<ReplicaRequest>,Response extends ReplicationResponse>, TransportReplicationAction.ReplicaOperationTransportHandler, TransportReplicationAction.ReplicaResponse, TransportReplicationAction.ReplicaResult, TransportReplicationAction.ReplicasProxy, TransportReplicationAction.RetryOnReplicaException
-
-
Field Summary
-
Fields inherited from class org.elasticsearch.action.support.replication.TransportReplicationAction
clusterService, executor, indicesService, shardStateAction, transportOptions, transportPrimaryAction, transportReplicaAction, transportService
-
Fields inherited from class org.elasticsearch.action.support.TransportAction
actionName, indexNameExpressionResolver, taskManager, threadPool
-
Fields inherited from class org.elasticsearch.common.component.AbstractComponent
logger
-
-
Constructor Summary
Constructors Constructor Description TransportResyncReplicationAction(Settings settings, TransportService transportService, ClusterService clusterService, IndicesService indicesService, ThreadPool threadPool, ShardStateAction shardStateAction, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver)
-
Method Summary
-
Methods inherited from class org.elasticsearch.action.support.replication.TransportWriteAction
locationToSync, syncOperationResultOrThrow
-
Methods inherited from class org.elasticsearch.action.support.replication.TransportReplicationAction
acquirePrimaryOperationPermit, acquireReplicaOperationPermit, doExecute, doExecute, getIndexShard, resolveIndex, resolveRequest, retryPrimaryException, transportOptions
-
Methods inherited from class org.elasticsearch.action.support.TransportAction
execute, execute, execute, execute
-
-
-
-
Constructor Detail
-
TransportResyncReplicationAction
@Inject public TransportResyncReplicationAction(Settings settings, TransportService transportService, ClusterService clusterService, IndicesService indicesService, ThreadPool threadPool, ShardStateAction shardStateAction, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver)
-
-
Method Detail
-
registerRequestHandlers
protected void registerRequestHandlers(java.lang.String actionName, TransportService transportService, java.util.function.Supplier<ResyncReplicationRequest> request, java.util.function.Supplier<ResyncReplicationRequest> replicaRequest, java.lang.String executor)
-
newResponseInstance
protected ResyncReplicationResponse newResponseInstance()
- Specified by:
newResponseInstance
in classTransportReplicationAction<ResyncReplicationRequest,ResyncReplicationRequest,ResyncReplicationResponse>
-
newReplicasProxy
protected ReplicationOperation.Replicas newReplicasProxy(long primaryTerm)
-
sendReplicaRequest
protected void sendReplicaRequest(TransportReplicationAction.ConcreteReplicaRequest<ResyncReplicationRequest> replicaRequest, DiscoveryNode node, ActionListener<ReplicationOperation.ReplicaResponse> listener)
Description copied from class:TransportReplicationAction
Sends the specified replica request to the specified node.- Overrides:
sendReplicaRequest
in classTransportReplicationAction<ResyncReplicationRequest,ResyncReplicationRequest,ResyncReplicationResponse>
- Parameters:
replicaRequest
- the replica requestnode
- the node to send the request tolistener
- callback for handling the response or failure
-
globalBlockLevel
protected ClusterBlockLevel globalBlockLevel()
Description copied from class:TransportReplicationAction
Cluster level block to check before request execution. Returning null means that no blocks need to be checked.
-
indexBlockLevel
public ClusterBlockLevel indexBlockLevel()
Description copied from class:TransportReplicationAction
Index level block to check before request execution. Returning null means that no blocks need to be checked.- Overrides:
indexBlockLevel
in classTransportWriteAction<ResyncReplicationRequest,ResyncReplicationRequest,ResyncReplicationResponse>
-
shardOperationOnPrimary
protected TransportWriteAction.WritePrimaryResult<ResyncReplicationRequest,ResyncReplicationResponse> shardOperationOnPrimary(ResyncReplicationRequest request, IndexShard primary) throws java.lang.Exception
Description copied from class:TransportWriteAction
Called on the primary with a reference to the primary IndexShard to modify.- Specified by:
shardOperationOnPrimary
in classTransportWriteAction<ResyncReplicationRequest,ResyncReplicationRequest,ResyncReplicationResponse>
- Parameters:
request
- the request to the primary shardprimary
- the primary shard to perform the operation on- Returns:
- the result of the operation on primary, including current translog location and operation response and failure
async refresh is performed on the
primary
shard according to theRequest
refresh policy - Throws:
java.lang.Exception
-
performOnPrimary
public static ResyncReplicationRequest performOnPrimary(ResyncReplicationRequest request, IndexShard primary)
-
shardOperationOnReplica
protected TransportWriteAction.WriteReplicaResult shardOperationOnReplica(ResyncReplicationRequest request, IndexShard replica) throws java.lang.Exception
Description copied from class:TransportWriteAction
Called once per replica with a reference to the replica IndexShard to modify.- Specified by:
shardOperationOnReplica
in classTransportWriteAction<ResyncReplicationRequest,ResyncReplicationRequest,ResyncReplicationResponse>
- Parameters:
request
- the request to the replica shardreplica
- the replica shard to perform the operation on- Returns:
- the result of the operation on replica, including current translog location and operation response and failure
async refresh is performed on the
replica
shard according to theReplicaRequest
refresh policy - Throws:
java.lang.Exception
-
performOnReplica
public static Translog.Location performOnReplica(ResyncReplicationRequest request, IndexShard replica) throws java.lang.Exception
- Throws:
java.lang.Exception
-
sync
public void sync(ResyncReplicationRequest request, Task parentTask, java.lang.String primaryAllocationId, long primaryTerm, ActionListener<ResyncReplicationResponse> listener)
- Specified by:
sync
in interfacePrimaryReplicaSyncer.SyncAction
-
-