Return-Path: X-Original-To: apmail-hadoop-hdfs-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-hdfs-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8C026988A for ; Mon, 21 May 2012 04:12:44 +0000 (UTC) Received: (qmail 89109 invoked by uid 500); 21 May 2012 04:12:44 -0000 Delivered-To: apmail-hadoop-hdfs-issues-archive@hadoop.apache.org Received: (qmail 88868 invoked by uid 500); 21 May 2012 04:12:43 -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 88822 invoked by uid 99); 21 May 2012 04:12:41 -0000 Received: from issues-vm.apache.org (HELO issues-vm) (140.211.11.160) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 May 2012 04:12:41 +0000 Received: from isssues-vm.apache.org (localhost [127.0.0.1]) by issues-vm (Postfix) with ESMTP id 577F414280B for ; Mon, 21 May 2012 04:12:41 +0000 (UTC) Date: Mon, 21 May 2012 04:12:41 +0000 (UTC) From: "Todd Lipcon (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: <725543014.2350.1337573561360.JavaMail.jiratomcat@issues-vm> In-Reply-To: <231256565.2238.1337570921674.JavaMail.jiratomcat@issues-vm> Subject: [jira] [Commented] (HDFS-3448) CLONE - Why open method in class DFSClient would compare old LocatedBlocks and new LocatedBlocks? MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HDFS-3448?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13279950#comment-13279950 ] Todd Lipcon commented on HDFS-3448: ----------------------------------- Hi Li. {{Block.equals()}} already does what you're suggesting - it compares based on block ID alone - if the genstamp changes, the block is still considered equal. > CLONE - Why open method in class DFSClient would compare old LocatedBlocks and new LocatedBlocks? > ------------------------------------------------------------------------------------------------- > > Key: HDFS-3448 > URL: https://issues.apache.org/jira/browse/HDFS-3448 > Project: Hadoop HDFS > Issue Type: Wish > Reporter: Li Junjun > Assignee: Todd Lipcon > Original Estimate: 168h > Remaining Estimate: 168h > > I think there are two situations. > 1,the file has been swapped with another file,we check the blockId,that's correct we throw Exceptions! > 2,but if the file has not been swapped but has been appended ,we should just check the blockId ,and should not care about the block's stamp , because in fact we got the right and updated block list , cause file in hdfs can't be truncate . > so how about we do it like this ? > if ( oldIter.next().getBlock().getBlockId() != newIter.next().getBlock().getBlockId() ) { throw new IOException("Blocklist for " + src + " has changed!"); } > after all , between two calls to openInfo() the file can be swapped and then appending,so we should not ignore the under construction file. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira