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

CreateEditsLog throws NullPointerException

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.8.0, 3.0.0-alpha2
    • Component/s: hdfs
    • Labels:
      None
    • Hadoop Flags:
      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

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: