|
55 | 55 | import org.elasticsearch.xpack.core.ml.MlTasks;
|
56 | 56 | import org.elasticsearch.xpack.core.ml.action.FinalizeJobExecutionAction;
|
57 | 57 | import org.elasticsearch.xpack.core.ml.action.OpenJobAction;
|
58 |
| -import org.elasticsearch.xpack.core.ml.action.PutJobAction; |
59 |
| -import org.elasticsearch.xpack.core.ml.action.UpdateJobAction; |
60 |
| -import org.elasticsearch.xpack.core.ml.job.config.AnalysisLimits; |
61 | 58 | import org.elasticsearch.xpack.core.ml.job.config.DetectionRule;
|
62 | 59 | import org.elasticsearch.xpack.core.ml.job.config.Job;
|
63 | 60 | import org.elasticsearch.xpack.core.ml.job.config.JobState;
|
@@ -540,50 +537,16 @@ public void onFailure(Exception e) {
|
540 | 537 | );
|
541 | 538 |
|
542 | 539 | // Tell the job tracker to refresh the memory requirement for this job and all other jobs that have persistent tasks
|
543 |
| - ActionListener<PutJobAction.Response> jobUpdateListener = ActionListener.wrap( |
| 540 | + ActionListener<Boolean> jobUpdateListener = ActionListener.wrap( |
544 | 541 | response -> memoryTracker.refreshJobMemoryAndAllOthers(jobParams.getJobId(), memoryRequirementRefreshListener),
|
545 | 542 | listener::onFailure
|
546 | 543 | );
|
547 | 544 |
|
548 |
| - // Increase the model memory limit for 6.1 - 6.3 jobs |
549 |
| - ActionListener<Boolean> missingMappingsListener = ActionListener.wrap( |
550 |
| - response -> { |
551 |
| - Job job = jobParams.getJob(); |
552 |
| - if (job != null) { |
553 |
| - Version jobVersion = job.getJobVersion(); |
554 |
| - if (jobVersion != null && |
555 |
| - (jobVersion.onOrAfter(Version.V_6_1_0) && jobVersion.before(Version.V_6_3_0))) { |
556 |
| - // Increase model memory limit if < 512MB |
557 |
| - if (job.getAnalysisLimits() != null && job.getAnalysisLimits().getModelMemoryLimit() != null && |
558 |
| - job.getAnalysisLimits().getModelMemoryLimit() < 512L) { |
559 |
| - |
560 |
| - long updatedModelMemoryLimit = (long) (job.getAnalysisLimits().getModelMemoryLimit() * 1.3); |
561 |
| - AnalysisLimits limits = new AnalysisLimits(updatedModelMemoryLimit, |
562 |
| - job.getAnalysisLimits().getCategorizationExamplesLimit()); |
563 |
| - |
564 |
| - JobUpdate update = new JobUpdate.Builder(job.getId()).setJobVersion(Version.CURRENT) |
565 |
| - .setAnalysisLimits(limits).build(); |
566 |
| - UpdateJobAction.Request updateRequest = UpdateJobAction.Request.internal(job.getId(), update); |
567 |
| - executeAsyncWithOrigin(client, ML_ORIGIN, UpdateJobAction.INSTANCE, updateRequest, |
568 |
| - jobUpdateListener); |
569 |
| - } else { |
570 |
| - jobUpdateListener.onResponse(null); |
571 |
| - } |
572 |
| - } |
573 |
| - else { |
574 |
| - jobUpdateListener.onResponse(null); |
575 |
| - } |
576 |
| - } else { |
577 |
| - jobUpdateListener.onResponse(null); |
578 |
| - } |
579 |
| - }, listener::onFailure |
580 |
| - ); |
581 |
| - |
582 | 545 | // Try adding state doc mapping
|
583 | 546 | ActionListener<Boolean> resultsPutMappingHandler = ActionListener.wrap(
|
584 | 547 | response -> {
|
585 | 548 | addDocMappingIfMissing(AnomalyDetectorsIndex.jobStateIndexName(), ElasticsearchMappings::stateMapping,
|
586 |
| - state, missingMappingsListener); |
| 549 | + state, jobUpdateListener); |
587 | 550 | }, listener::onFailure
|
588 | 551 | );
|
589 | 552 |
|
|
0 commit comments