Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

package co.elastic.clients.elasticsearch.async_search;

import co.elastic.clients.elasticsearch._types.ErrorCause;
import co.elastic.clients.json.JsonpDeserializable;
import co.elastic.clients.json.JsonpDeserializer;
import co.elastic.clients.json.JsonpMapper;
Expand All @@ -35,6 +36,7 @@
import java.lang.Long;
import java.lang.String;
import java.util.Objects;
import java.util.function.Function;
import javax.annotation.Nullable;

//----------------------------------------------------------------
Expand Down Expand Up @@ -85,6 +87,9 @@ public abstract class AsyncSearchResponseBase implements JsonpSerializable {
@Nullable
private final Long completionTimeInMillis;

@Nullable
private final ErrorCause error;

// ---------------------------------------------------------------------------------------------

protected AsyncSearchResponseBase(AbstractBuilder<?> builder) {
Expand All @@ -99,6 +104,7 @@ protected AsyncSearchResponseBase(AbstractBuilder<?> builder) {
this.startTimeInMillis = ApiTypeHelper.requireNonNull(builder.startTimeInMillis, this, "startTimeInMillis", 0);
this.completionTime = builder.completionTime;
this.completionTimeInMillis = builder.completionTimeInMillis;
this.error = builder.error;

}

Expand Down Expand Up @@ -189,6 +195,14 @@ public final Long completionTimeInMillis() {
return this.completionTimeInMillis;
}

/**
* API name: {@code error}
*/
@Nullable
public final ErrorCause error() {
return this.error;
}

/**
* Serialize this object to JSON.
*/
Expand Down Expand Up @@ -234,6 +248,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
generator.write(this.completionTimeInMillis);

}
if (this.error != null) {
generator.writeKey("error");
this.error.serialize(generator, mapper);

}

}

Expand Down Expand Up @@ -268,6 +287,9 @@ public abstract static class AbstractBuilder<BuilderT extends AbstractBuilder<Bu
@Nullable
private Long completionTimeInMillis;

@Nullable
private ErrorCause error;

/**
* API name: {@code id}
*/
Expand Down Expand Up @@ -359,6 +381,21 @@ public final BuilderT completionTimeInMillis(@Nullable Long value) {
return self();
}

/**
* API name: {@code error}
*/
public final BuilderT error(@Nullable ErrorCause value) {
this.error = value;
return self();
}

/**
* API name: {@code error}
*/
public final BuilderT error(Function<ErrorCause.Builder, ObjectBuilder<ErrorCause>> fn) {
return this.error(fn.apply(new ErrorCause.Builder()).build());
}

protected abstract BuilderT self();

}
Expand All @@ -378,6 +415,7 @@ protected static <BuilderT extends AbstractBuilder<BuilderT>> void setupAsyncSea
op.add(AbstractBuilder::completionTime, DateTime._DESERIALIZER, "completion_time");
op.add(AbstractBuilder::completionTimeInMillis, JsonpDeserializer.longDeserializer(),
"completion_time_in_millis");
op.add(AbstractBuilder::error, ErrorCause._DESERIALIZER, "error");

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,12 @@ public final CompletableFuture<DeleteAutoFollowPatternResponse> deleteAutoFollow
// ----- Endpoint: ccr.follow

