Return-Path: X-Original-To: apmail-hadoop-hdfs-commits-archive@minotaur.apache.org Delivered-To: apmail-hadoop-hdfs-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7EE94C692 for ; Tue, 15 May 2012 16:02:07 +0000 (UTC) Received: (qmail 46793 invoked by uid 500); 15 May 2012 16:02:07 -0000 Delivered-To: apmail-hadoop-hdfs-commits-archive@hadoop.apache.org Received: (qmail 46710 invoked by uid 500); 15 May 2012 16:02:06 -0000 Mailing-List: contact hdfs-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hdfs-dev@hadoop.apache.org Delivered-To: mailing list hdfs-commits@hadoop.apache.org Received: (qmail 46698 invoked by uid 99); 15 May 2012 16:02:06 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 May 2012 16:02:06 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 May 2012 16:02:05 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id D36F8238890B; Tue, 15 May 2012 16:01:44 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1338767 - in /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs: CHANGES.txt src/main/java/org/apache/hadoop/hdfs/server/balancer/Balancer.java Date: Tue, 15 May 2012 16:01:44 -0000 To: hdfs-commits@hadoop.apache.org From: eli@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120515160144.D36F8238890B@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: eli Date: Tue May 15 16:01:44 2012 New Revision: 1338767 URL: http://svn.apache.org/viewvc?rev=1338767&view=rev Log: HDFS-3417. Rename BalancerDatanode#getName to getDisplayName to be consistent with Datanode. Contributed by Eli Collins Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/balancer/Balancer.java Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt?rev=1338767&r1=1338766&r2=1338767&view=diff ============================================================================== --- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt (original) +++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt Tue May 15 16:01:44 2012 @@ -462,6 +462,9 @@ Release 2.0.0 - UNRELEASED HDFS-3335. check for edit log corruption at the end of the log (Colin Patrick McCabe via todd) + HDFS-3417. Rename BalancerDatanode#getName to getDisplayName to be + consistent with Datanode. (eli) + OPTIMIZATIONS HDFS-3024. Improve performance of stringification in addStoredBlock (todd) Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/balancer/Balancer.java URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/balancer/Balancer.java?rev=1338767&r1=1338766&r2=1338767&view=diff ============================================================================== --- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/balancer/Balancer.java (original) +++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/balancer/Balancer.java Tue May 15 16:01:44 2012 @@ -262,9 +262,9 @@ public class Balancer { if (LOG.isDebugEnabled()) { LOG.debug("Decided to move block "+ block.getBlockId() +" with a length of "+StringUtils.byteDesc(block.getNumBytes()) - + " bytes from " + source.getName() - + " to " + target.getName() - + " using proxy source " + proxySource.getName() ); + + " bytes from " + source.getDisplayName() + + " to " + target.getDisplayName() + + " using proxy source " + proxySource.getDisplayName() ); } return true; } @@ -317,15 +317,15 @@ public class Balancer { receiveResponse(in); bytesMoved.inc(block.getNumBytes()); LOG.info( "Moving block " + block.getBlock().getBlockId() + - " from "+ source.getName() + " to " + - target.getName() + " through " + - proxySource.getName() + + " from "+ source.getDisplayName() + " to " + + target.getDisplayName() + " through " + + proxySource.getDisplayName() + " is succeeded." ); } catch (IOException e) { LOG.warn("Error moving block "+block.getBlockId()+ - " from " + source.getName() + " to " + - target.getName() + " through " + - proxySource.getName() + + " from " + source.getDisplayName() + " to " + + target.getDisplayName() + " through " + + proxySource.getDisplayName() + ": "+e.getMessage()); } finally { IOUtils.closeStream(out); @@ -378,7 +378,8 @@ public class Balancer { public void run() { if (LOG.isDebugEnabled()) { LOG.debug("Starting moving "+ block.getBlockId() + - " from " + proxySource.getName() + " to " + target.getName()); + " from " + proxySource.getDisplayName() + " to " + + target.getDisplayName()); } dispatch(); } @@ -475,7 +476,7 @@ public class Balancer { @Override public String toString() { - return getClass().getSimpleName() + "[" + getName() + return getClass().getSimpleName() + "[" + datanode + ", utilization=" + utilization + "]"; } @@ -507,8 +508,8 @@ public class Balancer { } /** Get the name of the datanode */ - protected String getName() { - return datanode.getName(); + protected String getDisplayName() { + return datanode.toString(); } /* Get the storage id of the datanode */ @@ -831,7 +832,7 @@ public class Balancer { this.aboveAvgUtilizedDatanodes.add((Source)datanodeS); } else { assert(isOverUtilized(datanodeS)) : - datanodeS.getName()+ "is not an overUtilized node"; + datanodeS.getDisplayName()+ "is not an overUtilized node"; this.overUtilizedDatanodes.add((Source)datanodeS); overLoadedBytes += (long)((datanodeS.utilization-avg -threshold)*datanodeS.datanode.getCapacity()/100.0); @@ -842,7 +843,7 @@ public class Balancer { this.belowAvgUtilizedDatanodes.add(datanodeS); } else { assert isUnderUtilized(datanodeS) : "isUnderUtilized(" - + datanodeS.getName() + ")=" + isUnderUtilized(datanodeS) + + datanodeS.getDisplayName() + ")=" + isUnderUtilized(datanodeS) + ", utilization=" + datanodeS.utilization; this.underUtilizedDatanodes.add(datanodeS); underLoadedBytes += (long)((avg-threshold-