问个问题:
我根据实例代码提交任务:
val jobExecuteResult = client.execute(JobExecuteAction.builder()
.setCreator("allwefantasy") //creator,请求Linkis的客户端的系统名,用于做系统级隔离
.addExecuteCode("!show jobs;") //ExecutionCode 请求执行的代码
.setEngineType(new EngineType {
override val toString: String = "mlsql"
val ML = new RunType {
override val toString: String = "mlsql"
}
override def getDefaultRunType: RunType = ML
}) // 希望请求的Linkis的执行引擎类型,如Spark hive等
.setUser("allwefantasy").setParams(params).build()) //User,请求用户;用于做用户级多租户隔离
println("execId: " + jobExecuteResult.getExecID + ", taskId: " + jobExecuteResult.taskID)
// 4. 获取脚本的执行状态
var status = client.status(jobExecuteResult)
前面提交后,任务正常执行了。但是在获取任务执行状态的时候, 出现如下错误:
Exception in thread "main" DWCException{errCode=10905, desc='URL http://127.0.0.1:8001/api/rest_j/v1/entrance/120514allwefantasymlsqllocalhost:8889allwefantasy_allwefantasy_2/status request failed! ResponseBody is {"method":"/api/rest_j/v1/entrance/120514allwefantasymlsqllocalhost:8889allwefantasy_allwefantasy_2/status","status":1,"message":"TimeoutException: ","data":{"data":null}}.', ip='null', port=0, serviceKind='null'}
at com.webank.wedatasphere.linkis.httpclient.dws.response.DWSResult$class.set(DWSResult.scala:59)
at com.webank.wedatasphere.linkis.ujes.client.response.JobStatusResult.set(JobStatusResult.scala:29)
at com.webank.wedatasphere.linkis.httpclient.dws.DWSHttpClient$$anonfun$httpResponseToResult$1.apply(DWSHttpClient.scala:66)
at com.webank.wedatasphere.linkis.httpclient.dws.DWSHttpClient$$anonfun$httpResponseToResult$1.apply(DWSHttpClient.scala:62)
at scala.Option.map(Option.scala:146)
at com.webank.wedatasphere.linkis.httpclient.dws.DWSHttpClient.httpResponseToResult(DWSHttpClient.scala:62)
at com.webank.wedatasphere.linkis.httpclient.AbstractHttpClient.responseToResult(AbstractHttpClient.scala:220)
at com.webank.wedatasphere.linkis.httpclient.AbstractHttpClient.execute(AbstractHttpClient.scala:100)
at com.webank.wedatasphere.linkis.httpclient.AbstractHttpClient.execute(AbstractHttpClient.scala:91)
at com.webank.wedatasphere.linkis.ujes.client.UJESClientImpl.executeUJESJob(UJESClientImpl.scala:34)
at com.webank.wedatasphere.linkis.ujes.client.UJESClient.executeJobExecIdAction(UJESClient.scala:46)
at com.webank.wedatasphere.linkis.ujes.client.UJESClient.status(UJESClient.scala:49)
at test.UJESClientImplTest$.delayedEndpoint$test$UJESClientImplTest$1(Test.scala:50)
at test.UJESClientImplTest$delayedInit$body.apply(Test.scala:14)
at scala.Function0$class.apply$mcV$sp(Function0.scala:34)
at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12)
at scala.App$$anonfun$main$1.apply(App.scala:76)
at scala.App$$anonfun$main$1.apply(App.scala:76)
at scala.collection.immutable.List.foreach(List.scala:381)
at scala.collection.generic.TraversableForwarder$class.foreach(TraversableForwarder.scala:35)
at scala.App$class.main(App.scala:76)
at test.UJESClientImplTest$.main(Test.scala:14)
at test.UJESClientImplTest.main(Test.scala)
我看了下,服务的入口应该是EntranceRestfulApi,然后我debug /{id}/status 发现请求没有进入到这个action. 不知道啥原因。Action /execute是能够debug到的。