[
https://issues.apache.org/jira/browse/HDFS-12970?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16307033#comment-16307033
]
Chris Douglas commented on HDFS-12970:
--------------------------------------
This is by design. {{HdfsFileStatus}} needs to be qualified before it can be
returned to the user, since the NameNode doesn't return fully qualified URIs.
Prior to HDFS-12681, it was qualified as it was copied into a {{FileStatus}}
object. Since {{HdfsFileStatus}} is now a subtype of {{FileStatus}}, the path
is initialized as null in the constructor and set later by the client.
Are you observing the path is {{null}} when it's returned to the user?
> HdfsFileStatus#getPath returning null.
> --------------------------------------
>
> Key: HDFS-12970
> URL: https://issues.apache.org/jira/browse/HDFS-12970
> Project: Hadoop HDFS
> Issue Type: Bug
> Components: hdfs
> Affects Versions: 3.1.0
> Reporter: Rushabh S Shah
> Priority: Critical
>
> After HDFS-12681, HdfsFileStatus#getPath() returns null.
> I don't think this is expected.
> Both the implementation of {{HdfsFileStatus}} sets the path to null.
> {code:title=HdfsNamedFileStatus.java|borderStyle=solid}
> 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));
> {code}
> {code:title=HdfsLocatedFileStatus.java|borderStyle=solid}
> 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);
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]