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

HdfsFileStatus#getPath returning null.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Invalid
    • 3.1.0
    • None
    • hdfs
    • None

    Description

      After HDFS-12681, HdfsFileStatus#getPath() returns null.
      I don't think this is expected.

      Both the implementation of HdfsFileStatus sets the path to null.

      HdfsNamedFileStatus.java
        HdfsNamedFileStatus(long length, boolean isdir, int replication,
                            long blocksize, long mtime, long atime,
                            FsPermission permission, Set<Flags> flags,
                            String owner, String group,
                            byte[] symlink, byte[] path, long fileId,
                            int childrenNum, FileEncryptionInfo feInfo,
                            byte storagePolicy, ErasureCodingPolicy ecPolicy) {
          super(length, isdir, replication, blocksize, mtime, atime,
              HdfsFileStatus.convert(isdir, symlink != null, permission, flags),
              owner, group, null, null,           ------ The last null is for path.
              HdfsFileStatus.convert(flags));
      
      HdfsLocatedFileStatus.java
        HdfsLocatedFileStatus(long length, boolean isdir, int replication,
                              long blocksize, long mtime, long atime,
                              FsPermission permission, EnumSet<Flags> flags,
                              String owner, String group,
                              byte[] symlink, byte[] path, long fileId,
                              int childrenNum, FileEncryptionInfo feInfo,
                              byte storagePolicy, ErasureCodingPolicy ecPolicy,
                              LocatedBlocks hdfsloc) {
          super(length, isdir, replication, blocksize, mtime, atime,
              HdfsFileStatus.convert(isdir, symlink != null, permission, flags),
              owner, group, null, null, HdfsFileStatus.convert(flags),  -- The last null on this line is for path.
              null);
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              shahrs87 Rushabh Shah
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: