Skip to content

Commit 46bc323

Browse files
committed
rename ResetAuditorActions -> ResetMlComponentsAction
1 parent 38e1262 commit 46bc323

File tree

3 files changed

+35
-35
lines changed

3 files changed

+35
-35
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@
2222
import java.util.List;
2323
import java.util.Objects;
2424

25-
public class ResetAuditorAction extends ActionType<ResetAuditorAction.Response> {
25+
public class ResetMlComponentsAction extends ActionType<ResetMlComponentsAction.Response> {
2626

27-
public static final ResetAuditorAction INSTANCE = new ResetAuditorAction();
27+
public static final ResetMlComponentsAction INSTANCE = new ResetMlComponentsAction();
2828
public static final String NAME = "cluster:internal/xpack/ml/auditor/reset";
2929

30-
private ResetAuditorAction() {
30+
private ResetMlComponentsAction() {
3131
super(NAME);
3232
}
3333

x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/MachineLearning.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,8 @@
160160
import org.elasticsearch.xpack.core.ml.action.PutTrainedModelAliasAction;
161161
import org.elasticsearch.xpack.core.ml.action.PutTrainedModelDefinitionPartAction;
162162
import org.elasticsearch.xpack.core.ml.action.PutTrainedModelVocabularyAction;
163-
import org.elasticsearch.xpack.core.ml.action.ResetAuditorAction;
164163
import org.elasticsearch.xpack.core.ml.action.ResetJobAction;
164+
import org.elasticsearch.xpack.core.ml.action.ResetMlComponentsAction;
165165
import org.elasticsearch.xpack.core.ml.action.RevertModelSnapshotAction;
166166
import org.elasticsearch.xpack.core.ml.action.SetResetModeAction;
167167
import org.elasticsearch.xpack.core.ml.action.SetUpgradeModeAction;
@@ -271,8 +271,8 @@
271271
import org.elasticsearch.xpack.ml.action.TransportPutTrainedModelAliasAction;
272272
import org.elasticsearch.xpack.ml.action.TransportPutTrainedModelDefinitionPartAction;
273273
import org.elasticsearch.xpack.ml.action.TransportPutTrainedModelVocabularyAction;
274-
import org.elasticsearch.xpack.ml.action.TransportResetAuditorAction;
275274
import org.elasticsearch.xpack.ml.action.TransportResetJobAction;
275+
import org.elasticsearch.xpack.ml.action.TransportResetMlComponentsAction;
276276
import org.elasticsearch.xpack.ml.action.TransportRevertModelSnapshotAction;
277277
import org.elasticsearch.xpack.ml.action.TransportSetResetModeAction;
278278
import org.elasticsearch.xpack.ml.action.TransportSetUpgradeModeAction;
@@ -1567,7 +1567,7 @@ public List<ActionHandler> getActions() {
15671567
actionHandlers.add(new ActionHandler(MlMemoryAction.INSTANCE, TransportMlMemoryAction.class));
15681568
actionHandlers.add(new ActionHandler(SetUpgradeModeAction.INSTANCE, TransportSetUpgradeModeAction.class));
15691569
actionHandlers.add(new ActionHandler(SetResetModeAction.INSTANCE, TransportSetResetModeAction.class));
1570-
actionHandlers.add(new ActionHandler(ResetAuditorAction.INSTANCE, TransportResetAuditorAction.class));
1570+
actionHandlers.add(new ActionHandler(ResetMlComponentsAction.INSTANCE, TransportResetMlComponentsAction.class));
15711571
// Included in this section as it's used by MlMemoryAction
15721572
actionHandlers.add(new ActionHandler(TrainedModelCacheInfoAction.INSTANCE, TransportTrainedModelCacheInfoAction.class));
15731573
actionHandlers.add(new ActionHandler(GetMlAutoscalingStats.INSTANCE, TransportGetMlAutoscalingStats.class));
@@ -2181,17 +2181,17 @@ public void cleanUpFeature(
21812181
});
21822182

21832183
ActionListener<ResetFeatureStateResponse.ResetFeatureStateStatus> resetAuditors = ActionListener.wrap(success -> {
2184-
// reset the auditors as aliases used may be removed
2184+
// reset components, such as the auditors the trained model stats queue
21852185
client.execute(
2186-
ResetAuditorAction.INSTANCE,
2187-
ResetAuditorAction.Request.RESET_AUDITOR_REQUEST,
2186+
ResetMlComponentsAction.INSTANCE,
2187+
ResetMlComponentsAction.Request.RESET_AUDITOR_REQUEST,
21882188
ActionListener.wrap(ignored -> unsetResetModeListener.onResponse(success), unsetResetModeListener::onFailure)
21892189
);
21902190
}, failure -> {
21912191
logger.error("failed to reset machine learning", failure);
21922192
client.execute(
2193-
ResetAuditorAction.INSTANCE,
2194-
ResetAuditorAction.Request.RESET_AUDITOR_REQUEST,
2193+
ResetMlComponentsAction.INSTANCE,
2194+
ResetMlComponentsAction.Request.RESET_AUDITOR_REQUEST,
21952195
ActionListener.wrap(ignored -> unsetResetModeListener.onFailure(failure), unsetResetModeListener::onFailure)
21962196
);
21972197
});
Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -17,72 +17,72 @@
1717
import org.elasticsearch.tasks.Task;
1818
import org.elasticsearch.threadpool.ThreadPool;
1919
import org.elasticsearch.transport.TransportService;
20-
import org.elasticsearch.xpack.core.ml.action.ResetAuditorAction;
20+
import org.elasticsearch.xpack.core.ml.action.ResetMlComponentsAction;
21+
import org.elasticsearch.xpack.ml.inference.TrainedModelStatsService;
2122
import org.elasticsearch.xpack.ml.notifications.AnomalyDetectionAuditor;
2223
import org.elasticsearch.xpack.ml.notifications.DataFrameAnalyticsAuditor;
23-
import org.elasticsearch.xpack.ml.notifications.InferenceAuditor;
2424

2525
import java.io.IOException;
2626
import java.util.List;
2727

28-
public class TransportResetAuditorAction extends TransportNodesAction<
29-
ResetAuditorAction.Request,
30-
ResetAuditorAction.Response,
31-
ResetAuditorAction.NodeRequest,
32-
ResetAuditorAction.Response.ResetResponse,
28+
public class TransportResetMlComponentsAction extends TransportNodesAction<
29+
ResetMlComponentsAction.Request,
30+
ResetMlComponentsAction.Response,
31+
ResetMlComponentsAction.NodeRequest,
32+
ResetMlComponentsAction.Response.ResetResponse,
3333
Void> {
3434

3535
private final AnomalyDetectionAuditor anomalyDetectionAuditor;
3636
private final DataFrameAnalyticsAuditor dfaAuditor;
37-
private final InferenceAuditor inferenceAuditor;
37+
private final TrainedModelStatsService trainedModelStatsService;
3838

3939
@Inject
40-
public TransportResetAuditorAction(
40+
public TransportResetMlComponentsAction(
4141
ThreadPool threadPool,
4242
ClusterService clusterService,
4343
TransportService transportService,
4444
ActionFilters actionFilters,
4545
AnomalyDetectionAuditor anomalyDetectionAuditor,
4646
DataFrameAnalyticsAuditor dfaAuditor,
47-
InferenceAuditor inferenceAuditor
47+
TrainedModelStatsService trainedModelStatsService
4848
) {
4949
super(
50-
ResetAuditorAction.NAME,
50+
ResetMlComponentsAction.NAME,
5151
clusterService,
5252
transportService,
5353
actionFilters,
54-
ResetAuditorAction.NodeRequest::new,
54+
ResetMlComponentsAction.NodeRequest::new,
5555
threadPool.executor(ThreadPool.Names.MANAGEMENT)
5656
);
5757
this.anomalyDetectionAuditor = anomalyDetectionAuditor;
5858
this.dfaAuditor = dfaAuditor;
59-
this.inferenceAuditor = inferenceAuditor;
59+
this.trainedModelStatsService = trainedModelStatsService;
6060
}
6161

6262
@Override
63-
protected ResetAuditorAction.Response newResponse(
64-
ResetAuditorAction.Request request,
65-
List<ResetAuditorAction.Response.ResetResponse> resetResponses,
63+
protected ResetMlComponentsAction.Response newResponse(
64+
ResetMlComponentsAction.Request request,
65+
List<ResetMlComponentsAction.Response.ResetResponse> resetResponses,
6666
List<FailedNodeException> failures
6767
) {
68-
return new ResetAuditorAction.Response(clusterService.getClusterName(), resetResponses, failures);
68+
return new ResetMlComponentsAction.Response(clusterService.getClusterName(), resetResponses, failures);
6969
}
7070

7171
@Override
72-
protected ResetAuditorAction.NodeRequest newNodeRequest(ResetAuditorAction.Request request) {
73-
return new ResetAuditorAction.NodeRequest();
72+
protected ResetMlComponentsAction.NodeRequest newNodeRequest(ResetMlComponentsAction.Request request) {
73+
return new ResetMlComponentsAction.NodeRequest();
7474
}
7575

7676
@Override
77-
protected ResetAuditorAction.Response.ResetResponse newNodeResponse(StreamInput in, DiscoveryNode node) throws IOException {
78-
return new ResetAuditorAction.Response.ResetResponse(in);
77+
protected ResetMlComponentsAction.Response.ResetResponse newNodeResponse(StreamInput in, DiscoveryNode node) throws IOException {
78+
return new ResetMlComponentsAction.Response.ResetResponse(in);
7979
}
8080

8181
@Override
82-
protected ResetAuditorAction.Response.ResetResponse nodeOperation(ResetAuditorAction.NodeRequest request, Task task) {
82+
protected ResetMlComponentsAction.Response.ResetResponse nodeOperation(ResetMlComponentsAction.NodeRequest request, Task task) {
8383
anomalyDetectionAuditor.reset();
8484
dfaAuditor.reset();
85-
inferenceAuditor.reset();
86-
return new ResetAuditorAction.Response.ResetResponse(clusterService.localNode(), true);
85+
trainedModelStatsService.clearQueue();
86+
return new ResetMlComponentsAction.Response.ResetResponse(clusterService.localNode(), true);
8787
}
8888
}

0 commit comments

Comments
 (0)