use of org.opensearch.ml.common.transport.execute.MLExecuteTaskResponse in project ml-commons by opensearch-project.
the class MLExecuteTaskRunner method executeTask.
/**
* Execute algorithm and return result.
* TODO: 1. support backend task run; 2. support dispatch task to remote node
* @param request MLExecuteTaskRequest
* @param transportService transport service
* @param listener Action listener
*/
@Override
public void executeTask(MLExecuteTaskRequest request, TransportService transportService, ActionListener<MLExecuteTaskResponse> listener) {
threadPool.executor(TASK_THREAD_POOL).execute(() -> {
Input input = request.getInput();
Output output = MLEngine.execute(input);
MLExecuteTaskResponse response = MLExecuteTaskResponse.builder().output(output).build();
listener.onResponse(response);
});
}
Aggregations