Use a Scala client

Brief introduction

Since Scala is also a JVM language, you can directly invoke the Java-implemented gRPC client, so it is easier to invoke ModelService using Scala or Spark.

Usage example

Previously, we provided a https://github.com/tobegit3hub/deep_recommend_system Java client example where the Java implementation client was introduced directly, and then the Scala client was implemented.

object ScalaDensePredictClient {

  def main(args: Array[String]): Unit = {
    System.out.println("Start scala project")

    var host: String = "127.0.0.1"
    var port: Int = 9000
    var modelName: String = "dense"
    var modelVersion: Long = 1

    // Create dense predict client
    val client: DensePredictClient = new DensePredictClient(host, port)

    // Run predict client to send request
    client.predict_example(modelName, modelVersion)

    System.out.println("End of predict client")
  }

}