Skip to content

Commit cd387a5

Browse files
committed
Major refacoring of the inference operator logic.
1 parent 7100ca5 commit cd387a5

File tree

41 files changed

+3725
-2538
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+3725
-2538
lines changed

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,9 @@ public static InferenceFunctionEvaluator.Factory factory() {
5353
* Creates a new inference function evaluator with a custom operator provider.
5454
* This constructor is primarily used for testing to inject mock operator providers.
5555
*
56-
* @param foldContext the fold context containing circuit breakers and evaluation settings
5756
* @param inferenceOperatorProvider custom provider for creating inference operators
5857
*/
59-
InferenceFunctionEvaluator(FoldContext foldContext, InferenceOperatorProvider inferenceOperatorProvider) {
58+
InferenceFunctionEvaluator(InferenceOperatorProvider inferenceOperatorProvider) {
6059
this.inferenceOperatorProvider = inferenceOperatorProvider;
6160
}
6261

@@ -145,11 +144,11 @@ public CircuitBreakerStats stats(String name) {
145144
} catch (Exception e) {
146145
l.onFailure(e);
147146
} finally {
148-
Releasables.close(inferenceOperator);
147+
Releasables.closeExpectNoException(inferenceOperator);
149148
}
150149
}));
151150
} catch (Exception e) {
152-
Releasables.close(inferenceOperator);
151+
Releasables.closeExpectNoException(inferenceOperator);
153152
listener.onFailure(e);
154153
}
155154
} catch (Exception e) {
@@ -199,7 +198,7 @@ private Factory() {}
199198
* @return a new instance of {@link InferenceFunctionEvaluator}
200199
*/
201200
public InferenceFunctionEvaluator create(FoldContext foldContext, InferenceService inferenceService) {
202-
return new InferenceFunctionEvaluator(foldContext, createInferenceOperatorProvider(foldContext, inferenceService));
201+
return new InferenceFunctionEvaluator(createInferenceOperatorProvider(foldContext, inferenceService));
203202
}
204203

205204
/**

0 commit comments

Comments
 (0)