sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jar...@apache.org
Subject svn commit: r1375395 - in /sqoop/trunk/src/java/org/apache/sqoop/mapreduce: ExportJobBase.java ImportJobBase.java
Date Tue, 21 Aug 2012 06:43:50 GMT
Author: jarcec
Date: Tue Aug 21 06:43:50 2012
New Revision: 1375395

URL: http://svn.apache.org/viewvc?rev=1375395&view=rev
Log:
SQOOP-582. Create a template method for job submission in Export/Import JobBase.

(Seetharam Venkatesh via Jarek Jarcec Cecho)

Modified:
    sqoop/trunk/src/java/org/apache/sqoop/mapreduce/ExportJobBase.java
    sqoop/trunk/src/java/org/apache/sqoop/mapreduce/ImportJobBase.java

Modified: sqoop/trunk/src/java/org/apache/sqoop/mapreduce/ExportJobBase.java
URL: http://svn.apache.org/viewvc/sqoop/trunk/src/java/org/apache/sqoop/mapreduce/ExportJobBase.java?rev=1375395&r1=1375394&r2=1375395&view=diff
==============================================================================
--- sqoop/trunk/src/java/org/apache/sqoop/mapreduce/ExportJobBase.java (original)
+++ sqoop/trunk/src/java/org/apache/sqoop/mapreduce/ExportJobBase.java Tue Aug 21 06:43:50
2012
@@ -260,7 +260,7 @@ public class ExportJobBase extends JobBa
     PerfCounters perfCounters = new PerfCounters();
     perfCounters.startClock();
 
-    boolean success = job.waitForCompletion(true);
+    boolean success = doSubmitJob(job);
     perfCounters.stopClock();
 
     Counters jobCounters = job.getCounters();
@@ -279,6 +279,14 @@ public class ExportJobBase extends JobBa
   }
 
   /**
+   * Submit the Map Reduce Job
+   */
+  protected boolean doSubmitJob(Job job)
+    throws IOException, InterruptedException, ClassNotFoundException {
+    return job.waitForCompletion(true);
+  }
+
+  /**
    * Run an export job to dump a table from HDFS to a database. If a staging
    * table is specified and the connection manager supports staging of data,
    * the export will first populate the staging table and then migrate the

Modified: sqoop/trunk/src/java/org/apache/sqoop/mapreduce/ImportJobBase.java
URL: http://svn.apache.org/viewvc/sqoop/trunk/src/java/org/apache/sqoop/mapreduce/ImportJobBase.java?rev=1375395&r1=1375394&r2=1375395&view=diff
==============================================================================
--- sqoop/trunk/src/java/org/apache/sqoop/mapreduce/ImportJobBase.java (original)
+++ sqoop/trunk/src/java/org/apache/sqoop/mapreduce/ImportJobBase.java Tue Aug 21 06:43:50
2012
@@ -138,7 +138,7 @@ public class ImportJobBase extends JobBa
     PerfCounters perfCounters = new PerfCounters();
     perfCounters.startClock();
 
-    boolean success = job.waitForCompletion(true);
+    boolean success = doSubmitJob(job);
     perfCounters.stopClock();
 
     Counters jobCounters = job.getCounters();
@@ -155,6 +155,13 @@ public class ImportJobBase extends JobBa
     return success;
   }
 
+  /**
+   * Submit the Map Reduce Job
+   */
+  protected boolean doSubmitJob(Job job)
+    throws IOException, InterruptedException, ClassNotFoundException {
+    return job.waitForCompletion(true);
+  }
 
   /**
    * Run an import job to read a table in to HDFS.



Mime
View raw message