sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b...@apache.org
Subject [2/2] git commit: SQOOP-686 Empty job name will result in NPE during job submission (Jarek Jarcec Cecho)
Date Fri, 09 Nov 2012 22:28:34 GMT
SQOOP-686 Empty job name will result in NPE during job submission
(Jarek Jarcec Cecho)


Project: http://git-wip-us.apache.org/repos/asf/sqoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/sqoop/commit/c47a1536
Tree: http://git-wip-us.apache.org/repos/asf/sqoop/tree/c47a1536
Diff: http://git-wip-us.apache.org/repos/asf/sqoop/diff/c47a1536

Branch: refs/heads/sqoop2
Commit: c47a15368e099d45dc95662268cc42877f83b7b9
Parents: fdfc18c
Author: Bilung Lee <blee@apache.org>
Authored: Fri Nov 9 09:59:47 2012 -0800
Committer: Bilung Lee <blee@apache.org>
Committed: Fri Nov 9 09:59:47 2012 -0800

----------------------------------------------------------------------
 .../apache/sqoop/framework/FrameworkManager.java   |    1 +
 .../apache/sqoop/framework/SubmissionRequest.java  |   13 +++++++++++++
 .../mapreduce/MapreduceSubmissionEngine.java       |    7 ++++++-
 3 files changed, 20 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/c47a1536/core/src/main/java/org/apache/sqoop/framework/FrameworkManager.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/sqoop/framework/FrameworkManager.java b/core/src/main/java/org/apache/sqoop/framework/FrameworkManager.java
index f4be639..575a8bb 100644
--- a/core/src/main/java/org/apache/sqoop/framework/FrameworkManager.java
+++ b/core/src/main/java/org/apache/sqoop/framework/FrameworkManager.java
@@ -312,6 +312,7 @@ public final class FrameworkManager {
       connectorConnection, connectorJob,
       frameworkConnection, frameworkJob);
     request.setJobName(job.getName());
+    request.setJobId(job.getPersistenceId());
 
     // Let's register all important jars
     // sqoop-common

http://git-wip-us.apache.org/repos/asf/sqoop/blob/c47a1536/core/src/main/java/org/apache/sqoop/framework/SubmissionRequest.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/sqoop/framework/SubmissionRequest.java b/core/src/main/java/org/apache/sqoop/framework/SubmissionRequest.java
index c70a5cc..9f471b5 100644
--- a/core/src/main/java/org/apache/sqoop/framework/SubmissionRequest.java
+++ b/core/src/main/java/org/apache/sqoop/framework/SubmissionRequest.java
@@ -44,6 +44,11 @@ public class SubmissionRequest {
   String jobName;
 
   /**
+   * Associated job (from metadata perspective) id
+   */
+  long jobId;
+
+  /**
    * Connector instance associated with this submission request
    */
   SqoopConnector connector;
@@ -111,6 +116,14 @@ public class SubmissionRequest {
     this.jobName = jobName;
   }
 
+  public long getJobId() {
+    return jobId;
+  }
+
+  public void setJobId(long jobId) {
+    this.jobId = jobId;
+  }
+
   public SqoopConnector getConnector() {
     return connector;
   }

http://git-wip-us.apache.org/repos/asf/sqoop/blob/c47a1536/submission/mapreduce/src/main/java/org/apache/sqoop/submission/mapreduce/MapreduceSubmissionEngine.java
----------------------------------------------------------------------
diff --git a/submission/mapreduce/src/main/java/org/apache/sqoop/submission/mapreduce/MapreduceSubmissionEngine.java
b/submission/mapreduce/src/main/java/org/apache/sqoop/submission/mapreduce/MapreduceSubmissionEngine.java
index b8415e3..15cb476 100644
--- a/submission/mapreduce/src/main/java/org/apache/sqoop/submission/mapreduce/MapreduceSubmissionEngine.java
+++ b/submission/mapreduce/src/main/java/org/apache/sqoop/submission/mapreduce/MapreduceSubmissionEngine.java
@@ -185,7 +185,12 @@ public class MapreduceSubmissionEngine extends SubmissionEngine {
 
     try {
       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());
 


Mime
View raw message