[
https://issues.apache.org/jira/browse/YARN-3468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14504093#comment-14504093
]
Sangjin Lee commented on YARN-3468:
-----------------------------------
Sorry this fell off my radar.
{code}
1094 RemoteIterator<FileStatus> subDirStatus =
lfs.listStatus(subDirPath);
1095 if (subDirStatus != null && !subDirStatus.hasNext()) {
1096 // Skip the renaming when the given localSubDir is empty
1097 return;
1098 }
1099 lfs.rename(subDirPath, new Path(
{code}
Wouldn't it be bit safer to do
{code}
1094 RemoteIterator<FileStatus> subDirStatus =
lfs.listStatus(subDirPath);
1095 if (subDirStatus != null && subDirStatus.hasNext()) {
1096 lfs.rename(subDirPath, new Path(
{code}
? Also, I normally try to avoid returning in the middle of a method as it can
be error-prone (not necessarily here, but as a general rule).
> NM should not blindly rename usercache/filecache/nmPrivate on restart
> ---------------------------------------------------------------------
>
> Key: YARN-3468
> URL: https://issues.apache.org/jira/browse/YARN-3468
> Project: Hadoop YARN
> Issue Type: Bug
> Reporter: Siqi Li
> Assignee: Siqi Li
> Attachments: YARN-3468.v1.patch
>
>
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)