sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject sqoop git commit: SQOOP-2239: Sqoop2: Remove Repository.updateSubmission() call from Mapreduce submission engine
Date Thu, 26 Mar 2015 00:11:31 GMT
Repository: sqoop
Updated Branches:
  refs/heads/sqoop2 029e8ff56 -> be74759e7


SQOOP-2239: Sqoop2: Remove Repository.updateSubmission() call from Mapreduce submission engine

(Jarek Jarcec Cecho via Abraham Elmahrek)


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

Branch: refs/heads/sqoop2
Commit: be74759e7844bc9de63b2583b6c3c72488803aa8
Parents: 029e8ff
Author: Abraham Elmahrek <abe@apache.org>
Authored: Wed Mar 25 15:10:30 2015 -0700
Committer: Abraham Elmahrek <abe@apache.org>
Committed: Wed Mar 25 15:10:30 2015 -0700

----------------------------------------------------------------------
 .../java/org/apache/sqoop/driver/JobManager.java | 19 +++++++++++++++----
 .../mapreduce/MapreduceSubmissionEngine.java     |  2 --
 2 files changed, 15 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/be74759e/core/src/main/java/org/apache/sqoop/driver/JobManager.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/sqoop/driver/JobManager.java b/core/src/main/java/org/apache/sqoop/driver/JobManager.java
index d64c148..4609c1b 100644
--- a/core/src/main/java/org/apache/sqoop/driver/JobManager.java
+++ b/core/src/main/java/org/apache/sqoop/driver/JobManager.java
@@ -557,7 +557,7 @@ public class JobManager implements Reconfigurable {
     mSubmission.setLastUpdateUser(ctx.getUsername());
 
     // Fetch new information to verify that the stop command has actually worked
-    submissionEngine.update(mSubmission);
+    updateSubmission(mSubmission);
 
     // Return updated structure
     return mSubmission;
@@ -570,14 +570,25 @@ public class JobManager implements Reconfigurable {
     if (mSubmission == null) {
       return new MSubmission(jobId, new Date(), SubmissionStatus.NEVER_EXECUTED);
     }
-    // If the submission isin running state, let's update it
+    // If the submission is in running state, let's update it
     if (mSubmission.getStatus().isRunning()) {
-      submissionEngine.update(mSubmission);
+      updateSubmission(mSubmission);
     }
 
     return mSubmission;
   }
 
+  /**
+   * Get latest status of the submission from execution engine and
+   * persist that in the repository.
+   *
+   * @param submission Submission to update
+   */
+  public void updateSubmission(MSubmission submission) {
+    submissionEngine.update(submission);
+    RepositoryManager.getInstance().getRepository().updateSubmission(submission);
+  }
+
   @Override
   public synchronized void configurationChanged() {
     LOG.info("Begin submission engine manager reconfiguring");
@@ -676,7 +687,7 @@ public class JobManager implements Reconfigurable {
               .findUnfinishedSubmissions();
 
           for (MSubmission submission : unfinishedSubmissions) {
-            submissionEngine.update(submission);
+            updateSubmission(submission);
           }
 
           Thread.sleep(updateSleep);

http://git-wip-us.apache.org/repos/asf/sqoop/blob/be74759e/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 f249318..bf94df9 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
@@ -475,8 +475,6 @@ public class MapreduceSubmissionEngine extends SubmissionEngine {
       submission.setProgress(progress);
       submission.setCounters(counters);
       submission.setLastUpdateDate(new Date());
-
-      RepositoryManager.getInstance().getRepository().updateSubmission(submission);
     } catch (IOException e) {
       throw new SqoopException(MapreduceSubmissionError.MAPREDUCE_0003, e);
     }


Mime
View raw message