|
|
@@ -449,9 +449,7 @@ import org.elasticsearch.xpack.ml.utils.persistence.ResultsPersisterService;
|
|
|
import org.elasticsearch.xpack.ml.vectors.TextEmbeddingQueryVectorBuilder;
|
|
|
|
|
|
import java.io.IOException;
|
|
|
-import java.time.Clock;
|
|
|
import java.util.ArrayList;
|
|
|
-import java.util.Arrays;
|
|
|
import java.util.Collection;
|
|
|
import java.util.Collections;
|
|
|
import java.util.List;
|
|
|
@@ -460,8 +458,6 @@ import java.util.concurrent.ConcurrentHashMap;
|
|
|
import java.util.function.Supplier;
|
|
|
import java.util.function.UnaryOperator;
|
|
|
|
|
|
-import static java.util.Collections.emptyList;
|
|
|
-import static java.util.Collections.singletonList;
|
|
|
import static org.elasticsearch.xpack.core.ClientHelper.ML_ORIGIN;
|
|
|
import static org.elasticsearch.xpack.core.ml.job.persistence.AnomalyDetectorsIndexFields.RESULTS_INDEX_PREFIX;
|
|
|
import static org.elasticsearch.xpack.core.ml.job.persistence.AnomalyDetectorsIndexFields.STATE_INDEX_PREFIX;
|
|
|
@@ -849,11 +845,6 @@ public class MachineLearning extends Plugin
|
|
|
);
|
|
|
}
|
|
|
|
|
|
- // overridable by tests
|
|
|
- protected Clock getClock() {
|
|
|
- return Clock.systemUTC();
|
|
|
- }
|
|
|
-
|
|
|
@Override
|
|
|
public Collection<Object> createComponents(
|
|
|
Client client,
|
|
|
@@ -872,7 +863,7 @@ public class MachineLearning extends Plugin
|
|
|
) {
|
|
|
if (enabled == false) {
|
|
|
// special holder for @link(MachineLearningFeatureSetUsage) which needs access to job manager, empty if ML is disabled
|
|
|
- return singletonList(new JobManagerHolder());
|
|
|
+ return List.of(new JobManagerHolder());
|
|
|
}
|
|
|
|
|
|
this.mlUpgradeModeActionFilter.set(new MlUpgradeModeActionFilter(clusterService));
|
|
|
@@ -1188,7 +1179,18 @@ public class MachineLearning extends Plugin
|
|
|
new MlAutoscalingDeciderService(memoryTracker, settings, nodeAvailabilityZoneMapper, clusterService)
|
|
|
);
|
|
|
|
|
|
- return Arrays.asList(
|
|
|
+ MlInitializationService mlInitializationService = new MlInitializationService(
|
|
|
+ settings,
|
|
|
+ threadPool,
|
|
|
+ clusterService,
|
|
|
+ client,
|
|
|
+ mlAssignmentNotifier,
|
|
|
+ machineLearningExtension.get().isAnomalyDetectionEnabled(),
|
|
|
+ machineLearningExtension.get().isDataFrameAnalyticsEnabled(),
|
|
|
+ machineLearningExtension.get().isNlpEnabled()
|
|
|
+ );
|
|
|
+
|
|
|
+ return List.of(
|
|
|
mlLifeCycleService,
|
|
|
new MlControllerHolder(mlController),
|
|
|
jobResultsProvider,
|
|
|
@@ -1198,7 +1200,7 @@ public class MachineLearning extends Plugin
|
|
|
jobManager,
|
|
|
jobManagerHolder,
|
|
|
autodetectProcessManager,
|
|
|
- new MlInitializationService(settings, threadPool, clusterService, client, mlAssignmentNotifier),
|
|
|
+ mlInitializationService,
|
|
|
jobDataCountsPersister,
|
|
|
datafeedRunner,
|
|
|
datafeedManager,
|
|
|
@@ -1230,10 +1232,10 @@ public class MachineLearning extends Plugin
|
|
|
IndexNameExpressionResolver expressionResolver
|
|
|
) {
|
|
|
if (enabled == false) {
|
|
|
- return emptyList();
|
|
|
+ return List.of();
|
|
|
}
|
|
|
|
|
|
- return Arrays.asList(
|
|
|
+ return List.of(
|
|
|
new OpenJobPersistentTasksExecutor(
|
|
|
settings,
|
|
|
clusterService,
|
|
|
@@ -1280,207 +1282,254 @@ public class MachineLearning extends Plugin
|
|
|
Supplier<DiscoveryNodes> nodesInCluster
|
|
|
) {
|
|
|
if (false == enabled) {
|
|
|
- return emptyList();
|
|
|
+ return List.of();
|
|
|
}
|
|
|
- return Arrays.asList(
|
|
|
- new RestGetJobsAction(),
|
|
|
- new RestGetJobStatsAction(),
|
|
|
- new RestMlInfoAction(),
|
|
|
- new RestMlMemoryAction(),
|
|
|
- new RestPutJobAction(),
|
|
|
- new RestPostJobUpdateAction(),
|
|
|
- new RestDeleteJobAction(),
|
|
|
- new RestOpenJobAction(),
|
|
|
- new RestGetFiltersAction(),
|
|
|
- new RestPutFilterAction(),
|
|
|
- new RestUpdateFilterAction(),
|
|
|
- new RestDeleteFilterAction(),
|
|
|
- new RestGetInfluencersAction(),
|
|
|
- new RestGetRecordsAction(),
|
|
|
- new RestGetBucketsAction(),
|
|
|
- new RestGetOverallBucketsAction(),
|
|
|
- new RestPostDataAction(),
|
|
|
- new RestCloseJobAction(),
|
|
|
- new RestFlushJobAction(),
|
|
|
- new RestResetJobAction(),
|
|
|
- new RestValidateDetectorAction(),
|
|
|
- new RestValidateJobConfigAction(),
|
|
|
- new RestEstimateModelMemoryAction(),
|
|
|
- new RestGetCategoriesAction(),
|
|
|
- new RestGetModelSnapshotsAction(),
|
|
|
- new RestRevertModelSnapshotAction(),
|
|
|
- new RestUpdateModelSnapshotAction(),
|
|
|
- new RestGetDatafeedsAction(),
|
|
|
- new RestGetDatafeedStatsAction(),
|
|
|
- new RestPutDatafeedAction(),
|
|
|
- new RestUpdateDatafeedAction(),
|
|
|
- new RestDeleteDatafeedAction(),
|
|
|
- new RestPreviewDatafeedAction(),
|
|
|
- new RestStartDatafeedAction(),
|
|
|
- new RestStopDatafeedAction(),
|
|
|
- new RestDeleteModelSnapshotAction(),
|
|
|
- new RestDeleteExpiredDataAction(),
|
|
|
- new RestForecastJobAction(),
|
|
|
- new RestDeleteForecastAction(),
|
|
|
- new RestGetCalendarsAction(),
|
|
|
- new RestPutCalendarAction(),
|
|
|
- new RestDeleteCalendarAction(),
|
|
|
- new RestDeleteCalendarEventAction(),
|
|
|
- new RestDeleteCalendarJobAction(),
|
|
|
- new RestPutCalendarJobAction(),
|
|
|
- new RestGetCalendarEventsAction(),
|
|
|
- new RestPostCalendarEventAction(),
|
|
|
- new RestSetUpgradeModeAction(),
|
|
|
- new RestGetDataFrameAnalyticsAction(),
|
|
|
- new RestGetDataFrameAnalyticsStatsAction(),
|
|
|
- new RestPutDataFrameAnalyticsAction(),
|
|
|
- new RestPostDataFrameAnalyticsUpdateAction(),
|
|
|
- new RestDeleteDataFrameAnalyticsAction(),
|
|
|
- new RestStartDataFrameAnalyticsAction(),
|
|
|
- new RestStopDataFrameAnalyticsAction(),
|
|
|
- new RestEvaluateDataFrameAction(),
|
|
|
- new RestExplainDataFrameAnalyticsAction(),
|
|
|
- new RestGetTrainedModelsAction(),
|
|
|
- new RestDeleteTrainedModelAction(),
|
|
|
- new RestGetTrainedModelsStatsAction(),
|
|
|
- new RestPutTrainedModelAction(),
|
|
|
- new RestUpgradeJobModelSnapshotAction(),
|
|
|
- new RestGetJobModelSnapshotsUpgradeStatsAction(),
|
|
|
- new RestPutTrainedModelAliasAction(),
|
|
|
- new RestDeleteTrainedModelAliasAction(),
|
|
|
- new RestPreviewDataFrameAnalyticsAction(),
|
|
|
- new RestStartTrainedModelDeploymentAction(),
|
|
|
- new RestStopTrainedModelDeploymentAction(),
|
|
|
- new RestInferTrainedModelDeploymentAction(),
|
|
|
- new RestUpdateTrainedModelDeploymentAction(),
|
|
|
- new RestPutTrainedModelDefinitionPartAction(),
|
|
|
- new RestPutTrainedModelVocabularyAction(),
|
|
|
- new RestInferTrainedModelAction(),
|
|
|
- new RestClearDeploymentCacheAction(),
|
|
|
- // CAT Handlers
|
|
|
- new RestCatJobsAction(),
|
|
|
- new RestCatTrainedModelsAction(),
|
|
|
- new RestCatDatafeedsAction(),
|
|
|
- new RestCatDataFrameAnalyticsAction()
|
|
|
- );
|
|
|
+ List<RestHandler> restHandlers = new ArrayList<>();
|
|
|
+ restHandlers.add(new RestMlInfoAction());
|
|
|
+ restHandlers.add(new RestMlMemoryAction());
|
|
|
+ restHandlers.add(new RestSetUpgradeModeAction());
|
|
|
+ if (machineLearningExtension.get().isAnomalyDetectionEnabled()) {
|
|
|
+ restHandlers.add(new RestGetJobsAction());
|
|
|
+ restHandlers.add(new RestGetJobStatsAction());
|
|
|
+ restHandlers.add(new RestPutJobAction());
|
|
|
+ restHandlers.add(new RestPostJobUpdateAction());
|
|
|
+ restHandlers.add(new RestDeleteJobAction());
|
|
|
+ restHandlers.add(new RestOpenJobAction());
|
|
|
+ restHandlers.add(new RestGetFiltersAction());
|
|
|
+ restHandlers.add(new RestPutFilterAction());
|
|
|
+ restHandlers.add(new RestUpdateFilterAction());
|
|
|
+ restHandlers.add(new RestDeleteFilterAction());
|
|
|
+ restHandlers.add(new RestGetInfluencersAction());
|
|
|
+ restHandlers.add(new RestGetRecordsAction());
|
|
|
+ restHandlers.add(new RestGetBucketsAction());
|
|
|
+ restHandlers.add(new RestGetOverallBucketsAction());
|
|
|
+ restHandlers.add(new RestPostDataAction());
|
|
|
+ restHandlers.add(new RestCloseJobAction());
|
|
|
+ restHandlers.add(new RestFlushJobAction());
|
|
|
+ restHandlers.add(new RestResetJobAction());
|
|
|
+ restHandlers.add(new RestValidateDetectorAction());
|
|
|
+ restHandlers.add(new RestValidateJobConfigAction());
|
|
|
+ restHandlers.add(new RestEstimateModelMemoryAction());
|
|
|
+ restHandlers.add(new RestGetCategoriesAction());
|
|
|
+ restHandlers.add(new RestGetModelSnapshotsAction());
|
|
|
+ restHandlers.add(new RestRevertModelSnapshotAction());
|
|
|
+ restHandlers.add(new RestUpdateModelSnapshotAction());
|
|
|
+ restHandlers.add(new RestGetDatafeedsAction());
|
|
|
+ restHandlers.add(new RestGetDatafeedStatsAction());
|
|
|
+ restHandlers.add(new RestPutDatafeedAction());
|
|
|
+ restHandlers.add(new RestUpdateDatafeedAction());
|
|
|
+ restHandlers.add(new RestDeleteDatafeedAction());
|
|
|
+ restHandlers.add(new RestPreviewDatafeedAction());
|
|
|
+ restHandlers.add(new RestStartDatafeedAction());
|
|
|
+ restHandlers.add(new RestStopDatafeedAction());
|
|
|
+ restHandlers.add(new RestDeleteModelSnapshotAction());
|
|
|
+ restHandlers.add(new RestForecastJobAction());
|
|
|
+ restHandlers.add(new RestDeleteForecastAction());
|
|
|
+ restHandlers.add(new RestGetCalendarsAction());
|
|
|
+ restHandlers.add(new RestPutCalendarAction());
|
|
|
+ restHandlers.add(new RestDeleteCalendarAction());
|
|
|
+ restHandlers.add(new RestDeleteCalendarEventAction());
|
|
|
+ restHandlers.add(new RestDeleteCalendarJobAction());
|
|
|
+ restHandlers.add(new RestPutCalendarJobAction());
|
|
|
+ restHandlers.add(new RestGetCalendarEventsAction());
|
|
|
+ restHandlers.add(new RestPostCalendarEventAction());
|
|
|
+ restHandlers.add(new RestUpgradeJobModelSnapshotAction());
|
|
|
+ restHandlers.add(new RestGetJobModelSnapshotsUpgradeStatsAction());
|
|
|
+ restHandlers.add(new RestDeleteExpiredDataAction());
|
|
|
+ restHandlers.add(new RestCatJobsAction());
|
|
|
+ restHandlers.add(new RestCatDatafeedsAction());
|
|
|
+ }
|
|
|
+ if (machineLearningExtension.get().isDataFrameAnalyticsEnabled() || machineLearningExtension.get().isNlpEnabled()) {
|
|
|
+ restHandlers.add(new RestGetTrainedModelsAction());
|
|
|
+ restHandlers.add(new RestDeleteTrainedModelAction());
|
|
|
+ restHandlers.add(new RestGetTrainedModelsStatsAction());
|
|
|
+ restHandlers.add(new RestPutTrainedModelAction());
|
|
|
+ restHandlers.add(new RestPutTrainedModelAliasAction());
|
|
|
+ restHandlers.add(new RestDeleteTrainedModelAliasAction());
|
|
|
+ restHandlers.add(new RestPutTrainedModelDefinitionPartAction());
|
|
|
+ restHandlers.add(new RestInferTrainedModelAction());
|
|
|
+ restHandlers.add(new RestCatTrainedModelsAction());
|
|
|
+ if (machineLearningExtension.get().isDataFrameAnalyticsEnabled()) {
|
|
|
+ restHandlers.add(new RestGetDataFrameAnalyticsAction());
|
|
|
+ restHandlers.add(new RestGetDataFrameAnalyticsStatsAction());
|
|
|
+ restHandlers.add(new RestPutDataFrameAnalyticsAction());
|
|
|
+ restHandlers.add(new RestPostDataFrameAnalyticsUpdateAction());
|
|
|
+ restHandlers.add(new RestDeleteDataFrameAnalyticsAction());
|
|
|
+ restHandlers.add(new RestStartDataFrameAnalyticsAction());
|
|
|
+ restHandlers.add(new RestStopDataFrameAnalyticsAction());
|
|
|
+ restHandlers.add(new RestEvaluateDataFrameAction());
|
|
|
+ restHandlers.add(new RestExplainDataFrameAnalyticsAction());
|
|
|
+ restHandlers.add(new RestPreviewDataFrameAnalyticsAction());
|
|
|
+ restHandlers.add(new RestCatDataFrameAnalyticsAction());
|
|
|
+ }
|
|
|
+ if (machineLearningExtension.get().isNlpEnabled()) {
|
|
|
+ restHandlers.add(new RestStartTrainedModelDeploymentAction());
|
|
|
+ restHandlers.add(new RestStopTrainedModelDeploymentAction());
|
|
|
+ restHandlers.add(new RestInferTrainedModelDeploymentAction());
|
|
|
+ restHandlers.add(new RestUpdateTrainedModelDeploymentAction());
|
|
|
+ restHandlers.add(new RestPutTrainedModelVocabularyAction());
|
|
|
+ restHandlers.add(new RestClearDeploymentCacheAction());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return restHandlers;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
|
|
|
- var usageAction = new ActionHandler<>(XPackUsageFeatureAction.MACHINE_LEARNING, MachineLearningUsageTransportAction.class);
|
|
|
- var infoAction = new ActionHandler<>(XPackInfoFeatureAction.MACHINE_LEARNING, MachineLearningInfoTransportAction.class);
|
|
|
+ List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> actionHandlers = new ArrayList<>();
|
|
|
+ actionHandlers.add(new ActionHandler<>(XPackUsageFeatureAction.MACHINE_LEARNING, MachineLearningUsageTransportAction.class));
|
|
|
+ actionHandlers.add(new ActionHandler<>(XPackInfoFeatureAction.MACHINE_LEARNING, MachineLearningInfoTransportAction.class));
|
|
|
if (false == enabled) {
|
|
|
- return List.of(usageAction, infoAction);
|
|
|
+ return actionHandlers;
|
|
|
}
|
|
|
- return List.of(
|
|
|
- new ActionHandler<>(GetJobsAction.INSTANCE, TransportGetJobsAction.class),
|
|
|
- new ActionHandler<>(GetJobsStatsAction.INSTANCE, TransportGetJobsStatsAction.class),
|
|
|
- new ActionHandler<>(MlInfoAction.INSTANCE, TransportMlInfoAction.class),
|
|
|
- new ActionHandler<>(MlMemoryAction.INSTANCE, TransportMlMemoryAction.class),
|
|
|
- new ActionHandler<>(PutJobAction.INSTANCE, TransportPutJobAction.class),
|
|
|
- new ActionHandler<>(UpdateJobAction.INSTANCE, TransportUpdateJobAction.class),
|
|
|
- new ActionHandler<>(DeleteJobAction.INSTANCE, TransportDeleteJobAction.class),
|
|
|
- new ActionHandler<>(OpenJobAction.INSTANCE, TransportOpenJobAction.class),
|
|
|
- new ActionHandler<>(GetFiltersAction.INSTANCE, TransportGetFiltersAction.class),
|
|
|
- new ActionHandler<>(PutFilterAction.INSTANCE, TransportPutFilterAction.class),
|
|
|
- new ActionHandler<>(UpdateFilterAction.INSTANCE, TransportUpdateFilterAction.class),
|
|
|
- new ActionHandler<>(DeleteFilterAction.INSTANCE, TransportDeleteFilterAction.class),
|
|
|
- new ActionHandler<>(KillProcessAction.INSTANCE, TransportKillProcessAction.class),
|
|
|
- new ActionHandler<>(GetBucketsAction.INSTANCE, TransportGetBucketsAction.class),
|
|
|
- new ActionHandler<>(GetInfluencersAction.INSTANCE, TransportGetInfluencersAction.class),
|
|
|
- new ActionHandler<>(GetOverallBucketsAction.INSTANCE, TransportGetOverallBucketsAction.class),
|
|
|
- new ActionHandler<>(GetRecordsAction.INSTANCE, TransportGetRecordsAction.class),
|
|
|
- new ActionHandler<>(PostDataAction.INSTANCE, TransportPostDataAction.class),
|
|
|
- new ActionHandler<>(CloseJobAction.INSTANCE, TransportCloseJobAction.class),
|
|
|
- new ActionHandler<>(FinalizeJobExecutionAction.INSTANCE, TransportFinalizeJobExecutionAction.class),
|
|
|
- new ActionHandler<>(FlushJobAction.INSTANCE, TransportFlushJobAction.class),
|
|
|
- new ActionHandler<>(ResetJobAction.INSTANCE, TransportResetJobAction.class),
|
|
|
- new ActionHandler<>(ValidateDetectorAction.INSTANCE, TransportValidateDetectorAction.class),
|
|
|
- new ActionHandler<>(ValidateJobConfigAction.INSTANCE, TransportValidateJobConfigAction.class),
|
|
|
- new ActionHandler<>(EstimateModelMemoryAction.INSTANCE, TransportEstimateModelMemoryAction.class),
|
|
|
- new ActionHandler<>(GetCategoriesAction.INSTANCE, TransportGetCategoriesAction.class),
|
|
|
- new ActionHandler<>(GetModelSnapshotsAction.INSTANCE, TransportGetModelSnapshotsAction.class),
|
|
|
- new ActionHandler<>(RevertModelSnapshotAction.INSTANCE, TransportRevertModelSnapshotAction.class),
|
|
|
- new ActionHandler<>(UpdateModelSnapshotAction.INSTANCE, TransportUpdateModelSnapshotAction.class),
|
|
|
- new ActionHandler<>(GetDatafeedsAction.INSTANCE, TransportGetDatafeedsAction.class),
|
|
|
- new ActionHandler<>(GetDatafeedsStatsAction.INSTANCE, TransportGetDatafeedsStatsAction.class),
|
|
|
- new ActionHandler<>(PutDatafeedAction.INSTANCE, TransportPutDatafeedAction.class),
|
|
|
- new ActionHandler<>(UpdateDatafeedAction.INSTANCE, TransportUpdateDatafeedAction.class),
|
|
|
- new ActionHandler<>(DeleteDatafeedAction.INSTANCE, TransportDeleteDatafeedAction.class),
|
|
|
- new ActionHandler<>(PreviewDatafeedAction.INSTANCE, TransportPreviewDatafeedAction.class),
|
|
|
- new ActionHandler<>(StartDatafeedAction.INSTANCE, TransportStartDatafeedAction.class),
|
|
|
- new ActionHandler<>(StopDatafeedAction.INSTANCE, TransportStopDatafeedAction.class),
|
|
|
- new ActionHandler<>(IsolateDatafeedAction.INSTANCE, TransportIsolateDatafeedAction.class),
|
|
|
- new ActionHandler<>(DeleteModelSnapshotAction.INSTANCE, TransportDeleteModelSnapshotAction.class),
|
|
|
- new ActionHandler<>(UpdateProcessAction.INSTANCE, TransportUpdateProcessAction.class),
|
|
|
- new ActionHandler<>(DeleteExpiredDataAction.INSTANCE, TransportDeleteExpiredDataAction.class),
|
|
|
- new ActionHandler<>(ForecastJobAction.INSTANCE, TransportForecastJobAction.class),
|
|
|
- new ActionHandler<>(DeleteForecastAction.INSTANCE, TransportDeleteForecastAction.class),
|
|
|
- new ActionHandler<>(GetCalendarsAction.INSTANCE, TransportGetCalendarsAction.class),
|
|
|
- new ActionHandler<>(PutCalendarAction.INSTANCE, TransportPutCalendarAction.class),
|
|
|
- new ActionHandler<>(DeleteCalendarAction.INSTANCE, TransportDeleteCalendarAction.class),
|
|
|
- new ActionHandler<>(DeleteCalendarEventAction.INSTANCE, TransportDeleteCalendarEventAction.class),
|
|
|
- new ActionHandler<>(UpdateCalendarJobAction.INSTANCE, TransportUpdateCalendarJobAction.class),
|
|
|
- new ActionHandler<>(GetCalendarEventsAction.INSTANCE, TransportGetCalendarEventsAction.class),
|
|
|
- new ActionHandler<>(PostCalendarEventsAction.INSTANCE, TransportPostCalendarEventsAction.class),
|
|
|
- new ActionHandler<>(PersistJobAction.INSTANCE, TransportPersistJobAction.class),
|
|
|
- new ActionHandler<>(SetUpgradeModeAction.INSTANCE, TransportSetUpgradeModeAction.class),
|
|
|
- new ActionHandler<>(GetDataFrameAnalyticsAction.INSTANCE, TransportGetDataFrameAnalyticsAction.class),
|
|
|
- new ActionHandler<>(GetDataFrameAnalyticsStatsAction.INSTANCE, TransportGetDataFrameAnalyticsStatsAction.class),
|
|
|
- new ActionHandler<>(PutDataFrameAnalyticsAction.INSTANCE, TransportPutDataFrameAnalyticsAction.class),
|
|
|
- new ActionHandler<>(UpdateDataFrameAnalyticsAction.INSTANCE, TransportUpdateDataFrameAnalyticsAction.class),
|
|
|
- new ActionHandler<>(DeleteDataFrameAnalyticsAction.INSTANCE, TransportDeleteDataFrameAnalyticsAction.class),
|
|
|
- new ActionHandler<>(StartDataFrameAnalyticsAction.INSTANCE, TransportStartDataFrameAnalyticsAction.class),
|
|
|
- new ActionHandler<>(StopDataFrameAnalyticsAction.INSTANCE, TransportStopDataFrameAnalyticsAction.class),
|
|
|
- new ActionHandler<>(EvaluateDataFrameAction.INSTANCE, TransportEvaluateDataFrameAction.class),
|
|
|
- new ActionHandler<>(ExplainDataFrameAnalyticsAction.INSTANCE, TransportExplainDataFrameAnalyticsAction.class),
|
|
|
- new ActionHandler<>(InferModelAction.INSTANCE, TransportInternalInferModelAction.class),
|
|
|
- new ActionHandler<>(InferModelAction.EXTERNAL_INSTANCE, TransportExternalInferModelAction.class),
|
|
|
- new ActionHandler<>(TrainedModelCacheInfoAction.INSTANCE, TransportTrainedModelCacheInfoAction.class),
|
|
|
- new ActionHandler<>(GetTrainedModelsAction.INSTANCE, TransportGetTrainedModelsAction.class),
|
|
|
- new ActionHandler<>(DeleteTrainedModelAction.INSTANCE, TransportDeleteTrainedModelAction.class),
|
|
|
- new ActionHandler<>(GetTrainedModelsStatsAction.INSTANCE, TransportGetTrainedModelsStatsAction.class),
|
|
|
- new ActionHandler<>(PutTrainedModelAction.INSTANCE, TransportPutTrainedModelAction.class),
|
|
|
- new ActionHandler<>(UpgradeJobModelSnapshotAction.INSTANCE, TransportUpgradeJobModelSnapshotAction.class),
|
|
|
- new ActionHandler<>(CancelJobModelSnapshotUpgradeAction.INSTANCE, TransportCancelJobModelSnapshotUpgradeAction.class),
|
|
|
- new ActionHandler<>(GetJobModelSnapshotsUpgradeStatsAction.INSTANCE, TransportGetJobModelSnapshotsUpgradeStatsAction.class),
|
|
|
- new ActionHandler<>(PutTrainedModelAliasAction.INSTANCE, TransportPutTrainedModelAliasAction.class),
|
|
|
- new ActionHandler<>(DeleteTrainedModelAliasAction.INSTANCE, TransportDeleteTrainedModelAliasAction.class),
|
|
|
- new ActionHandler<>(PreviewDataFrameAnalyticsAction.INSTANCE, TransportPreviewDataFrameAnalyticsAction.class),
|
|
|
- new ActionHandler<>(SetResetModeAction.INSTANCE, TransportSetResetModeAction.class),
|
|
|
- new ActionHandler<>(StartTrainedModelDeploymentAction.INSTANCE, TransportStartTrainedModelDeploymentAction.class),
|
|
|
- new ActionHandler<>(StopTrainedModelDeploymentAction.INSTANCE, TransportStopTrainedModelDeploymentAction.class),
|
|
|
- new ActionHandler<>(InferTrainedModelDeploymentAction.INSTANCE, TransportInferTrainedModelDeploymentAction.class),
|
|
|
- new ActionHandler<>(UpdateTrainedModelDeploymentAction.INSTANCE, TransportUpdateTrainedModelDeploymentAction.class),
|
|
|
- new ActionHandler<>(GetDeploymentStatsAction.INSTANCE, TransportGetDeploymentStatsAction.class),
|
|
|
- new ActionHandler<>(GetDatafeedRunningStateAction.INSTANCE, TransportGetDatafeedRunningStateAction.class),
|
|
|
- new ActionHandler<>(CreateTrainedModelAssignmentAction.INSTANCE, TransportCreateTrainedModelAssignmentAction.class),
|
|
|
- new ActionHandler<>(DeleteTrainedModelAssignmentAction.INSTANCE, TransportDeleteTrainedModelAssignmentAction.class),
|
|
|
- new ActionHandler<>(PutTrainedModelDefinitionPartAction.INSTANCE, TransportPutTrainedModelDefinitionPartAction.class),
|
|
|
- new ActionHandler<>(PutTrainedModelVocabularyAction.INSTANCE, TransportPutTrainedModelVocabularyAction.class),
|
|
|
- new ActionHandler<>(
|
|
|
- UpdateTrainedModelAssignmentRoutingInfoAction.INSTANCE,
|
|
|
- TransportUpdateTrainedModelAssignmentStateAction.class
|
|
|
- ),
|
|
|
- new ActionHandler<>(ClearDeploymentCacheAction.INSTANCE, TransportClearDeploymentCacheAction.class),
|
|
|
- usageAction,
|
|
|
- infoAction
|
|
|
- );
|
|
|
+ actionHandlers.add(new ActionHandler<>(MlInfoAction.INSTANCE, TransportMlInfoAction.class));
|
|
|
+ actionHandlers.add(new ActionHandler<>(MlMemoryAction.INSTANCE, TransportMlMemoryAction.class));
|
|
|
+ actionHandlers.add(new ActionHandler<>(SetUpgradeModeAction.INSTANCE, TransportSetUpgradeModeAction.class));
|
|
|
+ actionHandlers.add(new ActionHandler<>(SetResetModeAction.INSTANCE, TransportSetResetModeAction.class));
|
|
|
+ if (machineLearningExtension.get().isAnomalyDetectionEnabled()) {
|
|
|
+ actionHandlers.add(new ActionHandler<>(GetJobsAction.INSTANCE, TransportGetJobsAction.class));
|
|
|
+ actionHandlers.add(new ActionHandler<>(GetJobsStatsAction.INSTANCE, TransportGetJobsStatsAction.class));
|
|
|
+ actionHandlers.add(new ActionHandler<>(PutJobAction.INSTANCE, TransportPutJobAction.class));
|
|
|
+ actionHandlers.add(new ActionHandler<>(UpdateJobAction.INSTANCE, TransportUpdateJobAction.class));
|
|
|
+ actionHandlers.add(new ActionHandler<>(DeleteJobAction.INSTANCE, TransportDeleteJobAction.class));
|
|
|
+ actionHandlers.add(new ActionHandler<>(OpenJobAction.INSTANCE, TransportOpenJobAction.class));
|
|
|
+ actionHandlers.add(new ActionHandler<>(GetFiltersAction.INSTANCE, TransportGetFiltersAction.class));
|
|
|
+ actionHandlers.add(new ActionHandler<>(PutFilterAction.INSTANCE, TransportPutFilterAction.class));
|
|
|
+ actionHandlers.add(new ActionHandler<>(UpdateFilterAction.INSTANCE, TransportUpdateFilterAction.class));
|
|
|
+ actionHandlers.add(new ActionHandler<>(DeleteFilterAction.INSTANCE, TransportDeleteFilterAction.class));
|
|
|
+ actionHandlers.add(new ActionHandler<>(KillProcessAction.INSTANCE, TransportKillProcessAction.class));
|
|
|
+ actionHandlers.add(new ActionHandler<>(GetBucketsAction.INSTANCE, TransportGetBucketsAction.class));
|
|
|
+ actionHandlers.add(new ActionHandler<>(GetInfluencersAction.INSTANCE, TransportGetInfluencersAction.class));
|
|
|
+ actionHandlers.add(new ActionHandler<>(GetOverallBucketsAction.INSTANCE, TransportGetOverallBucketsAction.class));
|
|
|
+ actionHandlers.add(new ActionHandler<>(GetRecordsAction.INSTANCE, TransportGetRecordsAction.class));
|
|
|
+ actionHandlers.add(new ActionHandler<>(PostDataAction.INSTANCE, TransportPostDataAction.class));
|
|
|
+ actionHandlers.add(new ActionHandler<>(CloseJobAction.INSTANCE, TransportCloseJobAction.class));
|
|
|
+ actionHandlers.add(new ActionHandler<>(FinalizeJobExecutionAction.INSTANCE, TransportFinalizeJobExecutionAction.class));
|
|
|
+ actionHandlers.add(new ActionHandler<>(FlushJobAction.INSTANCE, TransportFlushJobAction.class));
|
|
|
+ actionHandlers.add(new ActionHandler<>(ResetJobAction.INSTANCE, TransportResetJobAction.class));
|
|
|
+ actionHandlers.add(new ActionHandler<>(ValidateDetectorAction.INSTANCE, TransportValidateDetectorAction.class));
|
|
|
+ actionHandlers.add(new ActionHandler<>(ValidateJobConfigAction.INSTANCE, TransportValidateJobConfigAction.class));
|
|
|
+ actionHandlers.add(new ActionHandler<>(EstimateModelMemoryAction.INSTANCE, TransportEstimateModelMemoryAction.class));
|
|
|
+ actionHandlers.add(new ActionHandler<>(GetCategoriesAction.INSTANCE, TransportGetCategoriesAction.class));
|
|
|
+ actionHandlers.add(new ActionHandler<>(GetModelSnapshotsAction.INSTANCE, TransportGetModelSnapshotsAction.class));
|
|
|
+ actionHandlers.add(new ActionHandler<>(RevertModelSnapshotAction.INSTANCE, TransportRevertModelSnapshotAction.class));
|
|
|
+ actionHandlers.add(new ActionHandler<>(UpdateModelSnapshotAction.INSTANCE, TransportUpdateModelSnapshotAction.class));
|
|
|
+ actionHandlers.add(new ActionHandler<>(GetDatafeedsAction.INSTANCE, TransportGetDatafeedsAction.class));
|
|
|
+ actionHandlers.add(new ActionHandler<>(GetDatafeedsStatsAction.INSTANCE, TransportGetDatafeedsStatsAction.class));
|
|
|
+ actionHandlers.add(new ActionHandler<>(PutDatafeedAction.INSTANCE, TransportPutDatafeedAction.class));
|
|
|
+ actionHandlers.add(new ActionHandler<>(UpdateDatafeedAction.INSTANCE, TransportUpdateDatafeedAction.class));
|
|
|
+ actionHandlers.add(new ActionHandler<>(DeleteDatafeedAction.INSTANCE, TransportDeleteDatafeedAction.class));
|
|
|
+ actionHandlers.add(new ActionHandler<>(PreviewDatafeedAction.INSTANCE, TransportPreviewDatafeedAction.class));
|
|
|
+ actionHandlers.add(new ActionHandler<>(StartDatafeedAction.INSTANCE, TransportStartDatafeedAction.class));
|
|
|
+ actionHandlers.add(new ActionHandler<>(StopDatafeedAction.INSTANCE, TransportStopDatafeedAction.class));
|
|
|
+ actionHandlers.add(new ActionHandler<>(IsolateDatafeedAction.INSTANCE, TransportIsolateDatafeedAction.class));
|
|
|
+ actionHandlers.add(new ActionHandler<>(DeleteModelSnapshotAction.INSTANCE, TransportDeleteModelSnapshotAction.class));
|
|
|
+ actionHandlers.add(new ActionHandler<>(UpdateProcessAction.INSTANCE, TransportUpdateProcessAction.class));
|
|
|
+ actionHandlers.add(new ActionHandler<>(ForecastJobAction.INSTANCE, TransportForecastJobAction.class));
|
|
|
+ actionHandlers.add(new ActionHandler<>(DeleteForecastAction.INSTANCE, TransportDeleteForecastAction.class));
|
|
|
+ actionHandlers.add(new ActionHandler<>(GetCalendarsAction.INSTANCE, TransportGetCalendarsAction.class));
|
|
|
+ actionHandlers.add(new ActionHandler<>(PutCalendarAction.INSTANCE, TransportPutCalendarAction.class));
|
|
|
+ actionHandlers.add(new ActionHandler<>(DeleteCalendarAction.INSTANCE, TransportDeleteCalendarAction.class));
|
|
|
+ actionHandlers.add(new ActionHandler<>(DeleteCalendarEventAction.INSTANCE, TransportDeleteCalendarEventAction.class));
|
|
|
+ actionHandlers.add(new ActionHandler<>(UpdateCalendarJobAction.INSTANCE, TransportUpdateCalendarJobAction.class));
|
|
|
+ actionHandlers.add(new ActionHandler<>(GetCalendarEventsAction.INSTANCE, TransportGetCalendarEventsAction.class));
|
|
|
+ actionHandlers.add(new ActionHandler<>(PostCalendarEventsAction.INSTANCE, TransportPostCalendarEventsAction.class));
|
|
|
+ actionHandlers.add(new ActionHandler<>(PersistJobAction.INSTANCE, TransportPersistJobAction.class));
|
|
|
+ actionHandlers.add(new ActionHandler<>(UpgradeJobModelSnapshotAction.INSTANCE, TransportUpgradeJobModelSnapshotAction.class));
|
|
|
+ actionHandlers.add(
|
|
|
+ new ActionHandler<>(CancelJobModelSnapshotUpgradeAction.INSTANCE, TransportCancelJobModelSnapshotUpgradeAction.class)
|
|
|
+ );
|
|
|
+ actionHandlers.add(
|
|
|
+ new ActionHandler<>(GetJobModelSnapshotsUpgradeStatsAction.INSTANCE, TransportGetJobModelSnapshotsUpgradeStatsAction.class)
|
|
|
+ );
|
|
|
+ actionHandlers.add(new ActionHandler<>(GetDatafeedRunningStateAction.INSTANCE, TransportGetDatafeedRunningStateAction.class));
|
|
|
+ actionHandlers.add(new ActionHandler<>(DeleteExpiredDataAction.INSTANCE, TransportDeleteExpiredDataAction.class));
|
|
|
+ }
|
|
|
+ if (machineLearningExtension.get().isDataFrameAnalyticsEnabled() || machineLearningExtension.get().isNlpEnabled()) {
|
|
|
+ actionHandlers.add(new ActionHandler<>(GetTrainedModelsAction.INSTANCE, TransportGetTrainedModelsAction.class));
|
|
|
+ actionHandlers.add(new ActionHandler<>(DeleteTrainedModelAction.INSTANCE, TransportDeleteTrainedModelAction.class));
|
|
|
+ actionHandlers.add(new ActionHandler<>(GetTrainedModelsStatsAction.INSTANCE, TransportGetTrainedModelsStatsAction.class));
|
|
|
+ actionHandlers.add(new ActionHandler<>(PutTrainedModelAction.INSTANCE, TransportPutTrainedModelAction.class));
|
|
|
+ actionHandlers.add(new ActionHandler<>(PutTrainedModelAliasAction.INSTANCE, TransportPutTrainedModelAliasAction.class));
|
|
|
+ actionHandlers.add(new ActionHandler<>(DeleteTrainedModelAliasAction.INSTANCE, TransportDeleteTrainedModelAliasAction.class));
|
|
|
+ actionHandlers.add(
|
|
|
+ new ActionHandler<>(PutTrainedModelDefinitionPartAction.INSTANCE, TransportPutTrainedModelDefinitionPartAction.class)
|
|
|
+ );
|
|
|
+ actionHandlers.add(new ActionHandler<>(InferModelAction.INSTANCE, TransportInternalInferModelAction.class));
|
|
|
+ actionHandlers.add(new ActionHandler<>(InferModelAction.EXTERNAL_INSTANCE, TransportExternalInferModelAction.class));
|
|
|
+ if (machineLearningExtension.get().isDataFrameAnalyticsEnabled()) {
|
|
|
+ actionHandlers.add(new ActionHandler<>(GetDataFrameAnalyticsAction.INSTANCE, TransportGetDataFrameAnalyticsAction.class));
|
|
|
+ actionHandlers.add(
|
|
|
+ new ActionHandler<>(GetDataFrameAnalyticsStatsAction.INSTANCE, TransportGetDataFrameAnalyticsStatsAction.class)
|
|
|
+ );
|
|
|
+ actionHandlers.add(new ActionHandler<>(PutDataFrameAnalyticsAction.INSTANCE, TransportPutDataFrameAnalyticsAction.class));
|
|
|
+ actionHandlers.add(
|
|
|
+ new ActionHandler<>(UpdateDataFrameAnalyticsAction.INSTANCE, TransportUpdateDataFrameAnalyticsAction.class)
|
|
|
+ );
|
|
|
+ actionHandlers.add(
|
|
|
+ new ActionHandler<>(DeleteDataFrameAnalyticsAction.INSTANCE, TransportDeleteDataFrameAnalyticsAction.class)
|
|
|
+ );
|
|
|
+ actionHandlers.add(
|
|
|
+ new ActionHandler<>(StartDataFrameAnalyticsAction.INSTANCE, TransportStartDataFrameAnalyticsAction.class)
|
|
|
+ );
|
|
|
+ actionHandlers.add(new ActionHandler<>(StopDataFrameAnalyticsAction.INSTANCE, TransportStopDataFrameAnalyticsAction.class));
|
|
|
+ actionHandlers.add(new ActionHandler<>(EvaluateDataFrameAction.INSTANCE, TransportEvaluateDataFrameAction.class));
|
|
|
+ actionHandlers.add(
|
|
|
+ new ActionHandler<>(ExplainDataFrameAnalyticsAction.INSTANCE, TransportExplainDataFrameAnalyticsAction.class)
|
|
|
+ );
|
|
|
+ actionHandlers.add(new ActionHandler<>(TrainedModelCacheInfoAction.INSTANCE, TransportTrainedModelCacheInfoAction.class));
|
|
|
+ actionHandlers.add(
|
|
|
+ new ActionHandler<>(PreviewDataFrameAnalyticsAction.INSTANCE, TransportPreviewDataFrameAnalyticsAction.class)
|
|
|
+ );
|
|
|
+ }
|
|
|
+ if (machineLearningExtension.get().isNlpEnabled()) {
|
|
|
+ actionHandlers.add(
|
|
|
+ new ActionHandler<>(StartTrainedModelDeploymentAction.INSTANCE, TransportStartTrainedModelDeploymentAction.class)
|
|
|
+ );
|
|
|
+ actionHandlers.add(
|
|
|
+ new ActionHandler<>(StopTrainedModelDeploymentAction.INSTANCE, TransportStopTrainedModelDeploymentAction.class)
|
|
|
+ );
|
|
|
+ actionHandlers.add(
|
|
|
+ new ActionHandler<>(InferTrainedModelDeploymentAction.INSTANCE, TransportInferTrainedModelDeploymentAction.class)
|
|
|
+ );
|
|
|
+ actionHandlers.add(
|
|
|
+ new ActionHandler<>(UpdateTrainedModelDeploymentAction.INSTANCE, TransportUpdateTrainedModelDeploymentAction.class)
|
|
|
+ );
|
|
|
+ actionHandlers.add(
|
|
|
+ new ActionHandler<>(PutTrainedModelVocabularyAction.INSTANCE, TransportPutTrainedModelVocabularyAction.class)
|
|
|
+ );
|
|
|
+ actionHandlers.add(new ActionHandler<>(ClearDeploymentCacheAction.INSTANCE, TransportClearDeploymentCacheAction.class));
|
|
|
+ actionHandlers.add(new ActionHandler<>(GetDeploymentStatsAction.INSTANCE, TransportGetDeploymentStatsAction.class));
|
|
|
+ actionHandlers.add(
|
|
|
+ new ActionHandler<>(CreateTrainedModelAssignmentAction.INSTANCE, TransportCreateTrainedModelAssignmentAction.class)
|
|
|
+ );
|
|
|
+ actionHandlers.add(
|
|
|
+ new ActionHandler<>(DeleteTrainedModelAssignmentAction.INSTANCE, TransportDeleteTrainedModelAssignmentAction.class)
|
|
|
+ );
|
|
|
+ actionHandlers.add(
|
|
|
+ new ActionHandler<>(
|
|
|
+ UpdateTrainedModelAssignmentRoutingInfoAction.INSTANCE,
|
|
|
+ TransportUpdateTrainedModelAssignmentStateAction.class
|
|
|
+ )
|
|
|
+ );
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return actionHandlers;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public List<ActionFilter> getActionFilters() {
|
|
|
if (enabled == false) {
|
|
|
- return emptyList();
|
|
|
+ return List.of();
|
|
|
}
|
|
|
|
|
|
- return singletonList(this.mlUpgradeModeActionFilter.get());
|
|
|
+ return List.of(this.mlUpgradeModeActionFilter.get());
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public List<ExecutorBuilder<?>> getExecutorBuilders(Settings unused) {
|
|
|
if (false == enabled) {
|
|
|
- return emptyList();
|
|
|
+ return List.of();
|
|
|
}
|
|
|
|
|
|
// These thread pools scale such that they can accommodate the maximum number of jobs per node
|