[
https://issues.apache.org/jira/browse/HDFS-512?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12739673#action_12739673
]
Konstantin Shvachko commented on HDFS-512:
------------------------------------------
> let's get rid of the genstamp from the the Block key. Can we still use it in
> the Block.equals() method?
I agree the block is identified by the blockID only in all maps. This by the
way should simplify life for external tools too.
We cannot have semantically different implementations of {{compareTo()}} and
{{equals()}} methods. This is what we discussed earlier with Nicholas.
{{equals()}} should be implemented as {{compareTo() == 0}}. {{compareTo()}} is
used by TreeMaps, while HashMaps are based on {{equals()}}, so they have to be
in sync if we want the same indexing by different types of maps.
> Set block id as the key to Block
> --------------------------------
>
> Key: HDFS-512
> URL: https://issues.apache.org/jira/browse/HDFS-512
> Project: Hadoop HDFS
> Issue Type: Improvement
> Affects Versions: Append Branch
> Reporter: Hairong Kuang
> Assignee: Hairong Kuang
> Fix For: Append Branch
>
> Attachments: blockKey.patch
>
>
> Currently the key to Block is block id + generation stamp. I would propose to
> change it to be only block id. This is based on the following properties of
> the dfs cluster:
> 1. On each datanode only one replica of block exists. Therefore there is only
> one generation of a block.
> 2. NameNode has only one entry for a block in its blocks map.
> With this change, search for a block/replica's meta information is easier
> since most of the time we know a block's id but may not know its generation
> stamp.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.