Interface MachineLearningClient

  • All Known Implementing Classes:
    MachineLearningNodeClient

    public interface MachineLearningClient
    A client to provide interfaces for machine learning jobs. This will be used by other plugins.
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default org.opensearch.action.ActionFuture<org.opensearch.action.delete.DeleteResponse> deleteModel​(java.lang.String modelId)
      Delete the model with modelId.
      void deleteModel​(java.lang.String modelId, org.opensearch.action.ActionListener<org.opensearch.action.delete.DeleteResponse> listener)
      Delete MLModel
      default org.opensearch.action.ActionFuture<org.opensearch.action.delete.DeleteResponse> deleteTask​(java.lang.String taskId)
      Delete the task with taskId.
      void deleteTask​(java.lang.String taskId, org.opensearch.action.ActionListener<org.opensearch.action.delete.DeleteResponse> listener)
      Delete MLTask
      default org.opensearch.action.ActionFuture<org.opensearch.ml.common.parameter.MLModel> getModel​(java.lang.String modelId)
      Get MLModel and return ActionFuture.
      void getModel​(java.lang.String modelId, org.opensearch.action.ActionListener<org.opensearch.ml.common.parameter.MLModel> listener)
      Get MLModel and return model in listener
      default org.opensearch.action.ActionFuture<org.opensearch.ml.common.parameter.MLTask> getTask​(java.lang.String taskId)
      Get MLTask and return ActionFuture.
      void getTask​(java.lang.String taskId, org.opensearch.action.ActionListener<org.opensearch.ml.common.parameter.MLTask> listener)
      Get MLTask and return task in listener
      default org.opensearch.action.ActionFuture<org.opensearch.ml.common.parameter.MLOutput> predict​(java.lang.String modelId, org.opensearch.ml.common.parameter.MLInput mlInput)
      Do prediction machine learning job
      void predict​(java.lang.String modelId, org.opensearch.ml.common.parameter.MLInput mlInput, org.opensearch.action.ActionListener<org.opensearch.ml.common.parameter.MLOutput> listener)
      Do prediction machine learning job
      default org.opensearch.action.ActionFuture<org.opensearch.action.search.SearchResponse> searchModel​(org.opensearch.action.search.SearchRequest searchRequest)  
      void searchModel​(org.opensearch.action.search.SearchRequest searchRequest, org.opensearch.action.ActionListener<org.opensearch.action.search.SearchResponse> listener)  
      default org.opensearch.action.ActionFuture<org.opensearch.action.search.SearchResponse> searchTask​(org.opensearch.action.search.SearchRequest searchRequest)  
      void searchTask​(org.opensearch.action.search.SearchRequest searchRequest, org.opensearch.action.ActionListener<org.opensearch.action.search.SearchResponse> listener)  
      default org.opensearch.action.ActionFuture<org.opensearch.ml.common.parameter.MLOutput> train​(org.opensearch.ml.common.parameter.MLInput mlInput, boolean asyncTask)
      Do the training machine learning job.
      void train​(org.opensearch.ml.common.parameter.MLInput mlInput, boolean asyncTask, org.opensearch.action.ActionListener<org.opensearch.ml.common.parameter.MLOutput> listener)
      Do the training machine learning job.
      default org.opensearch.action.ActionFuture<org.opensearch.ml.common.parameter.MLOutput> trainAndPredict​(org.opensearch.ml.common.parameter.MLInput mlInput)
      Train model then predict with the same data set.
      void trainAndPredict​(org.opensearch.ml.common.parameter.MLInput mlInput, org.opensearch.action.ActionListener<org.opensearch.ml.common.parameter.MLOutput> listener)
      Train model then predict with the same data set.
    • Method Detail

      • predict

        default org.opensearch.action.ActionFuture<org.opensearch.ml.common.parameter.MLOutput> predict​(java.lang.String modelId,
                                                                                                        org.opensearch.ml.common.parameter.MLInput mlInput)
        Do prediction machine learning job
        Parameters:
        modelId - the trained model id
        mlInput - ML input
        Returns:
        ActionFuture of MLOutput
      • predict

        void predict​(java.lang.String modelId,
                     org.opensearch.ml.common.parameter.MLInput mlInput,
                     org.opensearch.action.ActionListener<org.opensearch.ml.common.parameter.MLOutput> listener)
        Do prediction machine learning job
        Parameters:
        modelId - the trained model id
        mlInput - ML input
        listener - a listener to be notified of the result
      • trainAndPredict

        default org.opensearch.action.ActionFuture<org.opensearch.ml.common.parameter.MLOutput> trainAndPredict​(org.opensearch.ml.common.parameter.MLInput mlInput)
        Train model then predict with the same data set.
        Parameters:
        mlInput - ML input
        Returns:
        ActionFuture of MLOutput
      • trainAndPredict

        void trainAndPredict​(org.opensearch.ml.common.parameter.MLInput mlInput,
                             org.opensearch.action.ActionListener<org.opensearch.ml.common.parameter.MLOutput> listener)
        Train model then predict with the same data set.
        Parameters:
        mlInput - ML input
        listener - a listener to be notified of the result
      • train

        default org.opensearch.action.ActionFuture<org.opensearch.ml.common.parameter.MLOutput> train​(org.opensearch.ml.common.parameter.MLInput mlInput,
                                                                                                      boolean asyncTask)
        Do the training machine learning job. The training job will be always async process. The job id will be returned in this method.
        Parameters:
        mlInput - ML input
        asyncTask - is async task or not
        Returns:
        ActionFuture of MLOutput
      • train

        void train​(org.opensearch.ml.common.parameter.MLInput mlInput,
                   boolean asyncTask,
                   org.opensearch.action.ActionListener<org.opensearch.ml.common.parameter.MLOutput> listener)
        Do the training machine learning job. The training job will be always async process. The job id will be returned in this method.
        Parameters:
        mlInput - ML input
        asyncTask - is async task or not
        listener - a listener to be notified of the result
      • getModel

        default org.opensearch.action.ActionFuture<org.opensearch.ml.common.parameter.MLModel> getModel​(java.lang.String modelId)
        Get MLModel and return ActionFuture.
        Parameters:
        modelId - id of the model
        Returns:
        ActionFuture of ml model
      • getModel

        void getModel​(java.lang.String modelId,
                      org.opensearch.action.ActionListener<org.opensearch.ml.common.parameter.MLModel> listener)
        Get MLModel and return model in listener
        Parameters:
        modelId - id of the model
        listener - action listener
      • getTask

        default org.opensearch.action.ActionFuture<org.opensearch.ml.common.parameter.MLTask> getTask​(java.lang.String taskId)
        Get MLTask and return ActionFuture.
        Parameters:
        taskId - id of the task
        Returns:
        ActionFuture of ml task
      • getTask

        void getTask​(java.lang.String taskId,
                     org.opensearch.action.ActionListener<org.opensearch.ml.common.parameter.MLTask> listener)
        Get MLTask and return task in listener
        Parameters:
        taskId - id of the model
        listener - action listener
      • deleteModel

        default org.opensearch.action.ActionFuture<org.opensearch.action.delete.DeleteResponse> deleteModel​(java.lang.String modelId)
        Delete the model with modelId.
        Parameters:
        modelId - ML model id
        Returns:
        the result future
      • deleteModel

        void deleteModel​(java.lang.String modelId,
                         org.opensearch.action.ActionListener<org.opensearch.action.delete.DeleteResponse> listener)
        Delete MLModel
        Parameters:
        modelId - id of the model
        listener - action listener
      • deleteTask

        default org.opensearch.action.ActionFuture<org.opensearch.action.delete.DeleteResponse> deleteTask​(java.lang.String taskId)
        Delete the task with taskId.
        Parameters:
        taskId - ML task id
        Returns:
        the result future
      • deleteTask

        void deleteTask​(java.lang.String taskId,
                        org.opensearch.action.ActionListener<org.opensearch.action.delete.DeleteResponse> listener)
        Delete MLTask
        Parameters:
        taskId - id of the task
        listener - action listener
      • searchModel

        default org.opensearch.action.ActionFuture<org.opensearch.action.search.SearchResponse> searchModel​(org.opensearch.action.search.SearchRequest searchRequest)
        Parameters:
        searchRequest - searchRequest to search the ML Model
        Returns:
        Action future of search response
      • searchModel

        void searchModel​(org.opensearch.action.search.SearchRequest searchRequest,
                         org.opensearch.action.ActionListener<org.opensearch.action.search.SearchResponse> listener)
        Parameters:
        searchRequest - searchRequest to search the ML Model
        listener - action listener
      • searchTask

        default org.opensearch.action.ActionFuture<org.opensearch.action.search.SearchResponse> searchTask​(org.opensearch.action.search.SearchRequest searchRequest)
        Parameters:
        searchRequest - searchRequest to search the ML Task
        Returns:
        Action future of search response
      • searchTask

        void searchTask​(org.opensearch.action.search.SearchRequest searchRequest,
                        org.opensearch.action.ActionListener<org.opensearch.action.search.SearchResponse> listener)
        Parameters:
        searchRequest - searchRequest to search the ML Task
        listener - action listener