[
https://issues.apache.org/jira/browse/HDFS-5330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13795494#comment-13795494
]
Jing Zhao commented on HDFS-5330:
---------------------------------
bq. I tried to create a private method to share the retry logic but to find the
code is much less readable, and thus I kept it the same in the new patch.
Can we refactor this part of code with this new method:
{code}
private DirectoryListing listPaths(DFSClient dfsClient, String dirFileIdPath,
byte[] startAfter) throws IOException {
DirectoryListing dlisting = null;
try {
dlisting = dfsClient.listPaths(dirFileIdPath, startAfter);
} catch (RemoteException e) {
IOException io = e.unwrapRemoteException();
if (!(io instanceof DirectoryListingStartAfterNotFoundException)) {
throw io;
}
// This happens when startAfter was just deleted
LOG.info("Cookie cound't be found: " + new String(startAfter)
+ ", do listing from beginning");
dlisting = dfsClient
.listPaths(dirFileIdPath, HdfsFileStatus.EMPTY_NAME);
}
return dlisting;
}
{code}
> fix readdir and readdirplus for large directories
> -------------------------------------------------
>
> Key: HDFS-5330
> URL: https://issues.apache.org/jira/browse/HDFS-5330
> Project: Hadoop HDFS
> Issue Type: Sub-task
> Components: nfs
> Reporter: Brandon Li
> Assignee: Brandon Li
> Attachments: HDFS-5330.001.patch, HDFS-5330.002.patch,
> HDFS-5330.003.patch, HDFS-5330.004.patch
>
>
> These two calls need to use cookies to do multiple round trips to namenode to
> get the complete list of the dirents. Currently implementation passes an
> inode path as "startAfter" for listPath(), however, namenode doesn't resolve
> startAfter as an inode path. Better use file name as "startAfter".
--
This message was sent by Atlassian JIRA
(v6.1#6144)