You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by ra...@apache.org on 2018/02/26 16:36:45 UTC

hbase git commit: HBASE-20036 TestAvoidCellReferencesIntoShippedBlocks timed out (Ram)

Repository: hbase
Updated Branches:
  refs/heads/branch-2 0bf33c802 -> 372c68fca


HBASE-20036 TestAvoidCellReferencesIntoShippedBlocks timed out (Ram)


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/372c68fc
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/372c68fc
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/372c68fc

Branch: refs/heads/branch-2
Commit: 372c68fca28383d08128ce1c376492706b1d66f3
Parents: 0bf33c8
Author: Vasudevan <ra...@intel.com>
Authored: Mon Feb 26 22:05:12 2018 +0530
Committer: Vasudevan <ra...@intel.com>
Committed: Mon Feb 26 22:06:28 2018 +0530

----------------------------------------------------------------------
 ...estAvoidCellReferencesIntoShippedBlocks.java | 30 +++++++++++---------
 1 file changed, 17 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/372c68fc/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAvoidCellReferencesIntoShippedBlocks.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAvoidCellReferencesIntoShippedBlocks.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAvoidCellReferencesIntoShippedBlocks.java
index 0e12ad6..d22772a 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAvoidCellReferencesIntoShippedBlocks.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAvoidCellReferencesIntoShippedBlocks.java
@@ -400,23 +400,27 @@ public class TestAvoidCellReferencesIntoShippedBlocks {
               scanner = table.getScanner(s1);
               int count = Iterables.size(scanner);
               assertEquals("Count the rows", 2, count);
-              iterator = cache.iterator();
-              List<BlockCacheKey> newCacheList = new ArrayList<>();
-              while (iterator.hasNext()) {
-                CachedBlock next = iterator.next();
-                BlockCacheKey cacheKey = new BlockCacheKey(next.getFilename(), next.getOffset());
-                newCacheList.add(cacheKey);
-              }
               int newBlockRefCount = 0;
-              for (BlockCacheKey key : cacheList) {
-                if (newCacheList.contains(key)) {
-                  newBlockRefCount++;
+              List<BlockCacheKey> newCacheList = new ArrayList<>();
+              while (true) {
+                newBlockRefCount = 0;
+                newCacheList.clear();
+                iterator = cache.iterator();
+                while (iterator.hasNext()) {
+                  CachedBlock next = iterator.next();
+                  BlockCacheKey cacheKey = new BlockCacheKey(next.getFilename(), next.getOffset());
+                  newCacheList.add(cacheKey);
+                }
+                for (BlockCacheKey key : cacheList) {
+                  if (newCacheList.contains(key)) {
+                    newBlockRefCount++;
+                  }
+                }
+                if (newBlockRefCount == 6) {
+                  break;
                 }
               }
-
-              assertEquals("old blocks should still be found ", 6, newBlockRefCount);
               latch.countDown();
-
             } catch (IOException e) {
             }
           }