mirror of
https://github.com/apache/sqoop.git
synced 2025-05-19 10:21:14 +08:00
SQOOP-686 Empty job name will result in NPE during job submission
(Jarek Jarcec Cecho)
This commit is contained in:
parent
fdfc18c831
commit
c47a15368e
@ -312,6 +312,7 @@ public static MSubmission submit(long jobId) {
|
|||||||
connectorConnection, connectorJob,
|
connectorConnection, connectorJob,
|
||||||
frameworkConnection, frameworkJob);
|
frameworkConnection, frameworkJob);
|
||||||
request.setJobName(job.getName());
|
request.setJobName(job.getName());
|
||||||
|
request.setJobId(job.getPersistenceId());
|
||||||
|
|
||||||
// Let's register all important jars
|
// Let's register all important jars
|
||||||
// sqoop-common
|
// sqoop-common
|
||||||
|
@ -43,6 +43,11 @@ public class SubmissionRequest {
|
|||||||
*/
|
*/
|
||||||
String jobName;
|
String jobName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Associated job (from metadata perspective) id
|
||||||
|
*/
|
||||||
|
long jobId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Connector instance associated with this submission request
|
* Connector instance associated with this submission request
|
||||||
*/
|
*/
|
||||||
@ -111,6 +116,14 @@ public void setJobName(String jobName) {
|
|||||||
this.jobName = jobName;
|
this.jobName = jobName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public long getJobId() {
|
||||||
|
return jobId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setJobId(long jobId) {
|
||||||
|
this.jobId = jobId;
|
||||||
|
}
|
||||||
|
|
||||||
public SqoopConnector getConnector() {
|
public SqoopConnector getConnector() {
|
||||||
return connector;
|
return connector;
|
||||||
}
|
}
|
||||||
|
@ -185,7 +185,12 @@ public boolean submit(SubmissionRequest generalRequest) {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
Job job = Job.getInstance(configuration);
|
Job job = Job.getInstance(configuration);
|
||||||
job.setJobName(request.getJobName());
|
|
||||||
|
if(request.getJobName() != null) {
|
||||||
|
job.setJobName("Sqoop: " + request.getJobName());
|
||||||
|
} else {
|
||||||
|
job.setJobName("Sqoop job with id: " + request.getJobId());
|
||||||
|
}
|
||||||
|
|
||||||
job.setInputFormatClass(request.getInputFormatClass());
|
job.setInputFormatClass(request.getInputFormatClass());
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user