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
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
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) {
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;
}
}

View File

@ -123,7 +123,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) {