Class ShardStateAction


  • public class ShardStateAction
    extends java.lang.Object
    • Field Detail

      • SHARD_STARTED_ACTION_NAME

        public static final java.lang.String SHARD_STARTED_ACTION_NAME
        See Also:
        Constant Field Values
      • SHARD_FAILED_ACTION_NAME

        public static final java.lang.String SHARD_FAILED_ACTION_NAME
        See Also:
        Constant Field Values
    • Method Detail

      • remoteShardFailed

        public void remoteShardFailed​(ShardId shardId,
                                      java.lang.String allocationId,
                                      long primaryTerm,
                                      boolean markAsStale,
                                      java.lang.String message,
                                      @Nullable
                                      java.lang.Exception failure,
                                      ActionListener<java.lang.Void> listener)
        Send a shard failed request to the master node to update the cluster state with the failure of a shard on another node. This means that the shard should be failed because a write made it into the primary but was not replicated to this shard copy. If the shard does not exist anymore but still has an entry in the in-sync set, remove its allocation id from the in-sync set.
        Parameters:
        shardId - shard id of the shard to fail
        allocationId - allocation id of the shard to fail
        primaryTerm - the primary term associated with the primary shard that is failing the shard. Must be strictly positive.
        markAsStale - whether or not to mark a failing shard as stale (eg. removing from in-sync set) when failing the shard.
        message - the reason for the failure
        failure - the underlying cause of the failure
        listener - callback upon completion of the request
      • localShardFailed

        public void localShardFailed​(ShardRouting shardRouting,
                                     java.lang.String message,
                                     @Nullable
                                     java.lang.Exception failure,
                                     ActionListener<java.lang.Void> listener)
        Send a shard failed request to the master node to update the cluster state when a shard on the local node failed.
      • localShardFailed

        public void localShardFailed​(ShardRouting shardRouting,
                                     java.lang.String message,
                                     @Nullable
                                     java.lang.Exception failure,
                                     ActionListener<java.lang.Void> listener,
                                     ClusterState currentState)
        Send a shard failed request to the master node to update the cluster state when a shard on the local node failed.
      • shardStarted

        public void shardStarted​(ShardRouting shardRouting,
                                 long primaryTerm,
                                 java.lang.String message,
                                 ActionListener<java.lang.Void> listener)