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).
This commit is contained in:
parent
f4a39043e2
commit
1633d9d61d
|
@ -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 {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue