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

Add index.final_pipeline index setting #4401

Merged
merged 1 commit into from
Feb 21, 2020
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 @@ -113,11 +113,19 @@ public interface IDynamicIndexSettings : IIsADictionary<string, object>
string DefaultPipeline { get; set; }

/// <summary>
/// The required ingest node pipeline for this index. Index requests will fail if the required pipeline is set and the pipeline
/// The required ingest pipeline for this index. Index requests will fail if the required pipeline is set and the pipeline
/// does not exist. The required pipeline can not be overridden with the pipeline parameter. A default pipeline and a required pipeline
/// can not both be set. The special pipeline name _none indicates no ingest pipeline will run.
/// </summary>
[Obsolete("Use FinalPipeline")]
string RequiredPipeline { get; set; }

/// <summary>
/// The final ingest pipeline for this index. Index requests will fail if the final pipeline is set and the pipeline does not exist.
/// The final pipeline always runs after the request pipeline (if specified) and the default pipeline (if it exists). The special pipeline
/// name `_none` indicates no ingest pipeline will run.
/// </summary>
string FinalPipeline { get; set; }
}

/// <inheritdoc />
Expand Down Expand Up @@ -195,8 +203,12 @@ public Time RefreshInterval
public string DefaultPipeline { get; set; }

/// <inheritdoc cref="IDynamicIndexSettings.RequiredPipeline" />
[Obsolete("Use FinalPipeline")]
public string RequiredPipeline { get; set; }

/// <inheritdoc cref="IDynamicIndexSettings.FinalPipeline" />
public string FinalPipeline { get; set; }

/// <summary> Add any setting to the index </summary>
public void Add(string setting, object value) => BackingDictionary[setting] = value;
}
Expand Down Expand Up @@ -232,8 +244,12 @@ public TDescriptor Setting(string setting, object value)
public TDescriptor DefaultPipeline(string defaultPipeline) => Assign(defaultPipeline, (a, v) => a.DefaultPipeline = v);

/// <inheritdoc cref="IDynamicIndexSettings.RequiredPipeline" />
[Obsolete("Use FinalPipeline")]
public TDescriptor RequiredPipeline(string requiredPipeline) => Assign(requiredPipeline, (a, v) => a.RequiredPipeline = v);

/// <inheritdoc cref="IDynamicIndexSettings.RequiredPipeline" />
public TDescriptor FinalPipeline(string finalPipeline) => Assign(finalPipeline, (a, v) => a.FinalPipeline = v);

/// <inheritdoc cref="IDynamicIndexSettings.BlocksMetadata" />
public TDescriptor BlocksMetadata(bool? blocksMetadata = true) => Assign(blocksMetadata, (a, v) => a.BlocksMetadata = v);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ void Set(string knownKey, object newValue)
Set(NumberOfReplicas, value.NumberOfReplicas);
Set(RefreshInterval, value.RefreshInterval);
Set(DefaultPipeline, value.DefaultPipeline);
#pragma warning disable 618
Set(RequiredPipeline, value.RequiredPipeline);
#pragma warning restore 618
Set(FinalPipeline, value.FinalPipeline);
Set(BlocksReadOnly, value.BlocksReadOnly);
Set(BlocksRead, value.BlocksRead);
Set(BlocksWrite, value.BlocksWrite);
Expand Down Expand Up @@ -182,7 +185,10 @@ private static void SetKnownIndexSettings(ref JsonReader reader, IJsonFormatterR
Set<bool?>(s, settings, BlocksReadOnlyAllowDelete, v => s.BlocksReadOnlyAllowDelete = v, formatterResolver);
Set<int?>(s, settings, Priority, v => s.Priority = v, formatterResolver);
Set<string>(s, settings, DefaultPipeline, v => s.DefaultPipeline = v, formatterResolver);
#pragma warning disable 618
Set<string>(s, settings, RequiredPipeline, v => s.RequiredPipeline = v, formatterResolver);
#pragma warning restore 618
Set<string>(s, settings, FinalPipeline, v => s.FinalPipeline = v, formatterResolver);

Set<Union<int, RecoveryInitialShards>>(s, settings, UpdatableIndexSettings.RecoveryInitialShards,
v => s.RecoveryInitialShards = v, formatterResolver);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using System;

namespace Nest
{
/// <summary>
Expand Down Expand Up @@ -60,7 +62,9 @@ public static class UpdatableIndexSettings
public const string RefreshInterval = "index.refresh_interval";

public const string DefaultPipeline = "index.default_pipeline";
[Obsolete("Use FinalPipeline")]
public const string RequiredPipeline = "index.required_pipeline";
public const string FinalPipeline = "index.final_pipeline";

public const string RequestsCacheEnable = "index.requests.cache.enable";
public const string RoutingAllocationDisableAllocation = "index.routing.allocation.disable_allocation";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class Usage : PromiseUsageTestBase<IIndexSettings, IndexSettingsDescripto
{ "index.number_of_replicas", 2 },
{ "index.auto_expand_replicas", "1-3" },
{ "index.default_pipeline", "a-default-pipeline" },
{ "index.required_pipeline", "a-required-pipeline" },
{ "index.final_pipeline", "a-final-pipeline" },
{ "index.refresh_interval", -1 },
{ "index.blocks.read_only", true },
{ "index.blocks.read", true },
Expand Down Expand Up @@ -48,7 +48,7 @@ public class Usage : PromiseUsageTestBase<IIndexSettings, IndexSettingsDescripto
.NumberOfShards(1)
.NumberOfReplicas(2)
.DefaultPipeline("a-default-pipeline")
.RequiredPipeline("a-required-pipeline")
.FinalPipeline("a-final-pipeline")
.AutoExpandReplicas("1-3")
.BlocksMetadata()
.BlocksRead()
Expand Down Expand Up @@ -78,7 +78,7 @@ public class Usage : PromiseUsageTestBase<IIndexSettings, IndexSettingsDescripto
NumberOfShards = 1,
NumberOfReplicas = 2,
DefaultPipeline = "a-default-pipeline",
RequiredPipeline = "a-required-pipeline",
FinalPipeline = "a-final-pipeline",
AutoExpandReplicas = "1-3",
BlocksMetadata = true,
BlocksRead = true,
Expand Down