[ https://issues.apache.org/jira/browse/HDFS-11362?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15959749#comment-15959749 ]
Xiaoyu Yao commented on HDFS-11362: ----------------------------------- Thanks [~hanishakoneru] for the update. +1 for the v001 patch. I will commit it shortly. We should refactor StorageDirectory with a Builder pattern to avoid so many different constructors. This can be handled in a separate JIRA. > Storage#shouldReturnNextDir should check for null dirType > --------------------------------------------------------- > > Key: HDFS-11362 > URL: https://issues.apache.org/jira/browse/HDFS-11362 > Project: Hadoop HDFS > Issue Type: Bug > Components: hdfs > Reporter: Hanisha Koneru > Assignee: Hanisha Koneru > Priority: Minor > Attachments: HDFS-11362.000.patch, HDFS-11362.001.patch > > > _Storage#shouldReturnNextDir_ method checks if the next Storage directory is > of the same type us dirType. > {noformat} > private boolean shouldReturnNextDir() { > StorageDirectory sd = getStorageDir(nextIndex); > return (dirType == null || sd.getStorageDirType().isOfType(dirType)) && > (includeShared || !sd.isShared()); > } > {noformat} > There is a possibility that sd.getStorageDirType() returns null (default > dirType is null). Hence, before checking for type match, we should make sure > that the value returned by sd.getStorageDirType() is not null. -- This message was sent by Atlassian JIRA (v6.3.15#6346) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org