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:
parent
f95ec3f5bf
commit
d09ade4d0b
|
@ -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
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
Loading…
Reference in New Issue