Skip to content

Commit 9cbc5d3

Browse files
Removing ElasticsearchInternalServiceModelValidator
1 parent 46a1285 commit 9cbc5d3

File tree

3 files changed

+1
-55
lines changed

3 files changed

+1
-55
lines changed

x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/elasticsearch/ElasticsearchInternalService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ public Model parsePersistedConfig(String inferenceEntityId, TaskType taskType, M
499499

500500
@Override
501501
public void checkModelConfig(Model model, ActionListener<Model> listener) {
502-
ModelValidatorBuilder.buildModelValidator(model.getTaskType(), true).validate(this, model, listener);
502+
ModelValidatorBuilder.buildModelValidator(model.getTaskType()).validate(this, model, listener);
503503
}
504504

505505
@Override

x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/validation/ElasticsearchInternalServiceModelValidator.java

Lines changed: 0 additions & 42 deletions
This file was deleted.

x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/validation/ModelValidatorBuilder.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,6 @@
1111
import org.elasticsearch.inference.TaskType;
1212

1313
public class ModelValidatorBuilder {
14-
15-
// TODO: Once we merge all the other service validation code we can remove the checkModelConfig function
16-
// from each service, private the buildModelValidator function below this one, and call this directly from
17-
// TransportPutInferenceModelAction.java.
18-
public static ModelValidator buildModelValidator(TaskType taskType, boolean isElasticsearchInternalService) {
19-
if (isElasticsearchInternalService) {
20-
return new ElasticsearchInternalServiceModelValidator(buildModelValidator(taskType));
21-
} else {
22-
return buildModelValidator(taskType);
23-
}
24-
}
25-
2614
public static ModelValidator buildModelValidator(TaskType taskType) {
2715
if (taskType == null) {
2816
throw new IllegalArgumentException("Task type can't be null");

0 commit comments

Comments
 (0)