sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jar...@apache.org
Subject sqoop git commit: SQOOP-2527: Sqoop2: findbugs: Fix warning in submission module
Date Wed, 26 Aug 2015 23:28:54 GMT
Repository: sqoop
Updated Branches:
  refs/heads/sqoop2 4014c7fbf -> 90eb27474


SQOOP-2527: Sqoop2: findbugs: Fix warning in submission module

(Colin Ma via 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/90eb2747
Tree: http://git-wip-us.apache.org/repos/asf/sqoop/tree/90eb2747
Diff: http://git-wip-us.apache.org/repos/asf/sqoop/diff/90eb2747

Branch: refs/heads/sqoop2
Commit: 90eb27474d831b4e50391c488d9a52e48f16d86e
Parents: 4014c7f
Author: Jarek Jarcec Cecho <jarcec@apache.org>
Authored: Wed Aug 26 16:28:32 2015 -0700
Committer: Jarek Jarcec Cecho <jarcec@apache.org>
Committed: Wed Aug 26 16:28:32 2015 -0700

----------------------------------------------------------------------
 .../mapreduce/MapreduceSubmissionEngine.java        | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/90eb2747/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 bf94df9..f396783 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
@@ -91,12 +91,7 @@ public class MapreduceSubmissionEngine extends SubmissionEngine {
 
     // Git list of files ending with "-site.xml" (configuration files)
     File dir = new File(configDirectory);
-    String [] files = dir.list(new FilenameFilter() {
-      @Override
-      public boolean accept(File dir, String name) {
-        return name.endsWith("-site.xml");
-      }
-    });
+    String [] files = dir.list(new MRSubmissionFilenameFilter());
 
     if(files == null) {
       throw new SqoopException(MapreduceSubmissionError.MAPREDUCE_0002,
@@ -158,6 +153,7 @@ public class MapreduceSubmissionEngine extends SubmissionEngine {
   @Override
   public boolean submit(JobRequest mrJobRequest) {
     // We're supporting only map reduce jobs
+    assert mrJobRequest instanceof MRJobRequest;
     MRJobRequest request = (MRJobRequest) mrJobRequest;
 
     // Clone global configuration
@@ -255,7 +251,7 @@ public class MapreduceSubmissionEngine extends SubmissionEngine {
         submitToCluster(request, job);
       }
       LOG.debug("Executed new map-reduce job with id " + job.getJobID().toString());
-    } catch (Exception e) {
+    } catch (RuntimeException|IOException|ClassNotFoundException|InterruptedException e)
{
       SubmissionError error = new SubmissionError();
       error.setErrorSummary(e.toString());
       StringWriter writer = new StringWriter();
@@ -495,4 +491,10 @@ public class MapreduceSubmissionEngine extends SubmissionEngine {
         || "local".equals(globalConfiguration.get("mapred.job.tracker"));
   }
 
+  private static class MRSubmissionFilenameFilter implements FilenameFilter {
+    @Override
+    public boolean accept(File dir, String name) {
+      return name.endsWith("-site.xml");
+    }
+  }
 }


Mime
View raw message