java.lang.Object
org.elasticsearch.xpack.core.ml.job.config.Job.Builder
- All Implemented Interfaces:
Writeable
- Enclosing class:
Job
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a job.Builds a job with the givencreateTimeand the current version.booleangetId()inthashCode()setAllowLazyOpen(boolean allowLazyOpen) setAnalysisConfig(AnalysisConfig.Builder configBuilder) setAnalysisLimits(AnalysisLimits analysisLimits) setBackgroundPersistInterval(org.elasticsearch.core.TimeValue backgroundPersistInterval) setBlocked(Blocked blocked) setCreateTime(Date createTime) setCustomSettings(Map<String, Object> customSettings) setDailyModelSnapshotRetentionAfterDays(Long dailyModelSnapshotRetentionAfterDays) setDataDescription(DataDescription.Builder dataDescription) setDatafeed(DatafeedConfig.Builder datafeed) setDatafeedIndicesOptionsIfRequired(IndicesOptions indicesOptions) This is used for parsing.setDeleting(boolean deleting) setDescription(String description) setFinishedTime(Date finishedTime) voidvoidsetJobVersion(MlConfigVersion jobVersion) setModelPlotConfig(ModelPlotConfig modelPlotConfig) setModelSnapshotId(String modelSnapshotId) setModelSnapshotMinVersion(MlConfigVersion modelSnapshotMinVersion) setModelSnapshotRetentionDays(Long modelSnapshotRetentionDays) setRenormalizationWindowDays(Long renormalizationWindowDays) setResultsIndexName(String resultsIndexName) setResultsRetentionDays(Long resultsRetentionDays) voidvalidateAnalysisLimitsAndSetDefaults(ByteSizeValue maxModelMemoryLimit) This is meant to be called when a new job is created.voidValidates that the Detector configs are unique up to detectorIndex field (which is ignored).voidCall this method to validate that the job JSON provided by a user is valid.voidValidates thatmodelSnapshotRetentionDaysanddailyModelSnapshotRetentionAfterDaysmake sense, both individually and in combination.voidThis is meant to be called when a new job is created.voidwriteTo(StreamOutput out)
-
Constructor Details
-
Builder
public Builder() -
Builder
-
Builder
-
Builder
- Throws:
IOException
-
-
Method Details
-
setId
-
getId
-
setJobVersion
-
setGroups
-
getGroups
-
setCustomSettings
-
setDescription
-
setAnalysisConfig
-
getAnalysisConfig
-
setAnalysisLimits
-
setCreateTime
-
setFinishedTime
-
setDataDescription
-
setModelPlotConfig
-
setBackgroundPersistInterval
public Job.Builder setBackgroundPersistInterval(org.elasticsearch.core.TimeValue backgroundPersistInterval) -
setRenormalizationWindowDays
-
setModelSnapshotRetentionDays
-
getModelSnapshotRetentionDays
-
setDailyModelSnapshotRetentionAfterDays
public Job.Builder setDailyModelSnapshotRetentionAfterDays(Long dailyModelSnapshotRetentionAfterDays) -
setResultsRetentionDays
-
setModelSnapshotId
-
setModelSnapshotMinVersion
-
setResultsIndexName
-
setDeleting
-
setAllowLazyOpen
-
setBlocked
-
setDatafeed
-
getDatafeedConfig
-
setDatafeedIndicesOptionsIfRequired
This is used for parsing. If the datafeed_config exists AND its indices options are `null`, we set them to these options- Parameters:
indicesOptions- To set if the datafeed indices options are null- Returns:
- The job builder.
-
writeTo
- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
equals
-
hashCode
public int hashCode() -
validateInputFields
public void validateInputFields()Call this method to validate that the job JSON provided by a user is valid. Throws an exception if there are any problems; normal return implies valid. -
validateAnalysisLimitsAndSetDefaults
This is meant to be called when a new job is created. It will optionally validate the model memory limit against the max limit and it will set the current version defaults to missing values. -
validateModelSnapshotRetentionSettingsAndSetDefaults
public void validateModelSnapshotRetentionSettingsAndSetDefaults()This is meant to be called when a new job is created. It setsdailyModelSnapshotRetentionAfterDaysto the default value if it is not set and the default makes sense. -
validateModelSnapshotRetentionSettings
public void validateModelSnapshotRetentionSettings()Validates thatmodelSnapshotRetentionDaysanddailyModelSnapshotRetentionAfterDaysmake sense, both individually and in combination. -
validateDetectorsAreUnique
public void validateDetectorsAreUnique()Validates that the Detector configs are unique up to detectorIndex field (which is ignored). -
build
Builds a job with the givencreateTimeand the current version. This should be used when a new job is created as opposed tobuild().- Parameters:
createTime- The time this job was created- Returns:
- The job
-
build
Builds a job. This should be used when an existing job is being built as opposed tobuild(Date).- Returns:
- The job
-