[ 
https://issues.apache.org/jira/browse/HDFS-511?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Konstantin Shvachko updated HDFS-511:
-------------------------------------

    Attachment: BlockManager.patch

# {{markBlockAsCorrupt()}} takes {{BlockInfo}} instead of {{Block}} as a 
parameter, thus there is no need to search for the block in the {{BlocksMap}}.
# Usage of {{block}} variable in {{addStoredBlock()}} is replaced by 
{{storedBlock}} wherever appropriate, so there is no need to explicitly search 
for the block once more.
# {{FSDirectory.addBlock()}} should not call {{getStoredBlock(block)}} because 
{{addINode()}} just before that already returns the block from the block map.
# {{BlockManager.addBlock(Block)}} is renamed to {{getValidLocations()}} 
because it does not add anything anywhere it just returns the locations of the 
block which are not in {{recentInvalidateSets}}.

> Redundant block searches in BlockManager.
> -----------------------------------------
>
>                 Key: HDFS-511
>                 URL: https://issues.apache.org/jira/browse/HDFS-511
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: name-node
>    Affects Versions: 0.21.0
>            Reporter: Konstantin Shvachko
>            Assignee: Konstantin Shvachko
>             Fix For: 0.21.0
>
>         Attachments: BlockManager.patch
>
>
> Some searches for a block in {{blocksMap}} are redundant and should be 
> eliminated.
> {{BlockManager.addStoredBlock()}} contain unnecessary explicit and hidden 
> (inside {{markBlockAsCorrupt()}}) calls of {{blocksMap.getStoredBlock()}}.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to