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 allow_lazy_open to machine learning jobs. #4277

Merged
merged 5 commits into from
Dec 18, 2019
Merged
Changes from 1 commit
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
19 changes: 19 additions & 0 deletions src/Nest/XPack/MachineLearning/PutJob/PutJobRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,17 @@ public partial interface IPutJobRequest
/// </summary>
[DataMember(Name ="results_index_name")]
IndexName ResultsIndexName { get; set; }

/// <summary>
/// Advanced configuration option. Whether this job should be allowed to open when there is insufficient machine learning
/// node capacity for it to be immediately assigned to a node. The default is false, which means that the
/// machine learning open job will return an error if a machine learning node with capacity to run the job cannot immediately be found.
/// (However, this is also subject to the cluster-wide xpack.ml.max_lazy_ml_nodes setting.)
/// If this option is set to true then the machine learning open job will not return an error, and the job will wait in the opening
/// state until sufficient machine learning node capacity is available.
/// </summary>
[DataMember(Name ="allow_lazy_open")]
bool? AllowLazyOpen { get; set; }
}

/// <inheritdoc />
Expand All @@ -80,6 +91,9 @@ public partial class PutJobRequest

/// <inheritdoc />
public IndexName ResultsIndexName { get; set; }

/// <inheritdoc />
public bool? AllowLazyOpen { get; set; }
}

/// <inheritdoc />
Expand All @@ -92,6 +106,7 @@ public partial class PutJobDescriptor<TDocument> where TDocument : class
IModelPlotConfig IPutJobRequest.ModelPlotConfig { get; set; }
long? IPutJobRequest.ModelSnapshotRetentionDays { get; set; }
IndexName IPutJobRequest.ResultsIndexName { get; set; }
bool? IPutJobRequest.AllowLazyOpen { get; set; }

/// <inheritdoc />
public PutJobDescriptor<TDocument> AnalysisConfig(Func<AnalysisConfigDescriptor<TDocument>, IAnalysisConfig> selector) =>
Expand Down Expand Up @@ -123,6 +138,10 @@ public PutJobDescriptor<TDocument> ResultsIndexName(IndexName indexName) =>
/// <inheritdoc />
public PutJobDescriptor<TDocument> ResultsIndexName<TIndex>() =>
Assign(typeof(TIndex), (a, v) => a.ResultsIndexName = v);

/// <inheritdoc />
public PutJobDescriptor<TDocument> AllowLazyOpen(bool? allowLazyOpen) =>
codebrain marked this conversation as resolved.
Show resolved Hide resolved
Assign(allowLazyOpen, (a, v) => a.AllowLazyOpen = v);
}

[StringEnum]
Expand Down