diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMultiColumnScanner.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMultiColumnScanner.java
index f89098a8f3b..5a491723bd3 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMultiColumnScanner.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMultiColumnScanner.java
@@ -34,9 +34,6 @@ import java.util.Random;
import java.util.Set;
import java.util.TreeSet;
-import org.apache.commons.lang.ArrayUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.hbase.Cell;
import org.apache.hadoop.hbase.CellComparator;
import org.apache.hadoop.hbase.CellUtil;
@@ -49,22 +46,28 @@ import org.apache.hadoop.hbase.client.Put;
import org.apache.hadoop.hbase.client.Scan;
import org.apache.hadoop.hbase.io.compress.Compression;
import org.apache.hadoop.hbase.io.encoding.DataBlockEncoding;
-import org.apache.hadoop.hbase.testclassification.MediumTests;
import org.apache.hadoop.hbase.util.Bytes;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
-import org.junit.runners.Parameterized.Parameters;
+import org.junit.runners.Parameterized.Parameter;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
- * Tests optimized scanning of multiple columns.
+ * Tests optimized scanning of multiple columns.
+ * We separated the big test into several sub-class UT, because When in ROWCOL bloom type, we will
+ * test the row-col bloom filter frequently for saving HDFS seek once we switch from one column to
+ * another in our UT. It's cpu time consuming (~45s for each case), so moved the ROWCOL case into a
+ * separated LargeTests to avoid timeout failure.
+ *
+ * To be clear: In TestMultiColumnScanner, we will flush 10 (NUM_FLUSHES=10) HFiles here, and the
+ * table will put ~1000 cells (rows=20, ts=6, qualifiers=8, total=20*6*8 ~ 1000) . Each full table
+ * scan will check the ROWCOL bloom filter 20 (rows)* 8 (column) * 10 (hfiles)= 1600 times, beside
+ * it will scan the full table 6*2^8=1536 times, so finally will have 1600*1536=2457600 bloom filter
+ * testing. (See HBASE-21520)
*/
-@RunWith(Parameterized.class)
-@Category(MediumTests.class)
-public class TestMultiColumnScanner {
+public abstract class TestMultiColumnScanner {
- private static final Log LOG = LogFactory.getLog(TestMultiColumnScanner.class);
+ private static final Logger LOG = LoggerFactory.getLogger(TestMultiColumnScanner.class);
private static final String TABLE_NAME =
TestMultiColumnScanner.class.getSimpleName();
@@ -97,20 +100,19 @@ public class TestMultiColumnScanner {
/** The probability that a column is skipped in a store file. */
private static final double COLUMN_SKIP_IN_STORE_FILE_PROB = 0.7;
- /** The probability of skipping a column in a single row */
- private static final double COLUMN_SKIP_IN_ROW_PROB = 0.1;
-
- /** The probability of skipping a column everywhere */
- private static final double COLUMN_SKIP_EVERYWHERE_PROB = 0.1;
-
/** The probability to delete a row/column pair */
private static final double DELETE_PROBABILITY = 0.02;
private final static HBaseTestingUtility TEST_UTIL = HBaseTestingUtility.createLocalHTU();
- private final Compression.Algorithm comprAlgo;
- private final BloomType bloomType;
- private final DataBlockEncoding dataBlockEncoding;
+ @Parameter(0)
+ public Compression.Algorithm comprAlgo;
+
+ @Parameter(1)
+ public BloomType bloomType;
+
+ @Parameter(2)
+ public DataBlockEncoding dataBlockEncoding;
// Some static sanity-checking.
static {
@@ -121,27 +123,17 @@ public class TestMultiColumnScanner {
assertTrue(TIMESTAMPS[i] < TIMESTAMPS[i + 1]);
}
- @Parameters
- public static final Collection