Interface ReplicationOperation.Replicas<RequestT extends ReplicationRequest<RequestT>>

    • Method Summary

      Modifier and Type Method Description
      void failShardIfNeeded​(ShardRouting replica, long primaryTerm, java.lang.String message, java.lang.Exception exception, ActionListener<java.lang.Void> listener)
      Fail the specified shard if needed, removing it from the current set of active shards.
      void markShardCopyAsStaleIfNeeded​(ShardId shardId, java.lang.String allocationId, long primaryTerm, ActionListener<java.lang.Void> listener)
      Marks shard copy as stale if needed, removing its allocation id from the set of in-sync allocation ids.
      void performOn​(ShardRouting replica, RequestT replicaRequest, long primaryTerm, long globalCheckpoint, long maxSeqNoOfUpdatesOrDeletes, ActionListener<ReplicationOperation.ReplicaResponse> listener)
      Performs the specified request on the specified replica.
    • Method Detail

      • performOn

        void performOn​(ShardRouting replica,
                       RequestT replicaRequest,
                       long primaryTerm,
                       long globalCheckpoint,
                       long maxSeqNoOfUpdatesOrDeletes,
                       ActionListener<ReplicationOperation.ReplicaResponse> listener)
        Performs the specified request on the specified replica.
        Parameters:
        replica - the shard this request should be executed on
        replicaRequest - the operation to perform
        primaryTerm - the primary term
        globalCheckpoint - the global checkpoint on the primary
        maxSeqNoOfUpdatesOrDeletes - the max seq_no of updates (index operations overwriting Lucene) or deletes on primary after this replication was executed on it.
        listener - callback for handling the response or failure
      • failShardIfNeeded

        void failShardIfNeeded​(ShardRouting replica,
                               long primaryTerm,
                               java.lang.String message,
                               java.lang.Exception exception,
                               ActionListener<java.lang.Void> listener)
        Fail the specified shard if needed, removing it from the current set of active shards. Whether a failure is needed is left up to the implementation.
        Parameters:
        replica - shard to fail
        primaryTerm - the primary term
        message - a (short) description of the reason
        exception - the original exception which caused the ReplicationOperation to request the shard to be failed
        listener - a listener that will be notified when the failing shard has been removed from the in-sync set
      • markShardCopyAsStaleIfNeeded

        void markShardCopyAsStaleIfNeeded​(ShardId shardId,
                                          java.lang.String allocationId,
                                          long primaryTerm,
                                          ActionListener<java.lang.Void> listener)
        Marks shard copy as stale if needed, removing its allocation id from the set of in-sync allocation ids. Whether marking as stale is needed is left up to the implementation.
        Parameters:
        shardId - shard id
        allocationId - allocation id to remove from the set of in-sync allocation ids
        primaryTerm - the primary term
        listener - a listener that will be notified when the failing shard has been removed from the in-sync set