瀏覽代碼

HADOOP-1169. Fix a cut/paste error in the CopyFiles utility so that S3-based source files are correctly copied. Contributed by Michael Stack.

git-svn-id: https://svn.apache.org/repos/asf/lucene/hadoop/trunk@524184 13f79535-47bb-0310-9956-ffa450edef68
Doug Cutting 18 年之前
父節點
當前提交
832f840d8e
共有 2 個文件被更改,包括 11 次插入10 次删除
  1. 3 0
      CHANGES.txt
  2. 8 10
      src/java/org/apache/hadoop/util/CopyFiles.java

+ 3 - 0
CHANGES.txt

@@ -61,6 +61,9 @@ Trunk (unreleased changes)
 18. HADOOP-1166.  Add a NullOutputFormat and use it in the
 18. HADOOP-1166.  Add a NullOutputFormat and use it in the
     RandomWriter example.  (omalley via cutting)
     RandomWriter example.  (omalley via cutting)
 
 
+19. HADOOP-1169.  Fix a cut/paste error in CopyFiles utility so that
+    S3-based source files are correctly copied.  (Michael Stack via cutting)
+
 
 
 Release 0.12.3 (not yet released)
 Release 0.12.3 (not yet released)
 
 

+ 8 - 10
src/java/org/apache/hadoop/util/CopyFiles.java

@@ -739,16 +739,14 @@ public class CopyFiles extends ToolBase {
         srcPaths = httpUrls;
         srcPaths = httpUrls;
         mapper = CopyMapperFactory.getMapper(conf, "http");
         mapper = CopyMapperFactory.getMapper(conf, "http");
       } else {   
       } else {   
-        return;
-      }
-      
-      // Protocol - 's3://'
-      String[] s3Urls = parseInputFile(S3, srcPaths);
-      if(httpUrls != null) {
+        // Protocol - 's3://'
+        String[] s3Urls = parseInputFile(S3, srcPaths);
+        if(s3Urls != null) {
           srcPaths = s3Urls;
           srcPaths = s3Urls;
-        mapper = CopyMapperFactory.getMapper(conf, S3);
-      } else {   
-        return;
+          mapper = CopyMapperFactory.getMapper(conf, S3);
+        } else {   
+          return;
+        }
       }
       }
       
       
       // TODO: Add support for URIs w/o scheme (In this case, use the 'default'
       // TODO: Add support for URIs w/o scheme (In this case, use the 'default'
@@ -822,4 +820,4 @@ public class CopyFiles extends ToolBase {
         args);
         args);
     System.exit(res);
     System.exit(res);
   }
   }
-}
+}