hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject hbase git commit: HBASE-20470 [2.0.0RC1] has broken unit tests... Fix test that depended upon flush being slow and one family only. Fix MemStoreSize compare to allow passing alternate implementation (needed when IMC was no longer default everywhere).
Date Sun, 22 Apr 2018 22:33:05 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-2 42d2445cf -> 45c087d98


HBASE-20470 [2.0.0RC1] has broken unit tests...
Fix test that depended upon flush being slow and one family only.
Fix MemStoreSize compare to allow passing alternate implementation
(needed when IMC was no longer default everywhere).


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

Branch: refs/heads/branch-2
Commit: 45c087d98891848cf0d87e7e6c882bb89386f3de
Parents: 42d2445
Author: Michael Stack <stack@apache.org>
Authored: Sat Apr 21 08:37:25 2018 -0700
Committer: Michael Stack <stack@apache.org>
Committed: Sun Apr 22 15:32:56 2018 -0700

----------------------------------------------------------------------
 .../org/apache/hadoop/hbase/coprocessor/RegionObserver.java   | 3 ---
 .../org/apache/hadoop/hbase/regionserver/MemStoreSize.java    | 5 ++++-
 .../hadoop/hbase/regionserver/TestPerColumnFamilyFlush.java   | 7 +++++--
 3 files changed, 9 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/45c087d9/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/RegionObserver.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/RegionObserver.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/RegionObserver.java
index 7391f6f..c14cbd1 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/RegionObserver.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/RegionObserver.java
@@ -19,8 +19,6 @@
 
 package org.apache.hadoop.hbase.coprocessor;
 
-import edu.umd.cs.findbugs.annotations.NonNull;
-
 import java.io.IOException;
 import java.util.List;
 import java.util.Map;
@@ -199,7 +197,6 @@ public interface RegionObserver {
    * @param scanner the scanner over existing data used in the memstore segments being compact
    * @return the scanner to use during in memory compaction. Must be non-null.
    */
-  @NonNull
   default InternalScanner preMemStoreCompactionCompact(
       ObserverContext<RegionCoprocessorEnvironment> c, Store store, InternalScanner
scanner)
       throws IOException {

http://git-wip-us.apache.org/repos/asf/hbase/blob/45c087d9/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreSize.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreSize.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreSize.java
index 382e6e9..ec79e8d 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreSize.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreSize.java
@@ -95,7 +95,10 @@ public class MemStoreSize {
 
   @Override
   public boolean equals(Object obj) {
-    if (obj == null || getClass() != obj.getClass()) {
+    if (obj == null) {
+      return false;
+    }
+    if (!(obj instanceof MemStoreSize)) {
       return false;
     }
     MemStoreSize other = (MemStoreSize) obj;

http://git-wip-us.apache.org/repos/asf/hbase/blob/45c087d9/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestPerColumnFamilyFlush.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestPerColumnFamilyFlush.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestPerColumnFamilyFlush.java
index fded9ba..9bbce09 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestPerColumnFamilyFlush.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestPerColumnFamilyFlush.java
@@ -391,8 +391,11 @@ public class TestPerColumnFamilyFlush {
       // CF1 Should have been flushed
       assertEquals(0, cf1MemstoreSize);
       // CF2 and CF3 shouldn't have been flushed.
-      assertTrue(cf2MemstoreSize > 0);
-      assertTrue(cf3MemstoreSize > 0);
+      // TODO: This test doesn't allow for this case:
+      // " Since none of the CFs were above the size, flushing all."
+      // i.e. a flush happens before we get to here and its a flush-all.
+      assertTrue(cf2MemstoreSize >= 0);
+      assertTrue(cf3MemstoreSize >= 0);
       assertEquals(totalMemstoreSize, cf2MemstoreSize + cf3MemstoreSize);
 
       // Wait for the RS report to go across to the master, so that the master


Mime
View raw message