Class ReplicationRequest<Request extends ReplicationRequest<Request>>

    • Field Detail

      • DEFAULT_TIMEOUT

        public static final TimeValue DEFAULT_TIMEOUT
      • shardId

        protected final ShardId shardId
        Target shard the request should execute on. In case of index and delete requests, shard id gets resolved by the transport action before performing request operation and at request creation time for shard-level bulk, refresh and flush requests.
      • index

        protected java.lang.String index
      • waitForActiveShards

        protected ActiveShardCount waitForActiveShards
        The number of shard copies that must be active before proceeding with the replication action.
    • Constructor Detail

      • ReplicationRequest

        public ReplicationRequest​(StreamInput in)
                           throws java.io.IOException
        Throws:
        java.io.IOException
      • ReplicationRequest

        public ReplicationRequest​(@Nullable
                                  ShardId shardId)
        Creates a new request with resolved shard id
    • Method Detail

      • timeout

        public final Request timeout​(TimeValue timeout)
        A timeout to wait if the index operation can't be performed immediately. Defaults to 1m.
      • timeout

        public final Request timeout​(java.lang.String timeout)
        A timeout to wait if the index operation can't be performed immediately. Defaults to 1m.
      • index

        public java.lang.String index()
      • index

        public final Request index​(java.lang.String index)
      • indices

        public java.lang.String[] indices()
        Description copied from interface: IndicesRequest
        Returns the array of indices that the action relates to
        Specified by:
        indices in interface IndicesRequest
      • indicesOptions

        public IndicesOptions indicesOptions()
        Description copied from interface: IndicesRequest
        Returns the indices options used to resolve indices. They tell for instance whether a single index is accepted, whether an empty array will be converted to _all, and how wildcards will be expanded if needed.
        Specified by:
        indicesOptions in interface IndicesRequest
      • shardId

        @Nullable
        public ShardId shardId()
        Returns:
        the shardId of the shard where this operation should be executed on. can be null if the shardID has not yet been resolved
      • waitForActiveShards

        public final Request waitForActiveShards​(ActiveShardCount waitForActiveShards)
        Sets the number of shard copies that must be active before proceeding with the replication operation. Defaults to ActiveShardCount.DEFAULT, which requires one shard copy (the primary) to be active. Set this value to ActiveShardCount.ALL to wait for all shards (primary and all replicas) to be active. Otherwise, use ActiveShardCount.from(int) to set this value to any non-negative integer, up to the total number of shard copies (number of replicas + 1).
      • createTask

        public Task createTask​(long id,
                               java.lang.String type,
                               java.lang.String action,
                               TaskId parentTaskId,
                               java.util.Map<java.lang.String,​java.lang.String> headers)
        Description copied from interface: TaskAwareRequest
        Returns the task object that should be used to keep track of the processing of the request.
        Specified by:
        createTask in interface TaskAwareRequest
      • toString

        public abstract java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getDescription

        public java.lang.String getDescription()
        Description copied from interface: TaskAwareRequest
        Returns optional description of the request to be displayed by the task manager
        Specified by:
        getDescription in interface TaskAwareRequest
      • onRetry

        public void onRetry()
        This method is called before this replication request is retried the first time.