hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject svn commit: r1163476 - in /hbase/trunk: CHANGES.txt src/test/java/org/apache/hadoop/hbase/io/hfile/CacheTestUtils.java
Date Wed, 31 Aug 2011 03:05:05 GMT
Author: tedyu
Date: Wed Aug 31 03:05:05 2011
New Revision: 1163476

URL: http://svn.apache.org/viewvc?rev=1163476&view=rev
Log:
HBASE-4307  race condition in CacheTestUtils (Li Pi)

Modified:
    hbase/trunk/CHANGES.txt
    hbase/trunk/src/test/java/org/apache/hadoop/hbase/io/hfile/CacheTestUtils.java

Modified: hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/trunk/CHANGES.txt?rev=1163476&r1=1163475&r2=1163476&view=diff
==============================================================================
--- hbase/trunk/CHANGES.txt (original)
+++ hbase/trunk/CHANGES.txt Wed Aug 31 03:05:05 2011
@@ -227,6 +227,7 @@ Release 0.91.0 - Unreleased
    HBASE-4290  HLogSplitter doesn't mark its MonitoredTask as complete in
                non-distributed case (todd)
    HBASE-4303  HRegionInfo.toString has bad quoting (todd)
+   HBASE-4307  race condition in CacheTestUtils (Li Pi)
 
   IMPROVEMENTS
    HBASE-3290  Max Compaction Size (Nicolas Spiegelberg via Stack)  

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/io/hfile/CacheTestUtils.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/io/hfile/CacheTestUtils.java?rev=1163476&r1=1163475&r2=1163476&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/io/hfile/CacheTestUtils.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/io/hfile/CacheTestUtils.java Wed Aug
31 03:05:05 2011
@@ -56,7 +56,12 @@ public class CacheTestUtils {
         @Override
         public void doAnAction() throws Exception {
           if (!blocksToTest.isEmpty()) {
-            HFileBlockPair ourBlock = blocksToTest.remove();
+            HFileBlockPair ourBlock = blocksToTest.poll();
+            //if we run out of blocks to test, then we should stop the tests.
+            if(ourBlock == null){
+              ctx.stop();
+              return;
+            }
             toBeTested.cacheBlock(ourBlock.blockName, ourBlock.block);
             Cacheable retrievedBlock = toBeTested.getBlock(ourBlock.blockName,
                 false);



Mime
View raw message