Issue Details (XML | Word | Printable)

Key: HADOOP-1902
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Mahadev konar
Reporter: Mukund Madhugiri
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Hadoop Common

du command throws an exception when the directory is not specified

Created: 15/Sep/07 01:07 AM   Updated: 08/Jul/09 04:42 PM
Component/s: None
Affects Version/s: 0.13.1
Fix Version/s: 0.17.0

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works Hadoop-1902_1.patch 2008-02-20 07:37 PM Mahadev konar 2 kB

Resolution Date: 21/Feb/08 05:49 PM


 Description  « Hide
Running the du command without specifying a directory throws an exception. It runs fine if a directory is specified. Here is the output

mukundm@ucdev28 hadoop]$ bin/hadoop dfs -du
Exception in thread "main" java.lang.IllegalArgumentException: Can not create a Path from an empty string
at org.apache.hadoop.fs.Path.checkPathArg(Path.java:82)
at org.apache.hadoop.fs.Path.<init>(Path.java:90)
at org.apache.hadoop.fs.FsShell.du(FsShell.java:351)
at org.apache.hadoop.fs.FsShell.run(FsShell.java:1040)
at org.apache.hadoop.util.ToolBase.doMain(ToolBase.java:189)
at org.apache.hadoop.fs.FsShell.main(FsShell.java:1092)

[mukundm@ucdev28 hadoop]$ bin/hadoop dfs -du .
Found 2 items
/user/mukundm/input 28578
/user/mukundm/output 747



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Enis Soztutar added a comment - 17/Sep/07 07:46 AM
This is indeed the desired behavior. Because we do not want to invoke the Path constructor with empty string. see HADOOP-1386. If you do not have any specific reasons to use du command w/o path argument, then we can close this issue as invalid.

Mahadev konar added a comment - 20/Feb/08 07:37 PM
this patch fixes the issue. it call du . and dus . on passing an empty string.

Lohit Vijayarenu added a comment - 20/Feb/08 07:47 PM
+1
Instead of ("") using (".") makes sense. unix show contents of CWD, and on DFS this lists user's directory.

Hadoop QA added a comment - 20/Feb/08 09:10 PM
+1 overall. Here are the results of testing the latest attachment
http://issues.apache.org/jira/secure/attachment/12376046/Hadoop-1902_1.patch
against trunk revision 619744.

@author +1. The patch does not contain any @author tags.

tests included +1. The patch appears to include 3 new or modified tests.

javadoc +1. The javadoc tool did not generate any warning messages.

javac +1. The applied patch does not generate any new javac compiler warnings.

release audit +1. The applied patch does not generate any new release audit warnings.

findbugs +1. The patch does not introduce any new Findbugs warnings.

core tests +1. The patch passed core unit tests.

contrib tests +1. The patch passed contrib unit tests.

Test results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/1821/testReport/
Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/1821/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
Checkstyle results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/1821/artifact/trunk/build/test/checkstyle-errors.html
Console output: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/1821/console

This message is automatically generated.


dhruba borthakur added a comment - 21/Feb/08 05:49 PM
I just committed this. Thanks mahadev!

Hudson added a comment - 22/Feb/08 12:10 PM