|
If we do (5), we still have to do (1), i.e. add a message telling the user to use -skipTrash .
I'm going to go ahead and implement 5.
Patch adds a new option to the fsshell rm and rmr commands: -skipTrash, which performs as expected. Adds to trash unit test to verify correct execution. Changes documentation to reflect new option. Docs suggest this option as being a solution when a directory is over quota.
Passes all commons unit tests. Running test patch now. Will post those results when done. +1 patch looks good
Test-patch:
[exec] -1 overall. [exec] [exec] +1 @author. The patch does not contain any @author tags. [exec] [exec] +1 tests included. The patch appears to include 3 new or modified tests. [exec] [exec] +1 javadoc. The javadoc tool did not generate any warning messages. [exec] [exec] -1 javac. The applied patch generated 64 javac compiler warnings (more than the trunk's current 124 warnings). [exec] [exec] +1 findbugs. The patch does not introduce any new Findbugs warnings. [exec] [exec] +1 release audit. The applied patch does not increase the total number of release audit warnings. This is weird. I've attached the javac warnings it says are new and they have nothing to do with this patch. test-patch must be broken in this regard. I believe the patch is ready to go. Attaching two new files:
Canceling patch to double check something.
Ran into a problem that I didn't notice with the HDFS version of TestTrash. I think there's an issue with the FileSystem.listStatus methods between LocalFileSystem and DistributedFileSystem, which I'll look into. In the meantime, modified test so that it doesn't rely on that method and works on both local and distributed file systems.
Will run full test suite tonight, report tomorrow morning. Also, deleted old patches to avoid confusion. New patches for both trunk and v20 should be good to go. Updated patches are good to go on all commons unit tests for trunk and all tests for v20. Test-patch is fine except the incorrect javac warnings, which are not related.
[exec] -1 overall.
[exec]
[exec] +1 @author. The patch does not contain any @author tags.
[exec]
[exec] +1 tests included. The patch appears to include 3 new or modified tests.
[exec]
[exec] +1 javadoc. The javadoc tool did not generate any warning messages.
[exec]
[exec] -1 javac. The applied patch generated 64 javac compiler warnings (more than the trunk's current 124 warnings).
[exec]
[exec] +1 findbugs. The patch does not introduce any new Findbugs warnings.
[exec]
[exec] +1 release audit. The applied patch does not increase the total number of release audit warnings.
Should we consider excluding trash for files deleted from /tmp (ie make -skipTrash implicit when deleting from /tmp.)?
I'm not a fan of special cases for certain directories, even for /tmp, and particularly when we're already straying away from the posix world with the trash feature. Minimizing surprise seems a good goal, and I'd be very surprised if I were accustomed to explicitly skipping the trash when I want and discovering something I had expected to be trashed had been helpfully nuked by the system. > [exec] -1 javac. The applied patch generated 64 javac compiler warnings (more than the trunk's current 124 warnings).
The patch does not seem to have so many warnings. Filed I just committed this. Thank you Jakob.
Integrated in Hadoop-Common-trunk #13 (See http://hudson.zones.apache.org/hudson/job/Hadoop-Common-trunk/13/
is going to 0.20. . Introduce -skipTrash option to rm and rmr. Contributed by Jakob Homan. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
2) Exclude /user/<username>/.Trash from the quota
3) Move .Trash out of /user directory. Maybe /Trash/<username> and set different quota.
4) When -rm/rmr fail with quota, automatically delete them.
5) Introduce a separate command that does (1). Something like -rmr -skipTrash for force delete.