5
0
mirror of https://github.com/apache/sqoop.git synced 2025-05-19 18:31:03 +08:00

SQOOP-686 Empty job name will result in NPE during job submission

(Jarek Jarcec Cecho)
This commit is contained in:
Bilung Lee 2012-11-09 09:59:47 -08:00
parent fdfc18c831
commit c47a15368e
3 changed files with 20 additions and 1 deletions

View File

@ -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

View File

@ -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;
} }

View File

@ -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());