Class TransportReplicationAction.ReplicasProxy

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected long primaryTerm  
    • Constructor Summary

      Constructors 
      Constructor Description
      ReplicasProxy​(long primaryTerm)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected ShardStateAction.Listener createShardActionListener​(java.lang.Runnable onSuccess, java.util.function.Consumer<java.lang.Exception> onPrimaryDemoted, java.util.function.Consumer<java.lang.Exception> onIgnoredFailure)  
      void failShardIfNeeded​(ShardRouting replica, java.lang.String message, java.lang.Exception exception, java.lang.Runnable onSuccess, java.util.function.Consumer<java.lang.Exception> onPrimaryDemoted, java.util.function.Consumer<java.lang.Exception> onIgnoredFailure)
      Fail the specified shard if needed, removing it from the current set of active shards.
      void markShardCopyAsStaleIfNeeded​(ShardId shardId, java.lang.String allocationId, java.lang.Runnable onSuccess, java.util.function.Consumer<java.lang.Exception> onPrimaryDemoted, java.util.function.Consumer<java.lang.Exception> onIgnoredFailure)
      Marks shard copy as stale if needed, removing its allocation id from the set of in-sync allocation ids.
      void performOn​(ShardRouting replica, ReplicaRequest request, long globalCheckpoint, long maxSeqNoOfUpdatesOrDeletes, ActionListener<ReplicationOperation.ReplicaResponse> listener)
      Performs the specified request on the specified replica.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • primaryTerm

        protected final long primaryTerm
    • Constructor Detail

      • ReplicasProxy

        public ReplicasProxy​(long primaryTerm)
    • Method Detail

      • failShardIfNeeded

        public void failShardIfNeeded​(ShardRouting replica,
                                      java.lang.String message,
                                      java.lang.Exception exception,
                                      java.lang.Runnable onSuccess,
                                      java.util.function.Consumer<java.lang.Exception> onPrimaryDemoted,
                                      java.util.function.Consumer<java.lang.Exception> onIgnoredFailure)
        Description copied from interface: ReplicationOperation.Replicas
        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.
        Specified by:
        failShardIfNeeded in interface ReplicationOperation.Replicas<ReplicaRequest extends ReplicationRequest<ReplicaRequest>>
        Parameters:
        replica - shard to fail
        message - a (short) description of the reason
        exception - the original exception which caused the ReplicationOperation to request the shard to be failed
        onSuccess - a callback to call when the shard has been successfully removed from the active set.
        onPrimaryDemoted - a callback to call when the shard can not be failed because the current primary has been demoted by the master.
        onIgnoredFailure - a callback to call when failing a shard has failed, but it that failure can be safely ignored and the
      • markShardCopyAsStaleIfNeeded

        public void markShardCopyAsStaleIfNeeded​(ShardId shardId,
                                                 java.lang.String allocationId,
                                                 java.lang.Runnable onSuccess,
                                                 java.util.function.Consumer<java.lang.Exception> onPrimaryDemoted,
                                                 java.util.function.Consumer<java.lang.Exception> onIgnoredFailure)
        Description copied from interface: ReplicationOperation.Replicas
        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.
        Specified by:
        markShardCopyAsStaleIfNeeded in interface ReplicationOperation.Replicas<ReplicaRequest extends ReplicationRequest<ReplicaRequest>>
        Parameters:
        shardId - shard id
        allocationId - allocation id to remove from the set of in-sync allocation ids
        onSuccess - a callback to call when the allocation id has been successfully removed from the in-sync set.
        onPrimaryDemoted - a callback to call when the request failed because the current primary was already demoted by the master.
        onIgnoredFailure - a callback to call when the request failed, but the failure can be safely ignored.
      • createShardActionListener

        protected final ShardStateAction.Listener createShardActionListener​(java.lang.Runnable onSuccess,
                                                                            java.util.function.Consumer<java.lang.Exception> onPrimaryDemoted,
                                                                            java.util.function.Consumer<java.lang.Exception> onIgnoredFailure)