Class ElasticsearchCcrClient
- All Implemented Interfaces:
Closeable
,AutoCloseable
-
Field Summary
Fields inherited from class co.elastic.clients.ApiClient
transport, transportOptions
-
Constructor Summary
ConstructorsConstructorDescriptionElasticsearchCcrClient
(ElasticsearchTransport transport) ElasticsearchCcrClient
(ElasticsearchTransport transport, TransportOptions transportOptions) -
Method Summary
Modifier and TypeMethodDescriptionDelete auto-follow patterns.deleteAutoFollowPattern
(Function<DeleteAutoFollowPatternRequest.Builder, ObjectBuilder<DeleteAutoFollowPatternRequest>> fn) Delete auto-follow patterns.follow
(FollowRequest request) Create a follower.final FollowResponse
Create a follower.followInfo
(FollowInfoRequest request) Get follower information.final FollowInfoResponse
Get follower information.followStats
(FollowStatsRequest request) Get follower stats.final FollowStatsResponse
Get follower stats.forgetFollower
(ForgetFollowerRequest request) Forget a follower.final ForgetFollowerResponse
Forget a follower.Get auto-follow patterns.Get auto-follow patterns.getAutoFollowPattern
(Function<GetAutoFollowPatternRequest.Builder, ObjectBuilder<GetAutoFollowPatternRequest>> fn) Get auto-follow patterns.Pause an auto-follow pattern.pauseAutoFollowPattern
(Function<PauseAutoFollowPatternRequest.Builder, ObjectBuilder<PauseAutoFollowPatternRequest>> fn) Pause an auto-follow pattern.pauseFollow
(PauseFollowRequest request) Pause a follower.final PauseFollowResponse
Pause a follower.Create or update auto-follow patterns.putAutoFollowPattern
(Function<PutAutoFollowPatternRequest.Builder, ObjectBuilder<PutAutoFollowPatternRequest>> fn) Create or update auto-follow patterns.Resume an auto-follow pattern.resumeAutoFollowPattern
(Function<ResumeAutoFollowPatternRequest.Builder, ObjectBuilder<ResumeAutoFollowPatternRequest>> fn) Resume an auto-follow pattern.resumeFollow
(ResumeFollowRequest request) Resume a follower.final ResumeFollowResponse
Resume a follower.stats()
Get cross-cluster replication stats.stats
(CcrStatsRequest request) Get cross-cluster replication stats.final CcrStatsResponse
Get cross-cluster replication stats.unfollow
(UnfollowRequest request) Unfollow an index.final UnfollowResponse
Unfollow an index.withTransportOptions
(TransportOptions transportOptions) Creates a new client with some request optionsMethods inherited from class co.elastic.clients.ApiClient
_jsonpMapper, _transport, _transportOptions, close, getDeserializer, withTransportOptions
-
Constructor Details
-
ElasticsearchCcrClient
-
ElasticsearchCcrClient
public ElasticsearchCcrClient(ElasticsearchTransport transport, @Nullable TransportOptions transportOptions)
-
-
Method Details
-
withTransportOptions
Description copied from class:ApiClient
Creates a new client with some request options- Specified by:
withTransportOptions
in classApiClient<ElasticsearchTransport,
ElasticsearchCcrClient>
-
deleteAutoFollowPattern
public DeleteAutoFollowPatternResponse deleteAutoFollowPattern(DeleteAutoFollowPatternRequest request) throws IOException, ElasticsearchException Delete auto-follow patterns.Delete a collection of cross-cluster replication auto-follow patterns.
- Throws:
IOException
ElasticsearchException
- See Also:
-
deleteAutoFollowPattern
public final DeleteAutoFollowPatternResponse deleteAutoFollowPattern(Function<DeleteAutoFollowPatternRequest.Builder, ObjectBuilder<DeleteAutoFollowPatternRequest>> fn) throws IOException, ElasticsearchExceptionDelete auto-follow patterns.Delete a collection of cross-cluster replication auto-follow patterns.
- Parameters:
fn
- a function that initializes a builder to create theDeleteAutoFollowPatternRequest
- Throws:
IOException
ElasticsearchException
- See Also:
-
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.- Throws:
IOException
ElasticsearchException
- See Also:
-
follow
public final FollowResponse follow(Function<FollowRequest.Builder, ObjectBuilder<FollowRequest>> fn) throws IOException, ElasticsearchExceptionCreate 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.- Parameters:
fn
- a function that initializes a builder to create theFollowRequest
- Throws:
IOException
ElasticsearchException
- See Also:
-
followInfo
public FollowInfoResponse followInfo(FollowInfoRequest request) throws IOException, ElasticsearchException Get follower information.Get information about all cross-cluster replication follower indices. For example, the results include follower index names, leader index names, replication options, and whether the follower indices are active or paused.
- Throws:
IOException
ElasticsearchException
- See Also:
-
followInfo
public final FollowInfoResponse followInfo(Function<FollowInfoRequest.Builder, ObjectBuilder<FollowInfoRequest>> fn) throws IOException, ElasticsearchExceptionGet follower information.Get information about all cross-cluster replication follower indices. For example, the results include follower index names, leader index names, replication options, and whether the follower indices are active or paused.
- Parameters:
fn
- a function that initializes a builder to create theFollowInfoRequest
- Throws:
IOException
ElasticsearchException
- See Also:
-
followStats
public FollowStatsResponse followStats(FollowStatsRequest request) throws IOException, ElasticsearchException Get follower stats.Get cross-cluster replication follower stats. The API returns shard-level stats about the "following tasks" associated with each shard for the specified indices.
- Throws:
IOException
ElasticsearchException
- See Also:
-
followStats
public final FollowStatsResponse followStats(Function<FollowStatsRequest.Builder, ObjectBuilder<FollowStatsRequest>> fn) throws IOException, ElasticsearchExceptionGet follower stats.Get cross-cluster replication follower stats. The API returns shard-level stats about the "following tasks" associated with each shard for the specified indices.
- Parameters:
fn
- a function that initializes a builder to create theFollowStatsRequest
- Throws:
IOException
ElasticsearchException
- See Also:
-
forgetFollower
public ForgetFollowerResponse forgetFollower(ForgetFollowerRequest request) throws IOException, ElasticsearchException Forget a follower. Remove the cross-cluster replication follower retention leases from the leader.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 index retain the history of operations that the shards of the following index need to run replication. When a follower index is converted to a regular index by the unfollow API (either by directly calling the API or by index lifecycle management tasks), these leases are removed. However, removal of the leases can fail, for example when the remote cluster containing the leader index is unavailable. While the leases will eventually expire on their own, their extended existence can cause the leader index to hold more history than necessary and prevent index lifecycle management from performing some operations on the leader index. This API exists to enable manually removing the leases when the unfollow API is unable to do so.
NOTE: This API does not stop replication by a following index. If you use this API with a follower index that is still actively following, the following index will add back retention leases on the leader. The only purpose of this API is to handle the case of failure to remove the following retention leases after the unfollow API is invoked.
- Throws:
IOException
ElasticsearchException
- See Also:
-
forgetFollower
public final ForgetFollowerResponse forgetFollower(Function<ForgetFollowerRequest.Builder, ObjectBuilder<ForgetFollowerRequest>> fn) throws IOException, ElasticsearchExceptionForget a follower. Remove the cross-cluster replication follower retention leases from the leader.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 index retain the history of operations that the shards of the following index need to run replication. When a follower index is converted to a regular index by the unfollow API (either by directly calling the API or by index lifecycle management tasks), these leases are removed. However, removal of the leases can fail, for example when the remote cluster containing the leader index is unavailable. While the leases will eventually expire on their own, their extended existence can cause the leader index to hold more history than necessary and prevent index lifecycle management from performing some operations on the leader index. This API exists to enable manually removing the leases when the unfollow API is unable to do so.
NOTE: This API does not stop replication by a following index. If you use this API with a follower index that is still actively following, the following index will add back retention leases on the leader. The only purpose of this API is to handle the case of failure to remove the following retention leases after the unfollow API is invoked.
- Parameters:
fn
- a function that initializes a builder to create theForgetFollowerRequest
- Throws:
IOException
ElasticsearchException
- See Also:
-
getAutoFollowPattern
public GetAutoFollowPatternResponse getAutoFollowPattern(GetAutoFollowPatternRequest request) throws IOException, ElasticsearchException Get auto-follow patterns.Get cross-cluster replication auto-follow patterns.
- Throws:
IOException
ElasticsearchException
- See Also:
-
getAutoFollowPattern
public final GetAutoFollowPatternResponse getAutoFollowPattern(Function<GetAutoFollowPatternRequest.Builder, ObjectBuilder<GetAutoFollowPatternRequest>> fn) throws IOException, ElasticsearchExceptionGet auto-follow patterns.Get cross-cluster replication auto-follow patterns.
- Parameters:
fn
- a function that initializes a builder to create theGetAutoFollowPatternRequest
- Throws:
IOException
ElasticsearchException
- See Also:
-
getAutoFollowPattern
public GetAutoFollowPatternResponse getAutoFollowPattern() throws IOException, ElasticsearchExceptionGet auto-follow patterns.Get cross-cluster replication auto-follow patterns.
- Throws:
IOException
ElasticsearchException
- See Also:
-
pauseAutoFollowPattern
public PauseAutoFollowPatternResponse pauseAutoFollowPattern(PauseAutoFollowPatternRequest request) throws IOException, ElasticsearchException Pause an auto-follow pattern.Pause a cross-cluster replication auto-follow pattern. When the API returns, the auto-follow pattern is inactive. New indices that are created on the remote cluster and match the auto-follow patterns are ignored.
You can resume auto-following with the resume auto-follow pattern API. When it resumes, the auto-follow pattern is active again and automatically configures follower indices for newly created indices on the remote cluster that match its patterns. Remote indices that were created while the pattern was paused will also be followed, unless they have been deleted or closed in the interim.
- Throws:
IOException
ElasticsearchException
- See Also:
-
pauseAutoFollowPattern
public final PauseAutoFollowPatternResponse pauseAutoFollowPattern(Function<PauseAutoFollowPatternRequest.Builder, ObjectBuilder<PauseAutoFollowPatternRequest>> fn) throws IOException, ElasticsearchExceptionPause an auto-follow pattern.Pause a cross-cluster replication auto-follow pattern. When the API returns, the auto-follow pattern is inactive. New indices that are created on the remote cluster and match the auto-follow patterns are ignored.
You can resume auto-following with the resume auto-follow pattern API. When it resumes, the auto-follow pattern is active again and automatically configures follower indices for newly created indices on the remote cluster that match its patterns. Remote indices that were created while the pattern was paused will also be followed, unless they have been deleted or closed in the interim.
- Parameters:
fn
- a function that initializes a builder to create thePauseAutoFollowPatternRequest
- Throws:
IOException
ElasticsearchException
- See Also:
-
pauseFollow
public PauseFollowResponse pauseFollow(PauseFollowRequest request) throws IOException, ElasticsearchException Pause a follower.Pause a cross-cluster replication follower index. The follower index will not fetch any additional operations from the leader index. You can resume following with the resume follower API. You can pause and resume a follower index to change the configuration of the following task.
- Throws:
IOException
ElasticsearchException
- See Also:
-
pauseFollow
public final PauseFollowResponse pauseFollow(Function<PauseFollowRequest.Builder, ObjectBuilder<PauseFollowRequest>> fn) throws IOException, ElasticsearchExceptionPause a follower.Pause a cross-cluster replication follower index. The follower index will not fetch any additional operations from the leader index. You can resume following with the resume follower API. You can pause and resume a follower index to change the configuration of the following task.
- Parameters:
fn
- a function that initializes a builder to create thePauseFollowRequest
- Throws:
IOException
ElasticsearchException
- See Also:
-
putAutoFollowPattern
public PutAutoFollowPatternResponse putAutoFollowPattern(PutAutoFollowPatternRequest request) throws IOException, ElasticsearchException 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.This API can also be used to update auto-follow patterns. NOTE: Follower indices that were configured automatically before updating an auto-follow pattern will remain unchanged even if they do not match against the new patterns.
- Throws:
IOException
ElasticsearchException
- See Also:
-
putAutoFollowPattern
public final PutAutoFollowPatternResponse putAutoFollowPattern(Function<PutAutoFollowPatternRequest.Builder, ObjectBuilder<PutAutoFollowPatternRequest>> fn) throws IOException, ElasticsearchExceptionCreate 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.This API can also be used to update auto-follow patterns. NOTE: Follower indices that were configured automatically before updating an auto-follow pattern will remain unchanged even if they do not match against the new patterns.
- Parameters:
fn
- a function that initializes a builder to create thePutAutoFollowPatternRequest
- Throws:
IOException
ElasticsearchException
- See Also:
-
resumeAutoFollowPattern
public ResumeAutoFollowPatternResponse resumeAutoFollowPattern(ResumeAutoFollowPatternRequest request) throws IOException, ElasticsearchException Resume an auto-follow pattern.Resume a cross-cluster replication auto-follow pattern that was paused. The auto-follow pattern will resume configuring following indices for newly created indices that match its patterns on the remote cluster. Remote indices created while the pattern was paused will also be followed unless they have been deleted or closed in the interim.
- Throws:
IOException
ElasticsearchException
- See Also:
-
resumeAutoFollowPattern
public final ResumeAutoFollowPatternResponse resumeAutoFollowPattern(Function<ResumeAutoFollowPatternRequest.Builder, ObjectBuilder<ResumeAutoFollowPatternRequest>> fn) throws IOException, ElasticsearchExceptionResume an auto-follow pattern.Resume a cross-cluster replication auto-follow pattern that was paused. The auto-follow pattern will resume configuring following indices for newly created indices that match its patterns on the remote cluster. Remote indices created while the pattern was paused will also be followed unless they have been deleted or closed in the interim.
- Parameters:
fn
- a function that initializes a builder to create theResumeAutoFollowPatternRequest
- Throws:
IOException
ElasticsearchException
- See Also:
-
resumeFollow
public ResumeFollowResponse resumeFollow(ResumeFollowRequest request) throws IOException, ElasticsearchException 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.- Throws:
IOException
ElasticsearchException
- See Also:
-
resumeFollow
public final ResumeFollowResponse resumeFollow(Function<ResumeFollowRequest.Builder, ObjectBuilder<ResumeFollowRequest>> fn) throws IOException, ElasticsearchExceptionResume 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.- Parameters:
fn
- a function that initializes a builder to create theResumeFollowRequest
- Throws:
IOException
ElasticsearchException
- See Also:
-
stats
Get cross-cluster replication stats.This API returns stats about auto-following and the same shard-level stats as the get follower stats API.
- Throws:
IOException
ElasticsearchException
- See Also:
-
stats
public final CcrStatsResponse stats(Function<CcrStatsRequest.Builder, ObjectBuilder<CcrStatsRequest>> fn) throws IOException, ElasticsearchExceptionGet cross-cluster replication stats.This API returns stats about auto-following and the same shard-level stats as the get follower stats API.
- Parameters:
fn
- a function that initializes a builder to create theCcrStatsRequest
- Throws:
IOException
ElasticsearchException
- See Also:
-
stats
Get cross-cluster replication stats.This API returns stats about auto-following and the same shard-level stats as the get follower stats API.
- Throws:
IOException
ElasticsearchException
- See Also:
-
unfollow
public UnfollowResponse unfollow(UnfollowRequest request) throws IOException, ElasticsearchException Unfollow an index.Convert a cross-cluster replication follower index to a regular index. The API stops the following task associated with a follower index and removes index metadata and settings associated with cross-cluster replication. The follower index must be paused and closed before you call the unfollow API.
info Currently cross-cluster replication does not support converting an existing regular index to a follower index. Converting a follower index to a regular index is an irreversible operation.
- Throws:
IOException
ElasticsearchException
- See Also:
-
unfollow
public final UnfollowResponse unfollow(Function<UnfollowRequest.Builder, ObjectBuilder<UnfollowRequest>> fn) throws IOException, ElasticsearchExceptionUnfollow an index.Convert a cross-cluster replication follower index to a regular index. The API stops the following task associated with a follower index and removes index metadata and settings associated with cross-cluster replication. The follower index must be paused and closed before you call the unfollow API.
info Currently cross-cluster replication does not support converting an existing regular index to a follower index. Converting a follower index to a regular index is an irreversible operation.
- Parameters:
fn
- a function that initializes a builder to create theUnfollowRequest
- Throws:
IOException
ElasticsearchException
- See Also:
-