[
https://issues.apache.org/jira/browse/HADOOP-14993?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16240091#comment-16240091
]
Kai Zheng commented on HADOOP-14993:
------------------------------------
Thanks for the work, [~uncleGen]. Some comments follow.
1. Is it possible to refactor {{listFiles}} and {{listLocatedStatus}} since
they look very similar sharing some codes/logic.
2. {{firstListing}} looks useless in {{createLocatedFileStatusIterator}}.
3. How about: isDirectory(OSSObjectSummary object)?
{code}
+ public static boolean objectRepresentsDirectory(final String name,
+ final long size) {
+ return !name.isEmpty()
+ && name.charAt(name.length() - 1) == '/'
+ && size == 0L;
+ }
{code}
4. How about: {{FileStatusAcceptor}} => {{OssPathFilter}} that extends
{{PathFilter}}. The comments could be simplified like: "OSS specific path
filter"
{code}
+/**
+ * Interface to implement by the logic deciding whether to accept a summary
+ * entry or path as a valid file or directory.
+ */
+public interface FileStatusAcceptor {
{code}
> AliyunOSS: Override listFiles and listLocatedStatus
> ----------------------------------------------------
>
> Key: HADOOP-14993
> URL: https://issues.apache.org/jira/browse/HADOOP-14993
> Project: Hadoop Common
> Issue Type: Sub-task
> Components: fs/oss
> Affects Versions: 3.0.0-beta1
> Reporter: Genmao Yu
> Assignee: Genmao Yu
> Attachments: HADOOP-14993.001.patch, HADOOP-14993.002.patch
>
>
> Do a bulk listing off all entries under a path in one single operation, there
> is no need to recursively walk the directory tree.
> Updates:
> - override listFiles and listLocatedStatus by using bulk listing
> - some minor updates in hadoop-aliyun index.md
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]