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 0B4742080 for ; Thu, 21 Apr 2011 21:55:41 +0000 (UTC) Received: (qmail 53116 invoked by uid 500); 21 Apr 2011 21:55:40 -0000 Delivered-To: apmail-hadoop-hdfs-commits-archive@hadoop.apache.org Received: (qmail 53090 invoked by uid 500); 21 Apr 2011 21:55:40 -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 53082 invoked by uid 99); 21 Apr 2011 21:55:40 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Apr 2011 21:55:40 +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; Thu, 21 Apr 2011 21:55:39 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id AAA272388A36; Thu, 21 Apr 2011 21:55:19 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1095827 - in /hadoop/hdfs/trunk: CHANGES.txt src/test/hdfs/org/apache/hadoop/hdfs/DFSTestUtil.java Date: Thu, 21 Apr 2011 21:55:19 -0000 To: hdfs-commits@hadoop.apache.org From: eli@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110421215519.AAA272388A36@eris.apache.org> Author: eli Date: Thu Apr 21 21:55:19 2011 New Revision: 1095827 URL: http://svn.apache.org/viewvc?rev=1095827&view=rev Log: HDFS-1854. make failure message more useful in DFSTestUtil.waitReplication(). Contributed by Matt Foley Modified: hadoop/hdfs/trunk/CHANGES.txt hadoop/hdfs/trunk/src/test/hdfs/org/apache/hadoop/hdfs/DFSTestUtil.java Modified: hadoop/hdfs/trunk/CHANGES.txt URL: http://svn.apache.org/viewvc/hadoop/hdfs/trunk/CHANGES.txt?rev=1095827&r1=1095826&r2=1095827&view=diff ============================================================================== --- hadoop/hdfs/trunk/CHANGES.txt (original) +++ hadoop/hdfs/trunk/CHANGES.txt Thu Apr 21 21:55:19 2011 @@ -127,6 +127,9 @@ Trunk (unreleased changes) being written are closed for a grace period, and start a new thread when new files are opened for write. (szetszwo) + HDFS-1854. make failure message more useful in + DFSTestUtil.waitReplication(). (Matt Foley via eli) + OPTIMIZATIONS HDFS-1458. Improve checkpoint performance by avoiding unnecessary image Modified: hadoop/hdfs/trunk/src/test/hdfs/org/apache/hadoop/hdfs/DFSTestUtil.java URL: http://svn.apache.org/viewvc/hadoop/hdfs/trunk/src/test/hdfs/org/apache/hadoop/hdfs/DFSTestUtil.java?rev=1095827&r1=1095826&r2=1095827&view=diff ============================================================================== --- hadoop/hdfs/trunk/src/test/hdfs/org/apache/hadoop/hdfs/DFSTestUtil.java (original) +++ hadoop/hdfs/trunk/src/test/hdfs/org/apache/hadoop/hdfs/DFSTestUtil.java Thu Apr 21 21:55:19 2011 @@ -241,10 +241,13 @@ public class DFSTestUtil { BlockLocation locs[] = fs.getFileBlockLocations( fs.getFileStatus(fileName), 0, Long.MAX_VALUE); for (int j = 0; j < locs.length; j++) { - String[] loc = locs[j].getHosts(); - if (loc.length != replFactor) { - System.out.println("File " + fileName + " has replication factor " + - loc.length); + String[] hostnames = locs[j].getNames(); + if (hostnames.length != replFactor) { + String hostNameList = ""; + for (String h : hostnames) hostNameList += h + " "; + System.out.println("Block " + j + " of file " + fileName + + " has replication factor " + hostnames.length + "; locations " + + hostNameList); good = false; try { System.out.println("Waiting for replication factor to drain"); @@ -253,6 +256,10 @@ public class DFSTestUtil { break; } } + if (good) { + System.out.println("All blocks of file " + fileName + + " verified to have replication factor " + replFactor); + } } while(!good); }