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

Stephen O'Donnell commented on HDFS-15255:
------------------------------------------

For the findbugs warning, it is related to this code:

{code}
      for (DatanodeInfo loc : block.getLocations()) {
        if (loc.equals(datanode)) {.  // Line 955
          block.addCachedLoc(loc);
          found = true;
          break;
        }
      }
{code}

Its probably because you have changed block.getLocations() to return 
DatanodeInfoWithStorage instead of DatanodeInfo. The equals and hashCode 
methods are delegated to super, so I am not sure why it is throwing this 
warning. Might be somehow related to the object type check in DatanodeID, but I 
am not sure.

The more detailed report says:

{code}
This method calls equals(Object) on two references of different class types and 
analysis suggests they will be to objects of different classes at runtime. 
Further, examination of the equals methods that would be invoked suggest that 
either this call will always return false, or else the equals method is not be 
symmetric (which is a property required by the contract for equals in class 
Object). 
{code}

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

Reply via email to