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
- is broken by
-
HDFS-12681 Make HdfsLocatedFileStatus a subtype of LocatedFileStatus
- Resolved