Return-Path: Delivered-To: apmail-hbase-commits-archive@www.apache.org Received: (qmail 11117 invoked from network); 30 Jul 2010 00:48:46 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 30 Jul 2010 00:48:46 -0000 Received: (qmail 77155 invoked by uid 500); 30 Jul 2010 00:48:46 -0000 Delivered-To: apmail-hbase-commits-archive@hbase.apache.org Received: (qmail 77085 invoked by uid 500); 30 Jul 2010 00:48:45 -0000 Mailing-List: contact commits-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hbase.apache.org Delivered-To: mailing list commits@hbase.apache.org Received: (qmail 77077 invoked by uid 99); 30 Jul 2010 00:48:45 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Jul 2010 00:48:45 +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.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Jul 2010 00:48:38 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 739D12388900; Fri, 30 Jul 2010 00:47:21 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r980621 - in /hbase/trunk: CHANGES.txt src/test/java/org/apache/hadoop/hbase/mapreduce/TestHFileOutputFormat.java Date: Fri, 30 Jul 2010 00:47:21 -0000 To: commits@hbase.apache.org From: todd@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100730004721.739D12388900@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: todd Date: Fri Jul 30 00:47:21 2010 New Revision: 980621 URL: http://svn.apache.org/viewvc?rev=980621&view=rev Log: HBASE-2884. TestHFileOutputFormat flaky when map tasks generate identical data Modified: hbase/trunk/CHANGES.txt hbase/trunk/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHFileOutputFormat.java Modified: hbase/trunk/CHANGES.txt URL: http://svn.apache.org/viewvc/hbase/trunk/CHANGES.txt?rev=980621&r1=980620&r2=980621&view=diff ============================================================================== --- hbase/trunk/CHANGES.txt (original) +++ hbase/trunk/CHANGES.txt Fri Jul 30 00:47:21 2010 @@ -458,6 +458,8 @@ Release 0.21.0 - Unreleased gets suspended on tty output (Alexey Kovyrin via Stack) HBASE-2852 Bloom filter NPE (pranav via jgray) HBASE-2820 hbck throws an error if HBase root dir isn't on the default FS + HBASE-2884 TestHFileOutputFormat flaky when map tasks generate identical + data IMPROVEMENTS HBASE-1760 Cleanup TODOs in HTable Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHFileOutputFormat.java URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHFileOutputFormat.java?rev=980621&r1=980620&r2=980621&view=diff ============================================================================== --- hbase/trunk/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHFileOutputFormat.java (original) +++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHFileOutputFormat.java Fri Jul 30 00:47:21 2010 @@ -106,10 +106,15 @@ public class TestHFileOutputFormat { byte keyBytes[] = new byte[keyLength]; byte valBytes[] = new byte[valLength]; - Random random = new Random(System.currentTimeMillis()); + int taskId = context.getTaskAttemptID().getTaskID().getId(); + assert taskId < Byte.MAX_VALUE : "Unit tests dont support > 127 tasks!"; + + Random random = new Random(); for (int i = 0; i < ROWSPERSPLIT; i++) { random.nextBytes(keyBytes); + // Ensure that unique tasks generate unique keys + keyBytes[keyLength - 1] = (byte)(taskId & 0xFF); random.nextBytes(valBytes); ImmutableBytesWritable key = new ImmutableBytesWritable(keyBytes);