Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-16082

FsShell ls: Add option -i to print inode id

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Abandoned
    • 3.2.0, 3.1.1
    • None
    • common

    Description

      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.

      Implementation

      For hdfs:// (HDFS)

      fileId exists in HdfsLocatedFileStatus, which is already returned to hdfs-client. We just need to print it in Ls#processPath().

      For file:// (Local FS)

      Linux

      Use java.nio.

      Windows

      Windows has the concept of "File ID" which is similar to inode id. It is unique in NTFS and ReFS.

      For other FS

      The fileId entry will be "0" in FileStatus if it is not set. We could either ignore or throw an exception.

      Attachments

        1. HADOOP-16082.001.patch
          6 kB
          Siyao Meng

        Issue Links

          Activity

            People

              smeng Siyao Meng
              smeng Siyao Meng
              Votes:
              0 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 10m
                  10m