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

Steve Loughran commented on HADOOP-16082:
-----------------------------------------

going to conflict with HADOOP-16077; whichever goes in first will force the 
second to rebuild.

* needs changes in documentation
* does seem to address the issue in HADOOP-16077: handling of -ec -i

Tests need to include something for -ec and -i, including veryfing that the 
current output of ls -ec *does not change at all*. 

We have to consider the output of the current ls commands to be a public API 
parsed by other commands, 

Now more fundamental issue: FileStatus is stable, marshallable as protobuf, has 
subclasses, and is regularly exchanged over the wire, such as when a client 
calls listFiles() or listStatus() of a remote server.

We cannot add a new field to it unless all existing clients from previous 
versions can handle it being added. HDFS-6984 covers the work the last time 
things changed. 

I would be really nervous about going anywhere near that class if it is just 
for a bit of convenience in listing things.

What about offering some other command to just print out the toString() values 
of getFileStatus and make sure that HdfsFileStatus always prints its fileID, 
which it already sets and marshalls. 




> FsShell ls: Add option -i to print inode id
> -------------------------------------------
>
>                 Key: HADOOP-16082
>                 URL: https://issues.apache.org/jira/browse/HADOOP-16082
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: common
>    Affects Versions: 3.2.0, 3.1.1
>            Reporter: Siyao Meng
>            Assignee: Siyao Meng
>            Priority: Major
>         Attachments: HADOOP-16082.001.patch
>
>
> When debugging the FSImage corruption issue, I often need to know a file's or 
> directory's inode id. At this moment, the only way to do that is to use OIV 
> tool to dump the FSImage and look up the filename, which is very inefficient.
> Here I propose adding option "-i" in FsShell that prints files' or 
> directories' inode id.
> h2. Implementation
> h3. For hdfs:// (HDFS)
> fileId exists in HdfsLocatedFileStatus, which is already returned to 
> hdfs-client. We just need to print it in Ls#processPath().
> h3. For file:// (Local FS)
> h4. Linux
> Use java.nio.
> h4. Windows
> Windows has the concept of "File ID" which is similar to inode id. It is 
> unique in NTFS and ReFS.
> h3. For other FS
> The fileId entry will be "0" in FileStatus if it is not set. We could either 
> ignore or throw an exception.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org

Reply via email to