[ 
https://issues.apache.org/jira/browse/HDFS-8794?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14631580#comment-14631580
 ] 

Arpit Agarwal edited comment on HDFS-8794 at 7/17/15 4:59 PM:
--------------------------------------------------------------

Hi [~hitliuyi], thanks for starting this effort.

bq. Of course we need to make few change to getCorruptReplicaBlockIds.
Do you mean an additional fix to {{getCorruptReplicaBlockIds}} beyond your 
current patch is needed? It looks like {{getCorruptReplicaBlockIds}} won't work 
in general since it assumes the map is sorted. Can you add an 
{{\@VisibleForTesting}} annotation and also rename the function to 
{{getCorruptReplicaBlockIdsForTesting}} so this function is not used 
inadvertently?

+1 otherwise, pending Jenkins.


was (Author: arpitagarwal):
Hi [~hitliuyi], thanks for starting this effort.

bq. Of course we need to make few change to getCorruptReplicaBlockIds.
Do you mean an additional fix to {{getCorruptReplicaBlockIds}} beyond your 
current patch is needed? It looks like {{getCorruptReplicaBlockIds}} won't work 
in general since it assumes the map is sorted. Can you add an 
{{\@VisibleForTesting}} annotation and also rename the function to 
{{getCorruptReplicaBlockIdsForTesting}} so this function is not used 
inadvertently?

+1 otherwise.

> Improve CorruptReplicasMap#corruptReplicasMap
> ---------------------------------------------
>
>                 Key: HDFS-8794
>                 URL: https://issues.apache.org/jira/browse/HDFS-8794
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>            Reporter: Yi Liu
>            Assignee: Yi Liu
>         Attachments: HDFS-8794.001.patch
>
>
> Currently we use {{TreeMap}} for {{corruptReplicasMap}}, actually the only 
> need sorted place is {{getCorruptReplicaBlockIds}} which is used by test.
> So we can use {{HashMap}}.
> From memory and performance view, {{HashMap}} is better than {{TreeMap}}, a 
> simliar optimization HDFS-7433. Of course we need to make few change to 
> {{getCorruptReplicaBlockIds}}.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to