[ 
https://issues.apache.org/jira/browse/HADOOP-14730?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16117497#comment-16117497
 ] 

John Zhuge edited comment on HADOOP-14730 at 8/7/17 10:53 PM:
--------------------------------------------------------------

Thanks [~chris.douglas]. I am ok if both [~vishwajeet.dusane] and you found 2.x 
linkage useful.

AdlFileStatus#AdlFileStatus() is not used.
AdlFileStatus#hashCode is probably ok not to involve {{hasAcl}}, don't you 
think {{equals}} should return false when {{hasAcl}} are different in 2 objects?

A typical implementation of these 2 methods may look like this:
{noformat}
  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;
    if (!super.equals(o)) return false;
    AdlFileStatus that = (AdlFileStatus) o;
    return hasAcl == that.hasAcl;
  }

  @Override
  public int hashCode() {
    return Objects.hash(super.hashCode(), hasAcl);
  }
{noformat}


was (Author: jzhuge):
Thanks [~chris.douglas]. I am ok if both [~vishwajeet.dusane] and you found 2.x 
linkage useful.

AdlFileStatus#AdlFileStatus() is not used.
AdlFileStatus#hashCode is probably ok not to involve {{hasAcl}}, don't you 
think {{equals}} should return false when {{hasAcl}} are different in 2 objects?

A typical implementation of these 2 methods may look like this:
{noformat}
  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;
    if (!super.equals(o)) return false;
    AdlFileStatus that = (AdlFileStatus) o;
    return hasAcl == that.hasAcl;
  }

  @Override
  public int hashCode() {
    return Objects.hash(super.hashCode(), hasAcl);
  }
{noformat}

See 

> hasAcl property always set to false, regardless of FsPermission higher bit 
> order 
> ---------------------------------------------------------------------------------
>
>                 Key: HADOOP-14730
>                 URL: https://issues.apache.org/jira/browse/HADOOP-14730
>             Project: Hadoop Common
>          Issue Type: Bug
>    Affects Versions: 3.0.0-beta1
>            Reporter: Vishwajeet Dusane
>            Assignee: Chris Douglas
>             Fix For: 3.0.0-beta1
>
>         Attachments: HADOOP-14730.001.patch, HADOOP-14730.002.patch, 
> HADOOP-14730.003.patch, HADOOP-14730.004.patch, HADOOP-14730.005.patch
>
>
> 2 Unit Test cases are failing  [Azure-data-lake Module 
> |https://github.com/apache/hadoop/blob/4966a6e26e45d7dc36e0b270066ff7c87bcd00cc/hadoop-tools/hadoop-azure-datalake/src/test/java/org/apache/hadoop/fs/adl/TestGetFileStatus.java#L44-L44],
>  caused after HDFS-6984 commit.
> Issue seems to be {{hasAcl}} is hard coded to {{false}}. 
> {code:java}
> public FileStatus(long length, boolean isdir,
>                     int block_replication,
>                     long blocksize, long modification_time, long access_time,
>                     FsPermission permission, String owner, String group, 
>                     Path symlink,
>                     Path path) {
>     this(length, isdir, block_replication, blocksize, modification_time,
>         access_time, permission, owner, group, symlink, path,
>         false, false, false);
>   }
> {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]

Reply via email to