Package org.elasticsearch.index.seqno
Class RetentionLeaseSyncAction
java.lang.Object
org.elasticsearch.action.support.TransportAction<Request,Response>
org.elasticsearch.action.support.replication.TransportReplicationAction<Request,ReplicaRequest,Response>
org.elasticsearch.action.support.replication.TransportWriteAction<RetentionLeaseSyncAction.Request,RetentionLeaseSyncAction.Request,RetentionLeaseSyncAction.Response>
org.elasticsearch.index.seqno.RetentionLeaseSyncAction
public class RetentionLeaseSyncAction extends TransportWriteAction<RetentionLeaseSyncAction.Request,RetentionLeaseSyncAction.Request,RetentionLeaseSyncAction.Response>
Write action responsible for syncing retention leases to replicas. This action is deliberately a write action so that if a replica misses
a retention lease sync then that shard will be marked as stale.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRetentionLeaseSyncAction.Requeststatic classRetentionLeaseSyncAction.ResponseNested 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.PrimaryResult<ReplicaRequest extends ReplicationRequest<ReplicaRequest>,Response extends ReplicationResponse>, TransportReplicationAction.ReplicaResponse, TransportReplicationAction.ReplicaResult, TransportReplicationAction.ReplicasProxy, TransportReplicationAction.RetryOnReplicaException -
Field Summary
Fields Modifier and Type Field Description static java.lang.StringACTION_NAMEFields inherited from class org.elasticsearch.action.support.replication.TransportReplicationAction
clusterService, executor, indicesService, shardStateAction, threadPool, transportOptions, transportPrimaryAction, transportReplicaAction, transportServiceFields inherited from class org.elasticsearch.action.support.TransportAction
actionName, logger, taskManager -
Constructor Summary
Constructors Constructor Description RetentionLeaseSyncAction(Settings settings, TransportService transportService, ClusterService clusterService, IndicesService indicesService, ThreadPool threadPool, ShardStateAction shardStateAction, ActionFilters actionFilters) -
Method Summary
Modifier and Type Method Description protected voiddoExecute(Task parentTask, RetentionLeaseSyncAction.Request request, ActionListener<RetentionLeaseSyncAction.Response> listener)protected org.apache.logging.log4j.LoggergetLogger()ClusterBlockLevelindexBlockLevel()Index level block to check before request execution.protected RetentionLeaseSyncAction.ResponsenewResponseInstance(StreamInput in)protected voidshardOperationOnPrimary(RetentionLeaseSyncAction.Request request, IndexShard primary, ActionListener<TransportReplicationAction.PrimaryResult<RetentionLeaseSyncAction.Request,RetentionLeaseSyncAction.Response>> listener)Called on the primary with a reference to the primary IndexShard to modify.protected TransportWriteAction.WriteReplicaResult<RetentionLeaseSyncAction.Request>shardOperationOnReplica(RetentionLeaseSyncAction.Request request, IndexShard replica)Called once per replica with a reference to the replica IndexShard to modify.Methods inherited from class org.elasticsearch.action.support.replication.TransportWriteAction
globalBlockLevel, locationToSync, newReplicasProxy, syncOperationResultOrThrowMethods inherited from class org.elasticsearch.action.support.replication.TransportReplicationAction
acquirePrimaryOperationPermit, acquireReplicaOperationPermit, adaptResponse, handleOperationRequest, handlePrimaryRequest, handleReplicaRequest, resolveRequest, retryPrimaryException, transportOptions, wrapResponseActionListenerMethods inherited from class org.elasticsearch.action.support.TransportAction
execute, execute, execute
-
Field Details
-
ACTION_NAME
public static final java.lang.String ACTION_NAME- See Also:
- Constant Field Values
-
-
Constructor Details
-
RetentionLeaseSyncAction
@Inject public RetentionLeaseSyncAction(Settings settings, TransportService transportService, ClusterService clusterService, IndicesService indicesService, ThreadPool threadPool, ShardStateAction shardStateAction, ActionFilters actionFilters)
-
-
Method Details
-
getLogger
protected org.apache.logging.log4j.Logger getLogger() -
doExecute
protected void doExecute(Task parentTask, RetentionLeaseSyncAction.Request request, ActionListener<RetentionLeaseSyncAction.Response> listener) -
shardOperationOnPrimary
protected void shardOperationOnPrimary(RetentionLeaseSyncAction.Request request, IndexShard primary, ActionListener<TransportReplicationAction.PrimaryResult<RetentionLeaseSyncAction.Request,RetentionLeaseSyncAction.Response>> listener)Description copied from class:TransportWriteActionCalled on the primary with a reference to the primary IndexShard to modify.- Specified by:
shardOperationOnPrimaryin classTransportWriteAction<RetentionLeaseSyncAction.Request,RetentionLeaseSyncAction.Request,RetentionLeaseSyncAction.Response>- Parameters:
request- the request to the primary shardprimary- the primary shard to perform the operation onlistener- listener for the result of the operation on primary, including current translog location and operation response and failure async refresh is performed on theprimaryshard according to theRequestrefresh policy
-
shardOperationOnReplica
protected TransportWriteAction.WriteReplicaResult<RetentionLeaseSyncAction.Request> shardOperationOnReplica(RetentionLeaseSyncAction.Request request, IndexShard replica) throws WriteStateExceptionDescription copied from class:TransportWriteActionCalled once per replica with a reference to the replica IndexShard to modify.- Specified by:
shardOperationOnReplicain classTransportWriteAction<RetentionLeaseSyncAction.Request,RetentionLeaseSyncAction.Request,RetentionLeaseSyncAction.Response>- 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
replicashard according to theReplicaRequestrefresh policy - Throws:
WriteStateException
-
indexBlockLevel
Description copied from class:TransportReplicationActionIndex level block to check before request execution. Returning null means that no blocks need to be checked. -
newResponseInstance
protected RetentionLeaseSyncAction.Response newResponseInstance(StreamInput in) throws java.io.IOException- Specified by:
newResponseInstancein classTransportReplicationAction<RetentionLeaseSyncAction.Request,RetentionLeaseSyncAction.Request,RetentionLeaseSyncAction.Response>- Throws:
java.io.IOException
-