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

Renukaprasad C commented on HDFS-16126:
---------------------------------------

[~lei w] Thanks for reporting the issue. 

org.apache.hadoop.hdfs.server.datanode.DiskBalancer.VolumePair#hashCode

org.apache.hadoop.hdfs.server.datanode.DiskBalancer.VolumePair#equals

These 2 methods already implemented in VolumePair. Anything missing out of this?

>  VolumePair  should  override hashcode() method
> -----------------------------------------------
>
>                 Key: HDFS-16126
>                 URL: https://issues.apache.org/jira/browse/HDFS-16126
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: diskbalancer
>            Reporter: lei w
>            Priority: Minor
>
> Now  we use a map to check  one plan with more than one line of same 
> VolumePair in createWorkPlan(final VolumePair volumePair, Step step) , code 
> is as flow:
> {code:java}
> private void createWorkPlan(final VolumePair volumePair, Step step)
>       throws DiskBalancerException {
>      // ... 
>     // In case we have a plan with more than
>     // one line of same VolumePair
>     // we compress that into one work order.
>     if (workMap.containsKey(volumePair)) {        //  To check use map
>       bytesToMove += workMap.get(volumePair).getBytesToCopy();
>     }
>    // ...
>   }
> {code}
>  I found the object volumePair is always a new object and without hashcode() 
> method, So use a map to check is invalid. Should we add  hashcode() in 
> VolumePair ?



--
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

Reply via email to