[
https://issues.apache.org/jira/browse/HDFS-512?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Konstantin Shvachko updated HDFS-512:
-------------------------------------
Attachment: blockIdAsKey.patch
Here is another variant of the patch.
- I changed {{Block.compareTo()}} to compare only the block Ids, and
{{Block.equals()}} now returns {{compareTo() == 0}}.
- I removed {{FSBanesystem.findBlock(id)}}, since it is not required any more,
abd pieces of the code that depended on non-equal generation stamps.
- Found that we have two identical methods {{getGenerationStampFromFile()}} in
FSDatataset, remove one, which does not have references.
- Unlike previous patch I think it is better to keep {{GenerationStamp}} class
around. It keeps generation stamp related constants and implements
{{nextStamp(), setStamp()}}. I don't see why it need to be Writable.
> 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: blockIdAsKey.patch, 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.