Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-16733

Improve INode#isRoot()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: In Progress
    • Major
    • Resolution: Unresolved
    • 3.3.0
    • None
    • namenode

    Description

      When constructing an INodeFile or INodeDirectory, it is usually necessary to give a name. For getLocalNameBytes, there are not many restrictions, such as null can be set. But an exception is thrown:

      INodeDirectory root = new INodeDirectory(HdfsConstants.GRANDFATHER_INODE_ID, null, perm, 0L);
      

      Some exceptions:

      java.lang.NullPointerException
      	at org.apache.hadoop.hdfs.server.namenode.INode.isRoot(INode.java:78)
      
      

      Although these situations rarely occur in production environments, we should refine the implementation of isRoot() to avoid this exception. This can enhance system robustness.

      Attachments

        Issue Links

          Activity

            People

              jianghuazhu JiangHua Zhu
              jianghuazhu JiangHua Zhu
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: