You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pig.apache.org by ya...@apache.org on 2010/04/09 17:51:28 UTC

svn commit: r932472 - in /hadoop/pig/trunk/contrib/zebra: CHANGES.txt src/java/org/apache/hadoop/zebra/pig/TableLoader.java

Author: yanz
Date: Fri Apr  9 15:51:28 2010
New Revision: 932472

URL: http://svn.apache.org/viewvc?rev=932472&view=rev
Log:
PIG-1356 TableLoader makes unnecessary calls to build a Job instance that create a new JobClient in the hadoop 0.20.9 (yanz)

Modified:
    hadoop/pig/trunk/contrib/zebra/CHANGES.txt
    hadoop/pig/trunk/contrib/zebra/src/java/org/apache/hadoop/zebra/pig/TableLoader.java

Modified: hadoop/pig/trunk/contrib/zebra/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/pig/trunk/contrib/zebra/CHANGES.txt?rev=932472&r1=932471&r2=932472&view=diff
==============================================================================
--- hadoop/pig/trunk/contrib/zebra/CHANGES.txt (original)
+++ hadoop/pig/trunk/contrib/zebra/CHANGES.txt Fri Apr  9 15:51:28 2010
@@ -76,6 +76,8 @@ Trunk (unreleased changes)
 
   BUG FIXES
 
+    PIG-1356 TableLoader makes unnecessary calls to build a Job instance that create a new JobClient in the hadoop 0.20.9 (yanz)
+
     PIG-1349 Hubson test failure in test case TestBasicUnion (xuefuz via yanz)
 
     PIG-1340 The zebra version number should be changed from 0.7 to 0.8 (yanz)

Modified: hadoop/pig/trunk/contrib/zebra/src/java/org/apache/hadoop/zebra/pig/TableLoader.java
URL: http://svn.apache.org/viewvc/hadoop/pig/trunk/contrib/zebra/src/java/org/apache/hadoop/zebra/pig/TableLoader.java?rev=932472&r1=932471&r2=932472&view=diff
==============================================================================
--- hadoop/pig/trunk/contrib/zebra/src/java/org/apache/hadoop/zebra/pig/TableLoader.java (original)
+++ hadoop/pig/trunk/contrib/zebra/src/java/org/apache/hadoop/zebra/pig/TableLoader.java Fri Apr  9 15:51:28 2010
@@ -212,8 +212,7 @@ public class TableLoader extends LoadFun
     /*
      * Hack: use FileInputFormat to decode comma-separated multiple path format.
      */ 
-     private static Path[] getPathsFromLocation(String location, Configuration conf) throws IOException {
-         Job j = new Job( conf );
+     private static Path[] getPathsFromLocation(String location, Job j) throws IOException {
          FileInputFormat.setInputPaths( j, location );
          Path[] paths = FileInputFormat.getInputPaths( j );
 
@@ -221,6 +220,7 @@ public class TableLoader extends LoadFun
           * Performing glob pattern matching
           */
          List<Path> result = new ArrayList<Path>(paths.length);
+         Configuration conf = j.getConfiguration();
          for (Path p : paths) {
              FileSystem fs = p.getFileSystem(conf);
              FileStatus[] matches = fs.globStatus(p);
@@ -278,7 +278,7 @@ public class TableLoader extends LoadFun
 
      @Override
      public void setLocation(String location, Job job) throws IOException {
-         Path[] paths = getPathsFromLocation( location, job.getConfiguration() );
+         Path[] paths = getPathsFromLocation( location, job );
          TableInputFormat.setInputPaths( job, paths );
 
          // The following obviously goes beyond of set location, but this is the only place that we
@@ -300,7 +300,7 @@ public class TableLoader extends LoadFun
 
      @Override
      public ResourceSchema getSchema(String location, Job job) throws IOException {
-         Path[] paths = getPathsFromLocation( location, job.getConfiguration());
+         Path[] paths = getPathsFromLocation( location, job);
          TableInputFormat.setInputPaths( job, paths );
 
          Schema tableSchema = null;