Skip to content

Commit f92e1f5

Browse files
committed
Get rid of the InferenceServices class.
1 parent cd03311 commit f92e1f5

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/inference/InferenceResolver.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import org.elasticsearch.xpack.core.inference.action.GetInferenceModelAction;
1616
import org.elasticsearch.xpack.esql.core.expression.Expression;
1717
import org.elasticsearch.xpack.esql.core.expression.FoldContext;
18+
import org.elasticsearch.xpack.esql.expression.function.EsqlFunctionRegistry;
1819
import org.elasticsearch.xpack.esql.plan.logical.LogicalPlan;
1920
import org.elasticsearch.xpack.esql.plan.logical.inference.InferencePlan;
2021

@@ -155,8 +156,8 @@ private Factory(Client client) {
155156
this.client = client;
156157
}
157158

158-
public InferenceResolver create() {
159-
return new InferenceResolver(client);
159+
public InferenceResolver create(EsqlFunctionRegistry functionRegistry) {
160+
return new InferenceResolver(client, functionRegistry);
160161
}
161162
}
162163
}

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/optimizer/LogicalPlanPreOptimizerTests.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
import org.elasticsearch.xpack.esql.expression.function.vector.Knn;
2727
import org.elasticsearch.xpack.esql.expression.predicate.operator.arithmetic.Add;
2828
import org.elasticsearch.xpack.esql.inference.InferenceRunner;
29-
import org.elasticsearch.xpack.esql.inference.InferenceServices;
3029
import org.elasticsearch.xpack.esql.inference.bulk.BulkInferenceRequestIterator;
3130
import org.elasticsearch.xpack.esql.plan.logical.EsRelation;
3231
import org.elasticsearch.xpack.esql.plan.logical.Eval;
@@ -214,9 +213,9 @@ private Expression randomCondition() {
214213
}
215214

216215
private static TransportActionServices mockTransportActionServices(InferenceRunner inferenceRunner) {
217-
InferenceServices inferenceServices = mock(InferenceServices.class);
218-
when(inferenceServices.inferenceRunner()).thenReturn(inferenceRunner);
219-
return new TransportActionServices(null, null, null, null, null, null, null, inferenceServices);
216+
TransportActionServices services = mock(TransportActionServices.class);
217+
when(services.inferenceRunner()).thenReturn(inferenceRunner);
218+
return services;
220219
}
221220

222221
private static InferenceRunner mockInferenceRunner(TextEmbeddingModelMock textEmbeddingModel) {

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/optimizer/PhysicalPlanOptimizerTests.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7888,6 +7888,7 @@ private LocalExecutionPlanner.LocalExecutionPlan physicalOperationsFromPhysicalP
78887888
TestBlockFactory.getNonBreakingInstance(),
78897889
Settings.EMPTY,
78907890
config,
7891+
null,
78917892
new ExchangeSourceHandler(10, null)::createExchangeSource,
78927893
() -> exchangeSinkHandler.createExchangeSink(() -> {}),
78937894
null,

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/planner/LocalExecutionPlannerTests.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,7 @@ private LocalExecutionPlanner planner() throws IOException {
318318
null,
319319
null,
320320
null,
321+
null,
321322
esPhysicalOperationProviders(shardContexts),
322323
shardContexts
323324
);

0 commit comments

Comments
 (0)