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

Siyao Meng commented on HADOOP-16082:
-------------------------------------

[[email protected]] Yeah I'm also feeling that the parsing could break easily.
1) I'm not sure about how to implement the diagnostic entry point stuff, though 
it might be a solution.
2) Cool project. I digged a little bit. Do you mean 
[this|https://github.com/steveloughran/cloudstore/blob/e06f480b5acceeacbeb731de456b669585e2c75a/src/main/java/org/apache/hadoop/fs/store/commands/ListFiles.java#L97]
 call? I haven't looked into the details yet.
3) I have another idea, inspired by [~aajisaka]'s comment. On top of the 
*HdfsFileStatus#toString()*, we could just allow "%*" to be passed to *fs 
-stat* to print out the *.toString()*, i.e.
{code:bash}
$ hdfs dfs -stat "%*" /tmp
HdfsLocatedFileStatus{path=hdfs://127.0.0.1:9999/tmp; isDirectory=true; 
modification_time=1565671058556; access_time=0; owner=user; group=supergroup; 
permission=rwxr-xr-x; isSymlink=false; hasAcl=false; isEncrypted=false; 
isErasureCoded=false; fileId=16386}
{code}
What do you think?

> 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.14#76016)

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

Reply via email to