[ 
https://issues.apache.org/jira/browse/HDFS-10388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15281161#comment-15281161
 ] 

Yiqun Lin commented on HDFS-10388:
----------------------------------

Yes, [~shahrs87], the {{Df#processPath}} will call 
{{DistributedFileSystem#getStatus()}}. But as you can see, this command in dfs 
will always return the same value whatever the path you are set in. These are 
the result in my test cluster:
{code}
$ hadoop fs -df -h /tmp
Filesystem            Size   Used  Available  Use%
hdfs://xxxx  238.2 T  6.0 T    221.3 T    3%

[data@xxxx /home/data] 11:08
$ hadoop fs -df -h /user
Filesystem            Size   Used  Available  Use%
hdfs://xxxx  238.2 T  6.0 T    221.3 T    3%
{code}

I think that when the path is root '/', we can still return 
{{dfs.getDiskStatus()}}, else we can return a {{FsStatus(0, 0, 0)}} to print. 
And in addition we can print msg for that "The df command doesn't support for 
specified path in the current filesystem." This will be better. What do you 
think?


> DistributedFileSystem#getStatus returns a misleading FsStatus
> -------------------------------------------------------------
>
>                 Key: HDFS-10388
>                 URL: https://issues.apache.org/jira/browse/HDFS-10388
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: fs
>    Affects Versions: 2.7.1
>            Reporter: Yiqun Lin
>            Assignee: Yiqun Lin
>         Attachments: HDFS-10388.001.patch
>
>
> The method {{DistributedFileSystem#getStatus}} returns the dfs's disk status.
> {code}
>    public FsStatus getStatus(Path p) throws IOException {
>      statistics.incrementReadOps(1);
>     return dfs.getDiskStatus();
>    }
> {code}
> So the param path is no meaning here. And the object returned will mislead 
> for users to use this method. I looked into the code, only when the file 
> system has multiple partitions, the use and capacity of the partition pointed 
> to by the specified path will be reflected. For example, in the subclass 
> {{RawLocalFileSystem}}, it will be return correctly.
> We should return a new meaningless FsStatus here (like new FsStatus(0, 0, 0)) 
> and indicate that the invoked method isn't available in 
> {{DistributedFileSystem}}.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to