Return-Path: Delivered-To: apmail-hadoop-core-dev-archive@www.apache.org Received: (qmail 8779 invoked from network); 6 May 2009 23:00:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 6 May 2009 23:00:56 -0000 Received: (qmail 57992 invoked by uid 500); 6 May 2009 23:00:55 -0000 Delivered-To: apmail-hadoop-core-dev-archive@hadoop.apache.org Received: (qmail 57943 invoked by uid 500); 6 May 2009 23:00:54 -0000 Mailing-List: contact core-dev-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: core-dev@hadoop.apache.org Delivered-To: mailing list core-dev@hadoop.apache.org Received: (qmail 57933 invoked by uid 99); 6 May 2009 23:00:54 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 May 2009 23:00:54 +0000 X-ASF-Spam-Status: No, hits=-1998.8 required=10.0 tests=ALL_TRUSTED,FS_REPLICA 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; Wed, 06 May 2009 23:00:52 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 5915B29A0014 for ; Wed, 6 May 2009 16:00:31 -0700 (PDT) Message-ID: <465975547.1241650831363.JavaMail.jira@brutus> Date: Wed, 6 May 2009 16:00:31 -0700 (PDT) From: "Raghu Angadi (JIRA)" To: core-dev@hadoop.apache.org Subject: [jira] Commented: (HADOOP-5015) Separate block/replica management code from FSNamesystem In-Reply-To: <1407551257.1231803719497.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/HADOOP-5015?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12706649#action_12706649 ] Raghu Angadi commented on HADOOP-5015: -------------------------------------- > To make code review simpler, I have also retained the structure of the code moved from FSNamesystem.java as it is in BlockManager.java. There are a lot of formatting changes the break existing patches HDFS : e.g. segment (Ideally it should have been a clean cut-n-paste) : {noformat} synchronized (neededReplications) { - out.println("Metasave: Blocks waiting for replication: " + - neededReplications.size()); + out.println("Metasave: Blocks waiting for replication: " + + neededReplications.size()); for (Block block : neededReplications) { - List containingNodes = - new ArrayList(); + List containingNodes = new ArrayList(); NumberReplicas numReplicas = new NumberReplicas(); // source node returned is not used chooseSourceDatanode(block, containingNodes, numReplicas); - int usableReplicas = numReplicas.liveReplicas() + - numReplicas.decommissionedReplicas(); + int usableReplicas = numReplicas.liveReplicas() + + numReplicas.decommissionedReplicas(); // l: == live:, d: == decommissioned c: == corrupt e: == excess - out.print(block + " (replicas:" + - " l: " + numReplicas.liveReplicas() + - " d: " + numReplicas.decommissionedReplicas() + - " c: " + numReplicas.corruptReplicas() + - " e: " + numReplicas.excessReplicas() + - ((usableReplicas > 0)? "" : " MISSING") + ")"); + out.print(block + " (replicas:" + " l: " + numReplicas.liveReplicas() + + " d: " + numReplicas.decommissionedReplicas() + " c: " + + numReplicas.corruptReplicas() + " e: " + + numReplicas.excessReplicas() + + ((usableReplicas > 0) ? "" : " MISSING") + ")"); - for (Iterator jt = blocksMap.nodeIterator(block); - jt.hasNext();) { + for (Iterator jt = blocksMap.nodeIterator(block); jt + .hasNext();) { DatanodeDescriptor node = jt.next(); out.print(" " + node + " : "); } out.println(""); {noformat} Without such changes, it would have been much simpler to port the patches (just by changing the file name in patch file. > Separate block/replica management code from FSNamesystem > -------------------------------------------------------- > > Key: HADOOP-5015 > URL: https://issues.apache.org/jira/browse/HADOOP-5015 > Project: Hadoop Core > Issue Type: Improvement > Components: dfs > Reporter: Hairong Kuang > Assignee: Suresh Srinivas > Fix For: 0.21.0 > > Attachments: blkmanager.patch, blkmanager.patch > > > Currently FSNamesystem contains a big amount of code that manages blocks and replicas. The code scatters in FSNamesystem and it is hard to read and maintain. It would be nice to move the code to a separate class called, for example, BlockManager. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.