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

CreateEditsLog throws NullPointerException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.8.0, 3.0.0-alpha2
    • hdfs
    • None
    • Reviewed

    Description

      When trying to create edit logs through CreateEditsLog, the following exception is encountered.

      Exception in thread "main" java.lang.NullPointerException
      at java.io.File.<init>(File.java:415)
      at org.apache.hadoop.hdfs.server.namenode.NNStorage.getStorageDirectory(NNStorage.java:343)
      at org.apache.hadoop.hdfs.server.namenode.FSImageTestUtil.createStandaloneEditLog(FSImageTestUtil.java:200)
      at org.apache.hadoop.hdfs.server.namenode.CreateEditsLog.main(CreateEditsLog.java:205)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at org.apache.hadoop.util.RunJar.run(RunJar.java:239)
      at org.apache.hadoop.util.RunJar.main(RunJar.java:153)

      This happens as Mockito is unable to access package protected method NNStorage#getStorageDirectory
      We need to change the access of this method to public

      Attachments

        1. HDFS-11128.000.patch
          0.9 kB
          Hanisha Koneru

        Activity

          People

            hanishakoneru Hanisha Koneru
            hanishakoneru Hanisha Koneru
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: