You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "Siyao Meng (Jira)" <ji...@apache.org> on 2020/02/10 21:45:00 UTC
[jira] [Created] (HDDS-2993) KeyManagerImpl#getFileStatus should
return permission, owner and group info
Siyao Meng created HDDS-2993:
--------------------------------
Summary: KeyManagerImpl#getFileStatus should return permission, owner and group info
Key: HDDS-2993
URL: https://issues.apache.org/jira/browse/HDDS-2993
Project: Hadoop Distributed Data Store
Issue Type: Bug
Reporter: Siyao Meng
The {{getFileStatus}} API always returns null for permisson, owner and group at the moment.
From the [code|https://github.com/apache/hadoop-ozone/blob/5950224c735c994d0acfaada87e3eef6c306299e/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/KeyManagerImpl.java#L1689-L1692]:
{code}
if (fileKeyInfo != null) {
// this is a file
return new OzoneFileStatus(fileKeyInfo, scmBlockSize, false);
}
{code}
into the [constructor|https://github.com/apache/hadoop-ozone/blob/2e9265864af3b1d520dc7cdca3698d306f28cd14/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OzoneFileStatus.java#L41-L45]:
{code}
public OzoneFileStatus(OmKeyInfo key, long blockSize, boolean isDirectory) {
super(key.getDataSize(), isDirectory, key.getFactor().getNumber(),
blockSize, key.getModificationTime(), getPath(key.getKeyName()));
keyInfo = key;
}
{code}
into [super|https://github.com/apache/hadoop/blob/branch-3.2.0/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileStatus.java#L109-L115] (hadoop-common 3.2.0 jar):
{code}
//We should deprecate this soon?
public FileStatus(long length, boolean isdir, int block_replication,
long blocksize, long modification_time, Path path) {
this(length, isdir, block_replication, blocksize, modification_time,
0, null, null, null, path);
}
{code}
The constructor [params|https://github.com/apache/hadoop/blob/branch-3.2.0/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileStatus.java#L117-L127]:
{code}
/**
* Constructor for file systems on which symbolic links are not supported
*/
public FileStatus(long length, boolean isdir,
int block_replication,
long blocksize, long modification_time, long access_time,
FsPermission permission, String owner, String group,
Path path) {
this(length, isdir, block_replication, blocksize, modification_time,
access_time, permission, owner, group, null, path);
}
{code}
You can see that the constructor used for Ozone's getFileStatus is always feeding null for permission/owner/group.
We might want to fix this.
CC [~xyao] [~aengineer]
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org