public class BatchJob extends SparkJob
client, JOB_TRANSACTION_ERROR_CODE
Constructor and Description |
---|
BatchJob(Cluster cluster,
SparkJobInfo jobInfo) |
BatchJob(Cluster cluster,
SparkJobInfo jobInfo,
String transactionId) |
Modifier and Type | Method and Description |
---|---|
void |
asyncSubmit()
Submit a Spark job in async.
|
com.huawei.dli.restapi.model.MessageInfo |
delBatch()
delete batchJob (recommend)
|
com.huawei.dli.restapi.model.MessageInfo |
delBatch(String batchId)
delete batchJob by batchId (deprecated)
|
List<String> |
getDriverLog(int from,
int size,
int index)
Get a Spark job driver log when job is finished.
|
List<String> |
getDriverLogByJobId(String jobId,
int from,
int size,
int index) |
List<String> |
getLog(int from,
int size)
Get a Spark job client log when job is finished.
|
List<String> |
getLogByJobId(String jobId,
int from,
int size) |
SparkJobStatus |
getStatus()
Get a Spark job status, it may be starting, running, dead or success.
|
protected String |
getTransactionKeyName() |
void |
submit()
Submit a Spark job.
|
checkJobRunningState, getCluster, getJobId, getJobTimeout, getProjectId, setJobTimeout
apiExceptionRetryManage, executeCall, executeWithRetry, getTransactionId, isServiceInsideError, setTransactionId
public BatchJob(Cluster cluster, SparkJobInfo jobInfo)
public BatchJob(Cluster cluster, SparkJobInfo jobInfo, String transactionId)
public void submit() throws DLIException
SparkJob
submit
in class SparkJob
DLIException
- If fail to call the API, e.g. server error or cannot deserialize the response bodypublic void asyncSubmit() throws DLIException
SparkJob
asyncSubmit
in class SparkJob
DLIException
- If fail to call the API, e.g. server error or cannot deserialize the response bodypublic SparkJobStatus getStatus() throws DLIException
SparkJob
getStatus
in class SparkJob
DLIException
- If fail to call the API, e.g. server error or cannot deserialize the response bodypublic List<String> getLog(int from, int size) throws DLIException
SparkJob
getLog
in class SparkJob
from
- Start line of the log to be displayed. By default, the last 100 lines of the log
are displayed. If a log file contains fewer than 100 lines, line 0 is the start line.size
- Number of obtained logs.DLIException
- If fail to call the API, e.g. server error or cannot deserialize the response bodypublic List<String> getLogByJobId(String jobId, int from, int size) throws DLIException
getLogByJobId
in class SparkJob
DLIException
public List<String> getDriverLogByJobId(String jobId, int from, int size, int index) throws DLIException
getDriverLogByJobId
in class SparkJob
DLIException
public List<String> getDriverLog(int from, int size, int index) throws DLIException
SparkJob
getDriverLog
in class SparkJob
from
- Start line of the log to be displayed. By default, the last 100 lines of the log
are displayed. If a log file contains fewer than 100 lines, line 0 is the start line.size
- Number of obtained logs.index
- When a submitted job is retried, multiple driver logs are generated.
This parameter specifies the index number of the specified driver log.DLIException
- If fail to call the API, e.g. server error or cannot deserialize the response bodyprotected String getTransactionKeyName()
getTransactionKeyName
in class BaseJob
public com.huawei.dli.restapi.model.MessageInfo delBatch() throws DLIException
DLIException
- If fail to call the API, e.g. server error or cannot deserialize the response bodypublic com.huawei.dli.restapi.model.MessageInfo delBatch(String batchId) throws DLIException
batchId
- batch idDLIException
- If fail to call the API, e.g. server error or cannot deserialize the response bodyCopyright © 2023. All rights reserved.