Class MachineLearningNodeClient

java.lang.Object
org.opensearch.ml.client.MachineLearningNodeClient
All Implemented Interfaces:
MachineLearningClient

public class MachineLearningNodeClient extends Object implements MachineLearningClient
  • Constructor Summary

    Constructors
    Constructor
    Description
    MachineLearningNodeClient(org.opensearch.client.node.NodeClient client)
     
  • Method Summary

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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.opensearch.ml.client.MachineLearningClient

    deleteModel, deleteTask, getModel, getTask, predict, searchModel, searchTask, train, trainAndPredict
  • Constructor Details

    • MachineLearningNodeClient

      public MachineLearningNodeClient(org.opensearch.client.node.NodeClient client)
  • Method Details

    • predict

      public void predict(String modelId, org.opensearch.ml.common.input.MLInput mlInput, org.opensearch.action.ActionListener<org.opensearch.ml.common.output.MLOutput> listener)
      Description copied from interface: MachineLearningClient
      Do prediction machine learning job
      Specified by:
      predict in interface MachineLearningClient
      Parameters:
      modelId - the trained model id
      mlInput - ML input
      listener - a listener to be notified of the result
    • trainAndPredict

      public void trainAndPredict(org.opensearch.ml.common.input.MLInput mlInput, org.opensearch.action.ActionListener<org.opensearch.ml.common.output.MLOutput> listener)
      Description copied from interface: MachineLearningClient
      Train model then predict with the same data set.
      Specified by:
      trainAndPredict in interface MachineLearningClient
      Parameters:
      mlInput - ML input
      listener - a listener to be notified of the result
    • train

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

      public void getModel(String modelId, org.opensearch.action.ActionListener<org.opensearch.ml.common.MLModel> listener)
      Description copied from interface: MachineLearningClient
      Get MLModel and return model in listener
      Specified by:
      getModel in interface MachineLearningClient
      Parameters:
      modelId - id of the model
      listener - action listener
    • deleteModel

      public void deleteModel(String modelId, org.opensearch.action.ActionListener<org.opensearch.action.delete.DeleteResponse> listener)
      Description copied from interface: MachineLearningClient
      Delete MLModel
      Specified by:
      deleteModel in interface MachineLearningClient
      Parameters:
      modelId - id of the model
      listener - action listener
    • searchModel

      public void searchModel(org.opensearch.action.search.SearchRequest searchRequest, org.opensearch.action.ActionListener<org.opensearch.action.search.SearchResponse> listener)
      Specified by:
      searchModel in interface MachineLearningClient
      Parameters:
      searchRequest - searchRequest to search the ML Model
      listener - action listener
    • getTask

      public void getTask(String taskId, org.opensearch.action.ActionListener<org.opensearch.ml.common.MLTask> listener)
      Description copied from interface: MachineLearningClient
      Get MLTask and return task in listener
      Specified by:
      getTask in interface MachineLearningClient
      Parameters:
      taskId - id of the model
      listener - action listener
    • deleteTask

      public void deleteTask(String taskId, org.opensearch.action.ActionListener<org.opensearch.action.delete.DeleteResponse> listener)
      Description copied from interface: MachineLearningClient
      Delete MLTask
      Specified by:
      deleteTask in interface MachineLearningClient
      Parameters:
      taskId - id of the task
      listener - action listener
    • searchTask

      public void searchTask(org.opensearch.action.search.SearchRequest searchRequest, org.opensearch.action.ActionListener<org.opensearch.action.search.SearchResponse> listener)
      Specified by:
      searchTask in interface MachineLearningClient
      Parameters:
      searchRequest - searchRequest to search the ML Task
      listener - action listener