[ 
https://issues.apache.org/jira/browse/HDDS-2993?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Siyao Meng updated HDDS-2993:
-----------------------------
    Description: 
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 
filling null for permission/owner/group.

We might want to fix this.

CC [~xyao] [~aengineer]

  was:
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]


> KeyManagerImpl#getFileStatus shouldn't always return null for permission, 
> owner and group
> -----------------------------------------------------------------------------------------
>
>                 Key: HDDS-2993
>                 URL: https://issues.apache.org/jira/browse/HDDS-2993
>             Project: Hadoop Distributed Data Store
>          Issue Type: Bug
>            Reporter: Siyao Meng
>            Priority: Major
>
> 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 
> filling 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-unsubscr...@hadoop.apache.org
For additional commands, e-mail: ozone-issues-h...@hadoop.apache.org

Reply via email to