[
https://issues.apache.org/jira/browse/HDFS-12970?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16308735#comment-16308735
]
Rushabh S Shah commented on HDFS-12970:
---------------------------------------
bq. Are you observing the path is null when it's returned to the user?
No.
My use case: While working on HDFS-12811, I was issuing
{{FSNamesystem#getFileInfo}} call from {{NamenodeFsck}} and trying to extract
path from HdfsFileStatus.
Thats where it returned null.
bq. the path is initialized as null in the constructor and set later by the
client.
If I understand your previous comment correctly, I have to cast the returned
file status to either {{HdfsNamedFileStatus}} or {{HdfsLocatedFileStatus}}
explicitly ?
> 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]