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

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

We still need to address the Find Bugs warning somehow. I think we should 
revert the earlier change I suggested, as that did not help:

{code}
      for (DatanodeInfo loc : block.getLocations()) {

to

      for (DatanodeInfoWithStorage loc : block.getLocations()) {
{code}

Then try casting the datanode variable to a DatanodeInfo in this line:

{code}
if (loc.equals(datanode)) {
{code}

For the log message added, we should ideally mention the actual parameter names 
rather than the local variable names as that would give the user a better idea 
of what is wrong. 

This log message will be logged for every getBlockLocations call I think. While 
it highlights a problem, and would only be logged if there is a problem, it 
would create a lot of noise in the logs. In saying that, if we only log it 
once, then it may be missed. I think I would prefer to log it just once to 
avoid the log noise. We could do that in the DatanodeManager constructor with a 
message like:

{code}
LOG.warn("{} and {} are incompatible and only one can be enabled. Both are 
currently enabled.", 
DFSConfigKeys.DFS_NAMENODE_READ_CONSIDERSTORAGETYPE_KEY, 
DFSConfigKeys.DFS_NAMENODE_READ_CONSIDERLOAD_KEY
{code}

There is also one checkstyle warning for an unused import.

> 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
>             Fix For: 3.4.0
>
>         Attachments: HDFS-15255.001.patch, HDFS-15255.002.patch, 
> HDFS-15255.003.patch, HDFS-15255.004.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 fast StorageType node when the 
> distance is same.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to