You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-issues@hadoop.apache.org by "Hairong Kuang (JIRA)" <ji...@apache.org> on 2009/07/29 19:06:14 UTC

[jira] Created: (HDFS-512) Set block id as the key to Block

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: 0.21.0
            Reporter: Hairong Kuang
            Assignee: Hairong Kuang
             Fix For: 0.21.0


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.


[jira] Commented: (HDFS-512) Set block id as the key to Block

Posted by "Tsz Wo (Nicholas), SZE (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-512?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12738566#action_12738566 ] 

Tsz Wo (Nicholas), SZE commented on HDFS-512:
---------------------------------------------

> Most of the maps Nicholas listed above are HashMap}}s. They are based on {{Block.hash() method ...

HashMap, like any class implementing Map, also uses equals(..).  See [Map API|http://java.sun.com/javase/6/docs/api/java/util/Map.html].

> 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: 0.21.0
>            Reporter: Hairong Kuang
>            Assignee: Hairong Kuang
>             Fix For: 0.21.0
>
>         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.


[jira] Commented: (HDFS-512) Set block id as the key to Block

Posted by "Konstantin Shvachko (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-512?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12738568#action_12738568 ] 

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

I was looking at compareTo(), which is used in TreeMap. HashMap uses equals() so yes all maps are affected.
I still think the change makes sense because we don't want to treat the same block with different generation stamps as separate blocks.
By the way, equals() should probably be implemented via compareTo() so that they are always in sync.

> 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: 0.21.0
>            Reporter: Hairong Kuang
>            Assignee: Hairong Kuang
>             Fix For: 0.21.0
>
>         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.


[jira] Commented: (HDFS-512) Set block id as the key to Block

Posted by "dhruba borthakur (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-512?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12739367#action_12739367 ] 

dhruba borthakur commented on HDFS-512:
---------------------------------------

There are some advantages to using the generation stamp as part of the unique identifier for a Block object. This ensures that all code correctly identifies that blocks with different generation stamp are different blocks and can have different contents inside them. It might not be a big deal for NN data structures, especially because the NN first checks to see if a block belongs to a file before inserting it into the BlocksMap. But for external tools that use a block interface (e.g. Balancer, fsck, etc), it might be helpful for them to understand that blocks with different generation stamps are different blocks (do these utilities use the Block object at all?)

@Raghu: > This is probably a good time to add Block to ReplicaInfo. 

If we follow Raghu's suggestion, then can we continue using the genstamp as part of the Block key?

There are other cases, (especially during block report processing) where we would have to do wild-card lookups for a block. But the cost of these extra lookup calls might be minimal because they will be in the error-code-path only.


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


[jira] Commented: (HDFS-512) Set block id as the key to Block

Posted by "Konstantin Shvachko (JIRA)" <ji...@apache.org>.
    [ 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.


[jira] Commented: (HDFS-512) Set block id as the key to Block

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-512?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12770269#action_12770269 ] 

Hudson commented on HDFS-512:
-----------------------------

Integrated in Hdfs-Patch-h5.grid.sp2.yahoo.net #78 (See [http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-h5.grid.sp2.yahoo.net/78/])
    

> 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: 0.21.0
>            Reporter: Hairong Kuang
>            Assignee: Konstantin Shvachko
>             Fix For: 0.21.0
>
>         Attachments: blockIdAsKey.patch, 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.


[jira] Commented: (HDFS-512) Set block id as the key to Block

Posted by "Konstantin Shvachko (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-512?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12738533#action_12738533 ] 

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

Most of the maps Nicholas listed above are {{HashMap}}s. They are based on {{Block.hash()}} method, which is not modified by the patch, and has never used generation stamp in calculating block's hash. I found only 4 maps, which use {{TreeSet<Block>}} or {{TreeMap}} with the {{Block}} as a key. Here they are:
# UnderReplicatedBlocks
# BlockManager.excessReplicateMap
# CorruptReplicasMap
# DatanodeDescriptor.invalidateBlocks

Neither of them need to know about generation stamp.
I think it is safe to make the change. We should commit it to the append branch.

Additional comments:
- {{getReplicaInfo()}} adds generation stamp checking. I don't think this is necessary.
- comment {{// ... ignore generation stamp!!!}} is misleading, should be removed.
- {{ReplicaInfo.setGenStamp(), getGenStamp()}} should rather be called {{setGenerationStamp(), getGenerationStamp()}}
- Why does {{ReplicaInfo}} need genStamp field. Don't we always have it in {{Block}}? If we do could you please add a comment clarifying what this field actually is.


> 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: 0.21.0
>            Reporter: Hairong Kuang
>            Assignee: Hairong Kuang
>             Fix For: 0.21.0
>
>         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.


[jira] Commented: (HDFS-512) Set block id as the key to Block

Posted by "Tsz Wo (Nicholas), SZE (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-512?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12739777#action_12739777 ] 

Tsz Wo (Nicholas), SZE commented on HDFS-512:
---------------------------------------------

>From my understanding, we want to change some map keys from id + gs to id.  Then, we have a few options
(1) change Block.compareTo(..) and Block.equals(..) to compare on id.
(2) change class of the map keys from Block to something else, say BlockId, which only uses id (but not gs) to implement equals (and compareTo).
(3) use TreeMap with Block as the key but define a new Comparator which compare Block(s) with id only.

Current patch implements option (1).  We may consider options (2) and (3).

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


[jira] Commented: (HDFS-512) Set block id as the key to Block

Posted by "Tsz Wo (Nicholas), SZE (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-512?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12737395#action_12737395 ] 

Tsz Wo (Nicholas), SZE commented on HDFS-512:
---------------------------------------------

> The way I look at this problem is that I'd like to treat a generation stamp as a property of a block just as the property block length. The only key to identify a block is the block id.

If this is a new class, you are right that we can view it that way.  However, Block is an existing base class and it is there for a very long time.  We cannot simply view it in one way yesterday and view it in another way today.  Also, it belongs to the org.apache.hadoop.hdfs.protocol package.  This may potentially break some external applications.

Inside hdfs, there are
- HashMap<Block, BlockScanInfo> blockMap in DataBlockScanner
- Map<Block, BalancerBlock> globalBlockList in Balancer
- List<HashMap<Block, BalancerBlock>> movedBlocks in Balancer.MovedBlocks
- Map<Block, PendingBlockInfo> pendingReplications in PendingReplicationBlocks
- List<TreeSet<Block>> priorityQueues in UnderReplicatedBlocks
- BlockInfo extends Block
- BlockMetaDataInfo extends Block
- ...

Have you considered the implication to them?

> 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: 0.21.0
>            Reporter: Hairong Kuang
>            Assignee: Hairong Kuang
>             Fix For: 0.21.0
>
>         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.


[jira] Commented: (HDFS-512) Set block id as the key to Block

Posted by "Tsz Wo (Nicholas), SZE (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-512?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12738577#action_12738577 ] 

Tsz Wo (Nicholas), SZE commented on HDFS-512:
---------------------------------------------

> I was looking at compareTo(), which is used in TreeMap. ...
Even for TreeMap, it is good to implement equals(..) correctly as described by the [TreeMap API|http://java.sun.com/javase/6/docs/api/java/util/TreeMap.html],
bq. .. The behavior of a sorted map is well-defined even if its ordering is inconsistent with equals; it just fails to obey the general contract of the Map interface.

> By the way, equals() should probably be implemented via compareTo() so that they are always in sync.
Agree.

> 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: 0.21.0
>            Reporter: Hairong Kuang
>            Assignee: Hairong Kuang
>             Fix For: 0.21.0
>
>         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.


[jira] Updated: (HDFS-512) Set block id as the key to Block

Posted by "Konstantin Shvachko (JIRA)" <ji...@apache.org>.
     [ 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

This is merging the current trunk.
I also fixed updatePipeline() as Hairong suggested.
I did not fix commitBlockSynchronization(). I think it should be a refactoring task for another jira.

> 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: 0.21.0
>            Reporter: Hairong Kuang
>            Assignee: Konstantin Shvachko
>             Fix For: 0.21.0
>
>         Attachments: blockIdAsKey.patch, 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.


[jira] Commented: (HDFS-512) Set block id as the key to Block

Posted by "Tsz Wo (Nicholas), SZE (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-512?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12739749#action_12739749 ] 

Tsz Wo (Nicholas), SZE commented on HDFS-512:
---------------------------------------------

I am proposing we should consider this option if it is not yet considered.

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


[jira] Updated: (HDFS-512) Set block id as the key to Block

Posted by "Konstantin Shvachko (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HDFS-512?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Konstantin Shvachko updated HDFS-512:
-------------------------------------

        Fix Version/s:     (was: Append Branch)
                       0.21.0
             Assignee: Konstantin Shvachko  (was: Hairong Kuang)
    Affects Version/s:     (was: Append Branch)
                       0.21.0
               Status: Patch Available  (was: Open)

I ran test-core and test-patch myself. It works. Need to run map-reduce tests to make sure nothing is affected by this change.

> 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: 0.21.0
>            Reporter: Hairong Kuang
>            Assignee: Konstantin Shvachko
>             Fix For: 0.21.0
>
>         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.


[jira] Commented: (HDFS-512) Set block id as the key to Block

Posted by "dhruba borthakur (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-512?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12739694#action_12739694 ] 

dhruba borthakur commented on HDFS-512:
---------------------------------------

Yes, sounds good to me. 

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


[jira] Commented: (HDFS-512) Set block id as the key to Block

Posted by "Hairong Kuang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-512?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12737348#action_12737348 ] 

Hairong Kuang commented on HDFS-512:
------------------------------------

The way I look at this problem is that I'd like to treat a generation stamp as a property of a block just as the property block length. The only key to identify a block is the block id.

> 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: 0.21.0
>            Reporter: Hairong Kuang
>            Assignee: Hairong Kuang
>             Fix For: 0.21.0
>
>         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.


[jira] Commented: (HDFS-512) Set block id as the key to Block

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-512?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12769817#action_12769817 ] 

Hudson commented on HDFS-512:
-----------------------------

Integrated in Hadoop-Hdfs-trunk #120 (See [http://hudson.zones.apache.org/hudson/job/Hadoop-Hdfs-trunk/120/])
    

> 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: 0.21.0
>            Reporter: Hairong Kuang
>            Assignee: Konstantin Shvachko
>             Fix For: 0.21.0
>
>         Attachments: blockIdAsKey.patch, 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.


[jira] Commented: (HDFS-512) Set block id as the key to Block

Posted by "Tsz Wo (Nicholas), SZE (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-512?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12739831#action_12739831 ] 

Tsz Wo (Nicholas), SZE commented on HDFS-512:
---------------------------------------------

I forgot to say that my preference would be (2) > (3) > (1) because
- (1) is too dangerous to get everything correct and is an incompatible change; and
- (3) seems requiring more code changes than (2).

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


[jira] Commented: (HDFS-512) Set block id as the key to Block

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-512?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12769591#action_12769591 ] 

Hudson commented on HDFS-512:
-----------------------------

Integrated in Hdfs-Patch-h2.grid.sp2.yahoo.net #59 (See [http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-h2.grid.sp2.yahoo.net/59/])
    

> 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: 0.21.0
>            Reporter: Hairong Kuang
>            Assignee: Konstantin Shvachko
>             Fix For: 0.21.0
>
>         Attachments: blockIdAsKey.patch, 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.


[jira] Commented: (HDFS-512) Set block id as the key to Block

Posted by "Konstantin Shvachko (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-512?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12739763#action_12739763 ] 

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

I understand we can implement multiple comparators. But my question is what are the use cases for them? You propose two: where do you plan to use each of them?

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


[jira] Commented: (HDFS-512) Set block id as the key to Block

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-512?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12769430#action_12769430 ] 

Hudson commented on HDFS-512:
-----------------------------

Integrated in Hadoop-Hdfs-trunk-Commit #81 (See [http://hudson.zones.apache.org/hudson/job/Hadoop-Hdfs-trunk-Commit/81/])
    . Block.equals() and compareTo() compare blocks based only on block Ids, ignoring generation stamps. Contributed by Konstantin Shvachko.


> 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: 0.21.0
>            Reporter: Hairong Kuang
>            Assignee: Konstantin Shvachko
>             Fix For: 0.21.0
>
>         Attachments: blockIdAsKey.patch, 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.


[jira] Updated: (HDFS-512) Set block id as the key to Block

Posted by "Hairong Kuang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HDFS-512?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hairong Kuang updated HDFS-512:
-------------------------------

    Attachment: blockKey.patch

This patch change Block's key from block id+generation stamp to be block id. It also removes the class GenerationStamp and the use of generation wild card.

> 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: 0.21.0
>            Reporter: Hairong Kuang
>            Assignee: Hairong Kuang
>             Fix For: 0.21.0
>
>         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.


[jira] Updated: (HDFS-512) Set block id as the key to Block

Posted by "Konstantin Shvachko (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HDFS-512?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Konstantin Shvachko updated HDFS-512:
-------------------------------------

    Status: Patch Available  (was: Open)

> 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: 0.21.0
>            Reporter: Hairong Kuang
>            Assignee: Konstantin Shvachko
>             Fix For: 0.21.0
>
>         Attachments: blockIdAsKey.patch, 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.


[jira] Commented: (HDFS-512) Set block id as the key to Block

Posted by "Konstantin Shvachko (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-512?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12739753#action_12739753 ] 

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

I am confused. What do you want to use two different comparators for?

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


[jira] Commented: (HDFS-512) Set block id as the key to Block

Posted by "Hadoop QA (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-512?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12766648#action_12766648 ] 

Hadoop QA commented on HDFS-512:
--------------------------------

-1 overall.  Here are the results of testing the latest attachment 
  http://issues.apache.org/jira/secure/attachment/12422175/blockIdAsKey.patch
  against trunk revision 825689.

    +1 @author.  The patch does not contain any @author tags.

    +1 tests included.  The patch appears to include 9 new or modified tests.

    +1 javadoc.  The javadoc tool did not generate any warning messages.

    +1 javac.  The applied patch does not increase the total number of javac compiler warnings.

    +1 findbugs.  The patch does not introduce any new Findbugs warnings.

    +1 release audit.  The applied patch does not increase the total number of release audit warnings.

    -1 core tests.  The patch failed core unit tests.

    +1 contrib tests.  The patch passed contrib unit tests.

Test results: http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-h2.grid.sp2.yahoo.net/27/testReport/
Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-h2.grid.sp2.yahoo.net/27/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
Checkstyle results: http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-h2.grid.sp2.yahoo.net/27/artifact/trunk/build/test/checkstyle-errors.html
Console output: http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-h2.grid.sp2.yahoo.net/27/console

This message is automatically generated.

> 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: 0.21.0
>            Reporter: Hairong Kuang
>            Assignee: Konstantin Shvachko
>             Fix For: 0.21.0
>
>         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.


[jira] Commented: (HDFS-512) Set block id as the key to Block

Posted by "dhruba borthakur (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-512?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12739645#action_12739645 ] 

dhruba borthakur commented on HDFS-512:
---------------------------------------

> does HDFS have any maps or sets that need to contain two instances of Block with the same block id but different gen stamps

I agree, that this is not the case. So, let's get rid of  the genstamp from the the Block key. Can we still use it in the Block.equals() method?

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


[jira] Commented: (HDFS-512) Set block id as the key to Block

Posted by "Hadoop QA (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-512?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12769102#action_12769102 ] 

Hadoop QA commented on HDFS-512:
--------------------------------

+1 overall.  Here are the results of testing the latest attachment 
  http://issues.apache.org/jira/secure/attachment/12422973/blockIdAsKey.patch
  against trunk revision 828926.

    +1 @author.  The patch does not contain any @author tags.

    +1 tests included.  The patch appears to include 9 new or modified tests.

    +1 javadoc.  The javadoc tool did not generate any warning messages.

    +1 javac.  The applied patch does not increase the total number of javac compiler warnings.

    +1 findbugs.  The patch does not introduce any new Findbugs warnings.

    +1 release audit.  The applied patch does not increase the total number of release audit warnings.

    +1 core tests.  The patch passed core unit tests.

    +1 contrib tests.  The patch passed contrib unit tests.

Test results: http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-h2.grid.sp2.yahoo.net/54/testReport/
Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-h2.grid.sp2.yahoo.net/54/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
Checkstyle results: http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-h2.grid.sp2.yahoo.net/54/artifact/trunk/build/test/checkstyle-errors.html
Console output: http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-h2.grid.sp2.yahoo.net/54/console

This message is automatically generated.

> 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: 0.21.0
>            Reporter: Hairong Kuang
>            Assignee: Konstantin Shvachko
>             Fix For: 0.21.0
>
>         Attachments: blockIdAsKey.patch, 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.


[jira] Updated: (HDFS-512) Set block id as the key to Block

Posted by "Konstantin Shvachko (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HDFS-512?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Konstantin Shvachko updated HDFS-512:
-------------------------------------

      Resolution: Fixed
    Hadoop Flags: [Incompatible change, Reviewed]  (was: [Incompatible change])
          Status: Resolved  (was: Patch Available)

I just committed this.

> 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: 0.21.0
>            Reporter: Hairong Kuang
>            Assignee: Konstantin Shvachko
>             Fix For: 0.21.0
>
>         Attachments: blockIdAsKey.patch, 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.


[jira] Commented: (HDFS-512) Set block id as the key to Block

Posted by "Tsz Wo (Nicholas), SZE (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-512?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12739878#action_12739878 ] 

Tsz Wo (Nicholas), SZE commented on HDFS-512:
---------------------------------------------

> I want to see at least one example where current the implementation (id+gs) of the block key is critical.
I did not say that I got a good example for using id+gs.

> (1) is too dangerous to get everything correct
Typo: it should be "(1) is too dangerous: it is very difficult to get everything correct"
I mean (1) involves too much.  I even have a hard time to list out all the affected components in [my previous comment|https://issues.apache.org/jira/browse/HDFS-512?focusedCommentId=12737395&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#action_12737395].

BTW, I am not against (1) and I am not the assignee of this issue.  Please go ahead if you have fully considered other alternatives.  I think the assignee has the freedom to choose a solution.

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


[jira] Commented: (HDFS-512) Set block id as the key to Block

Posted by "Tsz Wo (Nicholas), SZE (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-512?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12737702#action_12737702 ] 

Tsz Wo (Nicholas), SZE commented on HDFS-512:
---------------------------------------------

Hairong, if my concerns are carefully considered, I won't veto the changes although the changes are still very dangerous.

I suggest to keep WILDCARD_STAMP and use it for sanity check as shown below.
{code}
//Block
  public boolean equals(Object o) {
    ...
    final Block that = (Block)o;
    if (this.generationStamp != that.generationStamp && that.generationStamp != WILDCARD_STAMP) {
      throw new IllegalArgumentException(..);
    }
    return ...
  }
{code}

> 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: 0.21.0
>            Reporter: Hairong Kuang
>            Assignee: Hairong Kuang
>             Fix For: 0.21.0
>
>         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.


[jira] Commented: (HDFS-512) Set block id as the key to Block

Posted by "Tsz Wo (Nicholas), SZE (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-512?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12739841#action_12739841 ] 

Tsz Wo (Nicholas), SZE commented on HDFS-512:
---------------------------------------------

We have a concern that whether compareTo(..) has to be consistent with equal(..).  The answer is "strongly recommended but not required".  See [the Comparable API|http://java.sun.com/javase/6/docs/api/java/lang/Comparable.html].

bq. It is strongly recommended (though not required) that natural orderings be consistent with equals. ...

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


[jira] Commented: (HDFS-512) Set block id as the key to Block

Posted by "Hairong Kuang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-512?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12739212#action_12739212 ] 

Hairong Kuang commented on HDFS-512:
------------------------------------

> Why does ReplicaInfo need genStamp field. Don't we always have it in Block? If we do could you please add a comment clarifying what this field actually is.
Now the key is block id so the returned entry from the map may have a different generation stamp but there is no efficient way to get the key in the map so I add the generation stamp to the value field.

> 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: 0.21.0
>            Reporter: Hairong Kuang
>            Assignee: Hairong Kuang
>             Fix For: 0.21.0
>
>         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.


[jira] Commented: (HDFS-512) Set block id as the key to Block

Posted by "Tsz Wo (Nicholas), SZE (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-512?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12739734#action_12739734 ] 

Tsz Wo (Nicholas), SZE commented on HDFS-512:
---------------------------------------------

> We cannot have semantically different implementations of compareTo() and equals() methods. ...
We indeed could have two implementations of compareTo() since we may pass a Comparator object.  See [this TreeMap constructor|http://java.sun.com/javase/6/docs/api/java/util/TreeMap.html#TreeMap%28java.util.Comparator%29 API].

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


[jira] Commented: (HDFS-512) Set block id as the key to Block

Posted by "Raghu Angadi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-512?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12739264#action_12739264 ] 

Raghu Angadi commented on HDFS-512:
-----------------------------------

I faced this problem before : you can't easily get actual block from the block info in DN. This is probably a good time to add Block to ReplicaInfo. I think it makes sense and we don't need to add genStamp and genstamp interface there.. also we don't have to keep genStamp in Block and in ReplicaInfo in-sync.

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


[jira] Commented: (HDFS-512) Set block id as the key to Block

Posted by "Hairong Kuang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-512?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12767427#action_12767427 ] 

Hairong Kuang commented on HDFS-512:
------------------------------------

FSNamesystem.java has code that removes a blockinfo entry from the blocksMap, changes its generation stamp, and adds it back, for example, in updatePipeline and commitBlockSynchronization. Now that the generation stamp is not the part of the key, those code are not necessary.

> 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: 0.21.0
>            Reporter: Hairong Kuang
>            Assignee: Konstantin Shvachko
>             Fix For: 0.21.0
>
>         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.


[jira] Commented: (HDFS-512) Set block id as the key to Block

Posted by "Hairong Kuang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-512?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12737604#action_12737604 ] 

Hairong Kuang commented on HDFS-512:
------------------------------------

> Block is an existing base class and it is there for a very long time. We cannot simply view it in one way yesterday and view it in another way today.
I agree that Block is a long existing base class. But I disagree that we could not do any change to it. Adding generation stamp as a part of its key was introduced by the append project. As I think more on the new append design, I feel that this was a design flaw and has caused many problems that we could not handle multiple generation stamps. That's why I want to make the proposed change.

As I said in the description of this jira, this change is based on the following facts: (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. 

So in all the maps that you mentioned, there should be only one entry of a block per block id. In either NN or DN, there is only one entry of blockInfo or replicaInfo per block. I do not think changing the key of the Block should cause any problem to all these data structures in dfs. If there are two generations of a block in those data structures, this is an error. Whether the key contains generation stamp or not, dfs should handle this error.

I agree this may break some external applications. We could put this change in the release note. 

> 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: 0.21.0
>            Reporter: Hairong Kuang
>            Assignee: Hairong Kuang
>             Fix For: 0.21.0
>
>         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.


[jira] Commented: (HDFS-512) Set block id as the key to Block

Posted by "Konstantin Shvachko (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-512?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12739748#action_12739748 ] 

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

You are not proposing doing it or are you?

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


[jira] Commented: (HDFS-512) Set block id as the key to Block

Posted by "Konstantin Shvachko (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-512?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12768990#action_12768990 ] 

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

I ran tests for HDFS and MapReduce, inculding contrib tests for both projects. Everything worked fine with the new keys. Also talked to Devaraj, who could not find a reason why MR would care about blocks' generation stamps.

> 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: 0.21.0
>            Reporter: Hairong Kuang
>            Assignee: Konstantin Shvachko
>             Fix For: 0.21.0
>
>         Attachments: blockIdAsKey.patch, 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.


[jira] Updated: (HDFS-512) Set block id as the key to Block

Posted by "Konstantin Shvachko (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HDFS-512?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Konstantin Shvachko updated HDFS-512:
-------------------------------------

    Status: Open  (was: Patch Available)

> 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: 0.21.0
>            Reporter: Hairong Kuang
>            Assignee: Konstantin Shvachko
>             Fix For: 0.21.0
>
>         Attachments: blockIdAsKey.patch, 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.


[jira] Updated: (HDFS-512) Set block id as the key to Block

Posted by "Hairong Kuang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HDFS-512?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hairong Kuang updated HDFS-512:
-------------------------------

    Affects Version/s:     (was: 0.21.0)
                       Append Branch
        Fix Version/s:     (was: 0.21.0)
                       Append Branch
         Hadoop Flags: [Incompatible change]

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


[jira] Updated: (HDFS-512) Set block id as the key to Block

Posted by "Konstantin Shvachko (JIRA)" <ji...@apache.org>.
     [ 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.


[jira] Commented: (HDFS-512) Set block id as the key to Block

Posted by "Tsz Wo (Nicholas), SZE (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-512?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12739760#action_12739760 ] 

Tsz Wo (Nicholas), SZE commented on HDFS-512:
---------------------------------------------

> .. What do you want to use two different comparators for? 
We may keep current Block.compareTo(..) and Block.equals(..) implementations (i.e. the use id and gs) and then define a new Comparator<Block> for comparing only id.

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


[jira] Commented: (HDFS-512) Set block id as the key to Block

Posted by "Tsz Wo (Nicholas), SZE (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-512?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12737338#action_12737338 ] 

Tsz Wo (Nicholas), SZE commented on HDFS-512:
---------------------------------------------

Changing the key of the maps from block id and generation stamp to only block id sounds a good idea.  However, changing the Block.equal(..) method may not be correct.  Conceptually, block A is not equal to block B, given that they have the same id but distinct generation stamps.

> 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: 0.21.0
>            Reporter: Hairong Kuang
>            Assignee: Hairong Kuang
>             Fix For: 0.21.0
>
>         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.


[jira] Commented: (HDFS-512) Set block id as the key to Block

Posted by "Konstantin Shvachko (JIRA)" <ji...@apache.org>.
    [ 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.


[jira] Commented: (HDFS-512) Set block id as the key to Block

Posted by "Hairong Kuang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-512?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12739620#action_12739620 ] 

Hairong Kuang commented on HDFS-512:
------------------------------------

> This is probably a good time to add Block to ReplicaInfo. 
I already redefined ReplicaInfo in HDFS-509 where ReplicaInfo extends Block. This patch provides only a temporary fix if HDFS-509 gets committed later.

> If we follow Raghu's suggestion, can we continue using the genstamp as part of the Block key?
In both NN and DN, blocksMap and replicasMap do not need gen stamp as part of the Block key. DN can provision read if it has a replica with a gen stamp equal to or newer than the one in the request. With the new design, if DN receives a write request with a recovery flag, it can satisfy the request if it has a replica with a gen stamp equal to or newer than the one in the write request.

The key question is that does HDFS have any maps or sets that need to contain two instances of Block with the same block id but different gen stamps. If the answer is no, we can safely remove the gen stamp as part of the Block key.

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


[jira] Commented: (HDFS-512) Set block id as the key to Block

Posted by "Hairong Kuang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-512?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12769309#action_12769309 ] 

Hairong Kuang commented on HDFS-512:
------------------------------------

+1. The patch looks good to me.

> 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: 0.21.0
>            Reporter: Hairong Kuang
>            Assignee: Konstantin Shvachko
>             Fix For: 0.21.0
>
>         Attachments: blockIdAsKey.patch, 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.