[ https://issues.apache.org/jira/browse/HDFS-15255?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17076380#comment-17076380 ]
Stephen O'Donnell commented on HDFS-15255: ------------------------------------------ {quote} If both are set, then the comparator here would return both. Since in follow code, when call Collections.sort(list, comp), list has been sorted. {quote} I'm not sure if that is correct. This method does not actually do the sorting. Rather it returns a `Consumer<>` object which seems to contain a comparator. This is then passed to `networktopology.sortByDistance` where the actual sort is applied. Reading this method, I think it returns only one "sort". It starts as a shuffle. If `readConsiderLoad` is set, it overwrites it. If `readConsiderStorageType` is also set, it overwrites it again and the last one set wins and is returned. I don't think each sort is applied on top of the last. In saying the above, this syntax is a bit unfamiliar to me, so I may be wrong! > Consider StorageType when DatanodeManager#sortLocatedBlock() > ------------------------------------------------------------ > > Key: HDFS-15255 > URL: https://issues.apache.org/jira/browse/HDFS-15255 > Project: Hadoop HDFS > Issue Type: Improvement > Reporter: Lisheng Sun > Assignee: Lisheng Sun > Priority: Major > Attachments: HDFS-15255.001.patch, HDFS-15255.002.patch > > > When only one replica of a block is SDD, the others are HDD. > When the client reads the data, the current logic is that it considers the > distance between the client and the dn. I think it should also consider the > StorageType of the replica. Priority to return a replica of the specified > StorageType -- This message was sent by Atlassian Jira (v8.3.4#803005) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org