Return-Path: Delivered-To: apmail-hadoop-hdfs-issues-archive@minotaur.apache.org Received: (qmail 94851 invoked from network); 3 Aug 2009 20:51:31 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 3 Aug 2009 20:51:31 -0000 Received: (qmail 56946 invoked by uid 500); 3 Aug 2009 20:51:36 -0000 Delivered-To: apmail-hadoop-hdfs-issues-archive@hadoop.apache.org Received: (qmail 56897 invoked by uid 500); 3 Aug 2009 20:51:36 -0000 Mailing-List: contact hdfs-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hdfs-issues@hadoop.apache.org Delivered-To: mailing list hdfs-issues@hadoop.apache.org Received: (qmail 56887 invoked by uid 99); 3 Aug 2009 20:51:36 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Aug 2009 20:51:36 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Aug 2009 20:51:35 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id C78B8234C045 for ; Mon, 3 Aug 2009 13:51:14 -0700 (PDT) Message-ID: <1352624649.1249332674803.JavaMail.jira@brutus> Date: Mon, 3 Aug 2009 13:51:14 -0700 (PDT) From: "Tsz Wo (Nicholas), SZE (JIRA)" To: hdfs-issues@hadoop.apache.org Subject: [jira] Commented: (HDFS-512) Set block id as the key to Block In-Reply-To: <1668637435.1248887174854.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on 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.