[
https://issues.apache.org/jira/browse/HADOOP-13736?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15616648#comment-15616648
]
Chris Nauroth commented on HADOOP-13736:
----------------------------------------
Hello [~eddyxu].
Could you check if the patch needs to be rebased against the current
HADOOP-13345 branch? I wasn't able to apply it.
This is similar to something Aaron did in an earlier version of the
{{MetadataStore}} patch. As Aaron mentioned on this issue, the type parameters
are unfortunately going to be lost to type erasure during reflection-based
initialization. You can see where this happens in the prototype patch I
attached to HADOOP-13345, in {{ConsistentS3AFileSystem#initialize}}:
https://issues.apache.org/jira/secure/attachment/12816508/HADOOP-13345.prototype1.patch
The equivalent thing is also happening in Aaron's latest revision of
HADOOP-13651, in {{S3Guard#getMetadataStoreSingleton}}:
https://issues.apache.org/jira/secure/attachment/12835848/HADOOP-13651-HADOOP-13345.003.patch
We'll effectively end up with an instance of {{MetadataStore<? extends
FileStatus>}} after initialization, and I believe the only way to restore the
concrete type, like {{S3AFileStatus}}, would be to downcast. I'm not opposed
to using the type parameters, but if the goal is to avoid downcasts, then I
don't think it will achieve that.
If I'm missing something, then please let me know.
> Change PathMetadata to hold S3AFileStatus instead of FileStatus.
> ----------------------------------------------------------------
>
> Key: HADOOP-13736
> URL: https://issues.apache.org/jira/browse/HADOOP-13736
> Project: Hadoop Common
> Issue Type: Sub-task
> Components: fs/s3
> Reporter: Lei (Eddy) Xu
> Assignee: Lei (Eddy) Xu
> Attachments: HADOOP-13736-HADOOP-13345.000.patch,
> HADOOP-13736.000.patch, HADOOP-13736.wip-01.patch
>
>
> {{S3AFileStatus}} is implemented differently with {{FileStatus}}, for
> instance {{S3AFileStatus#isEmptyDirectory()}} is not implemented in
> {{FileStatus()}}. And {{access_time}}, {{block_replication}}, {{owner}},
> {{group}} and a few other fields are not meaningful in {{S3AFileStatus}}.
> So in the scope of {{S3guard}}, it should use {{S3AFileStatus}} in instead
> of {{FileStatus}} in {{PathMetadaa}} to avoid casting the types back and
> forth in S3A.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]