@@ -26,13 +26,13 @@ public abstract class InferenceOperator<InferenceResult extends InferenceService
2626 private final String inferenceId ;
2727 private final BlockFactory blockFactory ;
2828
29- private final BulkInferenceExecutor < InferenceResult , Page > bulkInferenceExecutor ;
29+ private final BulkInferenceExecutor bulkInferenceExecutor ;
3030
3131 @ SuppressWarnings ("this-escape" )
3232 public InferenceOperator (DriverContext driverContext , InferenceRunner inferenceRunner , ThreadPool threadPool , String inferenceId ) {
3333 super (driverContext , threadPool .getThreadContext (), MAX_INFERENCE_WORKER );
3434 this .blockFactory = driverContext .blockFactory ();
35- this .bulkInferenceExecutor = new BulkInferenceExecutor <> (inferenceRunner , threadPool , bulkExecutionConfig ());
35+ this .bulkInferenceExecutor = new BulkInferenceExecutor (inferenceRunner , threadPool , bulkExecutionConfig ());
3636 this .inferenceId = inferenceId ;
3737 }
3838
@@ -75,5 +75,13 @@ protected BulkInferenceExecutionConfig bulkExecutionConfig() {
7575
7676 protected abstract BulkInferenceRequestIterator requests (Page input );
7777
78- protected abstract BulkInferenceOutputBuilder <InferenceResult , Page > outputBuilder (Page input );
78+ protected abstract OutputBuilder <InferenceResult > outputBuilder (Page input );
79+
80+ public abstract static class OutputBuilder <InferenceResult extends InferenceServiceResults > extends BulkInferenceOutputBuilder <
81+ InferenceResult ,
82+ Page > {
83+ protected void releasePageOnAnyThread (Page page ) {
84+ InferenceOperator .releasePageOnAnyThread (page );
85+ }
86+ }
7987}
0 commit comments