hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From omal...@apache.org
Subject svn commit: r1077054 - in /hadoop/common/branches/branch-0.20-security-patches/src/core/org/apache/hadoop/fs: FsShell.java Trash.java
Date Fri, 04 Mar 2011 03:36:05 GMT
Author: omalley
Date: Fri Mar  4 03:36:04 2011
New Revision: 1077054

URL: http://svn.apache.org/viewvc?rev=1077054&view=rev
Log:
commit f803ea454c148e3ee86eb3cf7a299839cbaf2396
Author: Tsz Wo Wo Sze <tsz@ucdev29.inktomisearch.com>
Date:   Tue Nov 17 23:22:41 2009 +0000

    HADOOP:6203 from https://issues.apache.org/jira/secure/attachment/12425243/c6203_20091116_0.20.patch
    
    +++ b/YAHOO-CHANGES.txt
    +    HADOOP-6203. FsShell rm/rmr error message indicates exceeding Trash quota
    +    and suggests using -skpTrash, when moving to trash fails.
    +    (Boris Shkolnik via suresh)
    +

Modified:
    hadoop/common/branches/branch-0.20-security-patches/src/core/org/apache/hadoop/fs/FsShell.java
    hadoop/common/branches/branch-0.20-security-patches/src/core/org/apache/hadoop/fs/Trash.java

Modified: hadoop/common/branches/branch-0.20-security-patches/src/core/org/apache/hadoop/fs/FsShell.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-patches/src/core/org/apache/hadoop/fs/FsShell.java?rev=1077054&r1=1077053&r2=1077054&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-patches/src/core/org/apache/hadoop/fs/FsShell.java
(original)
+++ hadoop/common/branches/branch-0.20-security-patches/src/core/org/apache/hadoop/fs/FsShell.java
Fri Mar  4 03:36:04 2011
@@ -1060,10 +1060,20 @@ public class FsShell extends Configured 
     }
     
     if(!skipTrash) {
-      Trash trashTmp = new Trash(srcFs, getConf());
-      if (trashTmp.moveToTrash(src)) {
-        System.out.println("Moved to trash: " + src);
-        return;
+      try {
+	      Trash trashTmp = new Trash(srcFs, getConf());
+        if (trashTmp.moveToTrash(src)) {
+          System.out.println("Moved to trash: " + src);
+          return;
+        }
+      } catch (IOException e) {
+        Exception cause = (Exception) e.getCause();
+        String msg = "";
+        if(cause != null) {
+          msg = cause.getLocalizedMessage();
+        }
+        System.err.println("Problem with Trash." + msg +". Consider using -skipTrash option");
       
+        throw e;
       }
     }
     

Modified: hadoop/common/branches/branch-0.20-security-patches/src/core/org/apache/hadoop/fs/Trash.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-patches/src/core/org/apache/hadoop/fs/Trash.java?rev=1077054&r1=1077053&r2=1077054&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-patches/src/core/org/apache/hadoop/fs/Trash.java
(original)
+++ hadoop/common/branches/branch-0.20-security-patches/src/core/org/apache/hadoop/fs/Trash.java
Fri Mar  4 03:36:04 2011
@@ -118,7 +118,7 @@ public class Trash extends Configured {
     for (int i = 0; i < 2; i++) {
       try {
         if (!fs.mkdirs(baseTrashPath, PERMISSION)) {      // create current
-          LOG.warn("Can't create trash directory: "+baseTrashPath);
+          LOG.warn("Can't create(mkdir) trash directory: "+baseTrashPath);
           return false;
         }
       } catch (IOException e) {



Mime
View raw message