数据湖探索 DLI-Spark作业相关:查询批处理作业状态

时间:2024-07-05 17:23:48

查询批处理作业状态

DLI 提供查询批处理作业状态的接口。您可以使用该接口查询批处理作业当前的状态信息。示例代码如下:
private static void getStateBatchJob(DLIClient client) throws DLIException  {
        BatchJob batchJob = null;
        SparkJobInfo jobInfo = new SparkJobInfo();
        jobInfo.setClusterName("queueName");
        jobInfo.setFile("xxx.jar");
        jobInfo.setClassName("your.class.name");
        batchJob = new BatchJob(client.getCluster("queueName"), jobInfo);
        batchJob.asyncSubmit();
        SparkJobStatus sparkJobStatus=batchJob.getStatus();
        System.out.println(sparkJobStatus);
	
}
support.huaweicloud.com/sdkreference-dli/dli_04_0054.html