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

Konstantin Shvachko commented on HDFS-512:
------------------------------------------

> (1) is too dangerous to get everything correct

I want to see at least one example where current the implementation (id+gs) of 
the block key is critical.

> and is an incompatible change;

I agree it is. BTW, nobody complained about changing it from id to (id+gs).

> (2) change class of the map keys from Block to something else, say BlockId

This is going to cost us. Currently BlocksMap entry key and value are the same 
object. So the key is represented by a reference only. In your proposal (2) 
replacing the key with BlockID it is going to be a new object, which will tale 
more space than a reference.
Unless you implement {{BlockInfo.equals()}} differently. Right now it simply 
refers to the super class method {{Block.equals()}}.
{{BlockInfo}} is not a public api and we can change it, but I still don't know 
why would we want to increase the complexity of the code, except the 
hypothetical suggestion it may cause problems.

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

Reply via email to