Hadoop Map/Reduce
  1. Hadoop Map/Reduce
  2. MAPREDUCE-2317

HadoopArchives throwing NullPointerException while creating hadoop archives (.har files)

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 0.20.3
    • Fix Version/s: 0.21.1, 0.22.0, 0.23.0
    • Component/s: harchive
    • Labels:
      None
    • Environment:

      windows

    • Hadoop Flags:
      Reviewed

      Description

      While we are trying to run hadoop archive tool in widows using this way, it is giving the below exception.

      java org.apache.hadoop.tools.HadoopArchives -archiveName temp.har D:/test/in E:/temp

       
      
      java.lang.NullPointerException
      	at org.apache.hadoop.tools.HadoopArchives.writeTopLevelDirs(HadoopArchives.java:320)
      	at org.apache.hadoop.tools.HadoopArchives.archive(HadoopArchives.java:386)
      	at org.apache.hadoop.tools.HadoopArchives.run(HadoopArchives.java:725)
      	at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)
      	at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:79)
      	at org.apache.hadoop.tools.HadoopArchives.main(HadoopArchives.java:739)
      
      

      I see the code flow to handle this feature in windows also,

      Path.java
      
      /** Returns the parent of a path or null if at root. */
        public Path getParent() {
          String path = uri.getPath();
          int lastSlash = path.lastIndexOf('/');
          int start = hasWindowsDrive(path, true) ? 3 : 0;
          if ((path.length() == start) ||               // empty path
              (lastSlash == start && path.length() == start+1)) { // at root
            return null;
          }
          String parent;
          if (lastSlash==-1) {
            parent = CUR_DIR;
          } else {
            int end = hasWindowsDrive(path, true) ? 3 : 0;
            parent = path.substring(0, lastSlash==end?end+1:lastSlash);
          }
          return new Path(uri.getScheme(), uri.getAuthority(), parent);
        }
      
      
      1. MAPREDUCE-2317.patch
        1 kB
        Devaraj K
      2. MAPREDUCE-2317-0.20.patch
        1 kB
        Devaraj K
      3. MAPREDUCE-2317-trunk.patch
        1 kB
        Devaraj K

        Activity

          People

          • Assignee:
            Devaraj K
            Reporter:
            Devaraj K
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development