Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport 7.x] Support index pattern exclusion in CCR AutoFollow #5833

Merged
merged 1 commit into from
Jul 11, 2021
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ public partial class CreateAutoFollowPatternRequest
public string RemoteCluster { get; set; }
/// <inheritdoc cref="IAutoFollowPattern.LeaderIndexPatterns"/>
public IEnumerable<string> LeaderIndexPatterns { get; set; }
/// <inheritdoc cref="IAutoFollowPattern.LeaderIndexExclusionPatterns"/>
public IEnumerable<string> LeaderIndexExclusionPatterns { get; set; }
/// <inheritdoc cref="IAutoFollowPattern.Settings"/>
public IIndexSettings Settings { get; set; }
/// <inheritdoc cref="IAutoFollowPattern.FollowIndexPattern"/>
Expand Down Expand Up @@ -54,6 +56,7 @@ public partial class CreateAutoFollowPatternDescriptor
{
string IAutoFollowPattern.RemoteCluster { get; set; }
IEnumerable<string> IAutoFollowPattern.LeaderIndexPatterns { get; set; }
IEnumerable<string> IAutoFollowPattern.LeaderIndexExclusionPatterns { get; set; }
string IAutoFollowPattern.FollowIndexPattern { get; set; }
IIndexSettings IAutoFollowPattern.Settings { get; set; }
int? IAutoFollowPattern.MaxReadRequestOperationCount { get; set; }
Expand All @@ -78,6 +81,14 @@ public CreateAutoFollowPatternDescriptor LeaderIndexPatterns(IEnumerable<string>
public CreateAutoFollowPatternDescriptor LeaderIndexPatterns(params string[] leaderIndexPatterns) =>
Assign(leaderIndexPatterns, (a, v) => a.LeaderIndexPatterns = v);

/// <inheritdoc cref="IAutoFollowPattern.LeaderIndexExclusionPatterns"/>
public CreateAutoFollowPatternDescriptor LeaderIndexExclusionPatterns(IEnumerable<string> leaderIndexExclusionPatterns) =>
Assign(leaderIndexExclusionPatterns, (a, v) => a.LeaderIndexExclusionPatterns = v);

/// <inheritdoc cref="IAutoFollowPattern.LeaderIndexExclusionPatterns"/>
public CreateAutoFollowPatternDescriptor LeaderIndexExclusionPatterns(params string[] leaderIndexExclusionPatterns) =>
Assign(leaderIndexExclusionPatterns, (a, v) => a.LeaderIndexExclusionPatterns = v);

/// <inheritdoc cref="IAutoFollowPattern.FollowIndexPattern"/>
public CreateAutoFollowPatternDescriptor FollowIndexPattern(string followIndexPattern) =>
Assign(followIndexPattern, (a, v) => a.FollowIndexPattern = v);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,13 @@ public interface IAutoFollowPattern
[DataMember(Name = "leader_index_patterns")]
IEnumerable<string> LeaderIndexPatterns { get; set; }

/// <summary>
/// An array of simple index patterns that can be used to exclude indices from being auto-followed. Indices in the remote cluster whose names are matching one or
/// more `leader_index_patterns` and one or more `leader_index_exclusion_patterns` won't be followed.
/// </summary>
[DataMember(Name = "leader_index_exclusion_patterns")]
IEnumerable<string> LeaderIndexExclusionPatterns { get; set; }

/// <summary>
/// Settings to override from the leader index.
/// Note that certain settings can not be overrode e.g. index.number_of_shards.
Expand Down Expand Up @@ -197,6 +204,8 @@ public class AutoFollowPattern : IAutoFollowPattern

/// <inheritdoc cref="IAutoFollowPattern.LeaderIndexPatterns" />
public IEnumerable<string> LeaderIndexPatterns { get; set; }
/// <inheritdoc cref="IAutoFollowPattern.LeaderIndexExclusionPatterns" />
public IEnumerable<string> LeaderIndexExclusionPatterns { get; set; }

/// <inheritdoc cref="IAutoFollowPattern.Settings" />
public IIndexSettings Settings { get; set; }
Expand Down