hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rang...@apache.org
Subject svn commit: r644814 - in /hadoop/core/trunk: CHANGES.txt src/java/org/apache/hadoop/fs/FsShell.java
Date Fri, 04 Apr 2008 18:31:54 GMT
Author: rangadi
Date: Fri Apr  4 11:31:39 2008
New Revision: 644814

URL: http://svn.apache.org/viewvc?rev=644814&view=rev
Log:
HADOOP-3165. -put/-copyFromLocal did not treat input file - as stdin. (Lohit Vijayarenu via
rangadi)

Modified:
    hadoop/core/trunk/CHANGES.txt
    hadoop/core/trunk/src/java/org/apache/hadoop/fs/FsShell.java

Modified: hadoop/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/CHANGES.txt?rev=644814&r1=644813&r2=644814&view=diff
==============================================================================
--- hadoop/core/trunk/CHANGES.txt (original)
+++ hadoop/core/trunk/CHANGES.txt Fri Apr  4 11:31:39 2008
@@ -482,6 +482,9 @@
     HADOOP-3146. A DFSOutputStream.flush method is renamed as
     DFSOutputStream.fsync.  (dhruba)
 
+    HADOOP-3165. -put/-copyFromLocal did not treat input file "-" as stdin.
+    (Lohit Vijayarenu via rangadi)
+
 Release 0.16.2 - 2008-04-02
 
   BUG FIXES

Modified: hadoop/core/trunk/src/java/org/apache/hadoop/fs/FsShell.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/java/org/apache/hadoop/fs/FsShell.java?rev=644814&r1=644813&r2=644814&view=diff
==============================================================================
--- hadoop/core/trunk/src/java/org/apache/hadoop/fs/FsShell.java (original)
+++ hadoop/core/trunk/src/java/org/apache/hadoop/fs/FsShell.java Fri Apr  4 11:31:39 2008
@@ -128,22 +128,12 @@
   void copyFromLocal(Path[] srcs, String dstf) throws IOException {
     Path dstPath = new Path(dstf);
     FileSystem dstFs = dstPath.getFileSystem(getConf());
-    dstFs.copyFromLocalFile(false, false, srcs, dstPath);
-  }
-  
-  /**
-   * Add a local file to the indicated FileSystem name. src is kept.
-   */
-  void copyFromLocal(Path src, String dstf) throws IOException {
-    if (src.toString().equals("-")) {
-      Path dstPath = new Path(dstf);
-      FileSystem dstFs = dstPath.getFileSystem(getConf());
+    if (srcs.length == 1 && srcs[0].toString().equals("-"))
       copyFromStdin(dstPath, dstFs);
-    } else {
-      copyFromLocal(new Path[]{src}, dstf);
-    }
+    else
+      dstFs.copyFromLocalFile(false, false, srcs, dstPath);
   }
-
+  
   /**
    * Add local files to the indicated FileSystem name. src is removed.
    */



Mime
View raw message