HADOOP-6203. FsShell rm/rmr error message indicates exceeding Trash quota and suggests using -skpTrash, when moving to trash fails. Contributed by Boris Shkolnik.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@812317 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Suresh Srinivas 2009-09-08 01:41:17 +00:00
parent f95ec3f5bf
commit d09ade4d0b
3 changed files with 19 additions and 5 deletions

View File

@ -81,6 +81,10 @@ Trunk (unreleased changes)
HADOOP-6230. Moved process tree and memory calculator related classes HADOOP-6230. Moved process tree and memory calculator related classes
from Common to Map/Reduce. (Vinod Kumar Vavilapalli via yhemanth) from Common to Map/Reduce. (Vinod Kumar Vavilapalli via yhemanth)
HADOOP-6203. FsShell rm/rmr error message indicates exceeding Trash quota
and suggests using -skpTrash, when moving to trash fails.
(Boris Shkolnik via suresh)
NEW FEATURES NEW FEATURES
HADOOP-4268. Change fsck to use ClientProtocol methods so that the HADOOP-4268. Change fsck to use ClientProtocol methods so that the

View File

@ -1130,10 +1130,20 @@ public class FsShell extends Configured implements Tool {
} }
if(!skipTrash) { if(!skipTrash) {
Trash trashTmp = new Trash(srcFs, getConf()); try {
if (trashTmp.moveToTrash(src)) { Trash trashTmp = new Trash(srcFs, getConf());
System.out.println("Moved to trash: " + src); if (trashTmp.moveToTrash(src)) {
return; 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;
} }
} }

View File

@ -123,7 +123,7 @@ public class Trash extends Configured {
for (int i = 0; i < 2; i++) { for (int i = 0; i < 2; i++) {
try { try {
if (!fs.mkdirs(baseTrashPath, PERMISSION)) { // create current 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; return false;
} }
} catch (IOException e) { } catch (IOException e) {