/**
* Create a follower. Create a cross-cluster replication follower index that
* follows a specific leader index. When the API returns, the follower index
* exists and cross-cluster replication starts replicating operations from the
* leader index to the follower index.
* Create a follower.
* <p>
* Create a cross-cluster replication follower index that follows a specific
* leader index. When the API returns, the follower index exists and
* cross-cluster replication starts replicating operations from the leader index
* to the follower index.
*
* @see <a href=
* "https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-follow">Documentation
Expand All @@ -123,10 +125,12 @@ public CompletableFuture<FollowResponse> follow(FollowRequest request) {
}

/**
* Create a follower. Create a cross-cluster replication follower index that
* follows a specific leader index. When the API returns, the follower index
* exists and cross-cluster replication starts replicating operations from the
* leader index to the follower index.
* Create a follower.
* <p>
* Create a cross-cluster replication follower index that follows a specific
* leader index. When the API returns, the follower index exists and
* cross-cluster replication starts replicating operations from the leader index
* to the follower index.
*
* @param fn
* a function that initializes a builder to create the
Expand Down Expand Up @@ -226,8 +230,10 @@ public final CompletableFuture<FollowStatsResponse> followStats(
// ----- Endpoint: ccr.forget_follower

/**
* Forget a follower. Remove the cross-cluster replication follower retention
* leases from the leader.
* Forget a follower.
* <p>
* Remove the cross-cluster replication follower retention leases from the
* leader.
* <p>
* A following index takes out retention leases on its leader index. These
* leases are used to increase the likelihood that the shards of the leader
Expand Down Expand Up @@ -261,8 +267,10 @@ public CompletableFuture<ForgetFollowerResponse> forgetFollower(ForgetFollowerRe
}

/**
* Forget a follower. Remove the cross-cluster replication follower retention
* leases from the leader.
* Forget a follower.
* <p>
* Remove the cross-cluster replication follower retention leases from the
* leader.
* <p>
* A following index takes out retention leases on its leader index. These
* leases are used to increase the likelihood that the shards of the leader
Expand Down Expand Up @@ -450,12 +458,13 @@ public final CompletableFuture<PauseFollowResponse> pauseFollow(
// ----- Endpoint: ccr.put_auto_follow_pattern

/**
* Create or update auto-follow patterns. Create a collection of cross-cluster
* replication auto-follow patterns for a remote cluster. Newly created indices
* on the remote cluster that match any of the patterns are automatically
* configured as follower indices. Indices on the remote cluster that were
* created before the auto-follow pattern was created will not be auto-followed
* even if they match the pattern.
* Create or update auto-follow patterns.
* <p>
* Create a collection of cross-cluster replication auto-follow patterns for a
* remote cluster. Newly created indices on the remote cluster that match any of
* the patterns are automatically configured as follower indices. Indices on the
* remote cluster that were created before the auto-follow pattern was created
* will not be auto-followed even if they match the pattern.
* <p>
* This API can also be used to update auto-follow patterns. NOTE: Follower
* indices that were configured automatically before updating an auto-follow
Expand All @@ -475,12 +484,13 @@ public CompletableFuture<PutAutoFollowPatternResponse> putAutoFollowPattern(PutA
}

/**
* Create or update auto-follow patterns. Create a collection of cross-cluster
* replication auto-follow patterns for a remote cluster. Newly created indices
* on the remote cluster that match any of the patterns are automatically
* configured as follower indices. Indices on the remote cluster that were
* created before the auto-follow pattern was created will not be auto-followed
* even if they match the pattern.
* Create or update auto-follow patterns.
* <p>
* Create a collection of cross-cluster replication auto-follow patterns for a
* remote cluster. Newly created indices on the remote cluster that match any of
* the patterns are automatically configured as follower indices. Indices on the
* remote cluster that were created before the auto-follow pattern was created
* will not be auto-followed even if they match the pattern.
* <p>
* This API can also be used to update auto-follow patterns. NOTE: Follower
* indices that were configured automatically before updating an auto-follow
Expand Down Expand Up @@ -549,11 +559,13 @@ public final CompletableFuture<ResumeAutoFollowPatternResponse> resumeAutoFollow
// ----- Endpoint: ccr.resume_follow

/**
* Resume a follower. Resume a cross-cluster replication follower index that was
* paused. The follower index could have been paused with the pause follower
* API. Alternatively it could be paused due to replication that cannot be
* retried due to failures during following tasks. When this API returns, the
* follower index will resume fetching operations from the leader index.
* Resume a follower.
* <p>
* Resume a cross-cluster replication follower index that was paused. The
* follower index could have been paused with the pause follower API.
* Alternatively it could be paused due to replication that cannot be retried
* due to failures during following tasks. When this API returns, the follower
* index will resume fetching operations from the leader index.
*
* @see <a href=
* "https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-resume-follow">Documentation
Expand All @@ -568,11 +580,13 @@ public CompletableFuture<ResumeFollowResponse> resumeFollow(ResumeFollowRequest
}

/**
* Resume a follower. Resume a cross-cluster replication follower index that was
* paused. The follower index could have been paused with the pause follower
* API. Alternatively it could be paused due to replication that cannot be
* retried due to failures during following tasks. When this API returns, the
* follower index will resume fetching operations from the leader index.
* Resume a follower.
* <p>
* Resume a cross-cluster replication follower index that was paused. The
* follower index could have been paused with the pause follower API.
* Alternatively it could be paused due to replication that cannot be retried
* due to failures during following tasks. When this API returns, the follower
* index will resume fetching operations from the leader index.
*
* @param fn
* a function that initializes a builder to create the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,12 @@ public final DeleteAutoFollowPatternResponse deleteAutoFollowPattern(
// ----- Endpoint: ccr.follow

/**
* Create a follower. Create a cross-cluster replication follower index that
* follows a specific leader index. When the API returns, the follower index
* exists and cross-cluster replication starts replicating operations from the
* leader index to the follower index.
* Create a follower.
* <p>
* Create a cross-cluster replication follower index that follows a specific
* leader index. When the API returns, the follower index exists and
* cross-cluster replication starts replicating operations from the leader index
* to the follower index.
*
* @see <a href=
* "https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-follow">Documentation
Expand All @@ -125,10 +127,12 @@ public FollowResponse follow(FollowRequest request) throws IOException, Elastics
}

/**
* Create a follower. Create a cross-cluster replication follower index that
* follows a specific leader index. When the API returns, the follower index
* exists and cross-cluster replication starts replicating operations from the
* leader index to the follower index.
* Create a follower.
* <p>
* Create a cross-cluster replication follower index that follows a specific
* leader index. When the API returns, the follower index exists and
* cross-cluster replication starts replicating operations from the leader index
* to the follower index.
*
* @param fn
* a function that initializes a builder to create the
Expand Down Expand Up @@ -229,8 +233,10 @@ public final FollowStatsResponse followStats(
// ----- Endpoint: ccr.forget_follower

/**
* Forget a follower. Remove the cross-cluster replication follower retention
* leases from the leader.
* Forget a follower.
* <p>
* Remove the cross-cluster replication follower retention leases from the
* leader.
* <p>
* A following index takes out retention leases on its leader index. These
* leases are used to increase the likelihood that the shards of the leader
Expand Down Expand Up @@ -265,8 +271,10 @@ public ForgetFollowerResponse forgetFollower(ForgetFollowerRequest request)
}

/**
* Forget a follower. Remove the cross-cluster replication follower retention
* leases from the leader.
* Forget a follower.
* <p>
* Remove the cross-cluster replication follower retention leases from the
* leader.
* <p>
* A following index takes out retention leases on its leader index. These
* leases are used to increase the likelihood that the shards of the leader
Expand Down Expand Up @@ -459,12 +467,13 @@ public final PauseFollowResponse pauseFollow(
// ----- Endpoint: ccr.put_auto_follow_pattern

/**
* Create or update auto-follow patterns. Create a collection of cross-cluster
* replication auto-follow patterns for a remote cluster. Newly created indices
* on the remote cluster that match any of the patterns are automatically
* configured as follower indices. Indices on the remote cluster that were
* created before the auto-follow pattern was created will not be auto-followed
* even if they match the pattern.
* Create or update auto-follow patterns.
* <p>
* Create a collection of cross-cluster replication auto-follow patterns for a
* remote cluster. Newly created indices on the remote cluster that match any of
* the patterns are automatically configured as follower indices. Indices on the
* remote cluster that were created before the auto-follow pattern was created
* will not be auto-followed even if they match the pattern.
* <p>
* This API can also be used to update auto-follow patterns. NOTE: Follower
* indices that were configured automatically before updating an auto-follow
Expand All @@ -485,12 +494,13 @@ public PutAutoFollowPatternResponse putAutoFollowPattern(PutAutoFollowPatternReq
}

/**
* Create or update auto-follow patterns. Create a collection of cross-cluster
* replication auto-follow patterns for a remote cluster. Newly created indices
* on the remote cluster that match any of the patterns are automatically
* configured as follower indices. Indices on the remote cluster that were
* created before the auto-follow pattern was created will not be auto-followed
* even if they match the pattern.
* Create or update auto-follow patterns.
* <p>
* Create a collection of cross-cluster replication auto-follow patterns for a
* remote cluster. Newly created indices on the remote cluster that match any of
* the patterns are automatically configured as follower indices. Indices on the
* remote cluster that were created before the auto-follow pattern was created
* will not be auto-followed even if they match the pattern.
* <p>
* This API can also be used to update auto-follow patterns. NOTE: Follower
* indices that were configured automatically before updating an auto-follow
Expand Down Expand Up @@ -561,11 +571,13 @@ public final ResumeAutoFollowPatternResponse resumeAutoFollowPattern(
// ----- Endpoint: ccr.resume_follow

/**
* Resume a follower. Resume a cross-cluster replication follower index that was
* paused. The follower index could have been paused with the pause follower
* API. Alternatively it could be paused due to replication that cannot be
* retried due to failures during following tasks. When this API returns, the
* follower index will resume fetching operations from the leader index.
* Resume a follower.
* <p>
* Resume a cross-cluster replication follower index that was paused. The
* follower index could have been paused with the pause follower API.
* Alternatively it could be paused due to replication that cannot be retried
* due to failures during following tasks. When this API returns, the follower
* index will resume fetching operations from the leader index.
*
* @see <a href=
* "https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-resume-follow">Documentation
Expand All @@ -580,11 +592,13 @@ public ResumeFollowResponse resumeFollow(ResumeFollowRequest request) throws IOE
}

/**
* Resume a follower. Resume a cross-cluster replication follower index that was
* paused. The follower index could have been paused with the pause follower
* API. Alternatively it could be paused due to replication that cannot be
* retried due to failures during following tasks. When this API returns, the
* follower index will resume fetching operations from the leader index.
* Resume a follower.
* <p>
* Resume a cross-cluster replication follower index that was paused. The
* follower index could have been paused with the pause follower API.
* Alternatively it could be paused due to replication that cannot be retried
* due to failures during following tasks. When this API returns, the follower
* index will resume fetching operations from the leader index.
*
* @param fn
* a function that initializes a builder to create the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,12 @@
// typedef: ccr.follow.Request

/**
* Create a follower. Create a cross-cluster replication follower index that
* follows a specific leader index. When the API returns, the follower index
* exists and cross-cluster replication starts replicating operations from the
* leader index to the follower index.
* Create a follower.
* <p>
* Create a cross-cluster replication follower index that follows a specific
* leader index. When the API returns, the follower index exists and
* cross-cluster replication starts replicating operations from the leader index
* to the follower index.
*
* @see <a href="../doc-files/api-spec.html#ccr.follow.Request">API
* specification</a>
Expand Down
Loading