diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestWALMonotonicallyIncreasingSeqId.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestWALMonotonicallyIncreasingSeqId.java
index fabd07554eb..b5378909b37 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestWALMonotonicallyIncreasingSeqId.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestWALMonotonicallyIncreasingSeqId.java
@@ -18,93 +18,116 @@
*/
package org.apache.hadoop.hbase.regionserver;
+import static org.junit.Assert.fail;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.concurrent.CountDownLatch;
+
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
-import org.apache.hadoop.hbase.*;
-import org.apache.hadoop.hbase.client.*;
-import org.apache.hadoop.hbase.regionserver.wal.FSHLog;
-import org.apache.hadoop.hbase.wal.WALEdit;
+import org.apache.hadoop.hbase.HBaseTestingUtility;
+import org.apache.hadoop.hbase.HConstants;
+import org.apache.hadoop.hbase.TableName;
+import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder;
+import org.apache.hadoop.hbase.client.Increment;
+import org.apache.hadoop.hbase.client.Mutation;
+import org.apache.hadoop.hbase.client.Put;
+import org.apache.hadoop.hbase.client.RegionInfo;
+import org.apache.hadoop.hbase.client.RegionInfoBuilder;
+import org.apache.hadoop.hbase.client.TableDescriptor;
+import org.apache.hadoop.hbase.client.TableDescriptorBuilder;
+import org.apache.hadoop.hbase.regionserver.wal.AbstractFSWAL;
import org.apache.hadoop.hbase.testclassification.RegionServerTests;
import org.apache.hadoop.hbase.testclassification.SmallTests;
import org.apache.hadoop.hbase.util.Bytes;
import org.apache.hadoop.hbase.util.FSUtils;
import org.apache.hadoop.hbase.wal.WAL;
+import org.apache.hadoop.hbase.wal.WALEdit;
import org.apache.hadoop.hbase.wal.WALFactory;
-import org.junit.Assert;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.rules.TestName;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.CountDownLatch;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameter;
+import org.junit.runners.Parameterized.Parameters;
/**
- * Test for HBASE-17471
- * MVCCPreAssign is added by HBASE-16698, but pre-assign mvcc is only used in put/delete
- * path. Other write paths like increment/append still assign mvcc in ringbuffer's consumer
- * thread. If put and increment are used parallel. Then seqid in WAL may not increase monotonically
- * Disorder in wals will lead to data loss.
- * This case use two thread to put and increment at the same time in a single region.
- * Then check the seqid in WAL. If seqid is wal is not monotonically increasing, this case will fail
- *
+ * Test for HBASE-17471.
+ *
+ * MVCCPreAssign is added by HBASE-16698, but pre-assign mvcc is only used in put/delete path. Other
+ * write paths like increment/append still assign mvcc in ringbuffer's consumer thread. If put and
+ * increment are used parallel. Then seqid in WAL may not increase monotonically Disorder in wals
+ * will lead to data loss.
+ *
+ * This case use two thread to put and increment at the same time in a single region. Then check the
+ * seqid in WAL. If seqid is wal is not monotonically increasing, this case will fail
*/
-@Category({RegionServerTests.class, SmallTests.class})
+@RunWith(Parameterized.class)
+@Category({ RegionServerTests.class, SmallTests.class })
public class TestWALMonotonicallyIncreasingSeqId {
- final Log LOG = LogFactory.getLog(getClass());
+ private final Log LOG = LogFactory.getLog(getClass());
private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
private static Path testDir = TEST_UTIL.getDataTestDir("TestWALMonotonicallyIncreasingSeqId");
private WALFactory wals;
private FileSystem fileSystem;
private Configuration walConf;
+ private HRegion region;
- public static final String KEY_SEED = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
-
- private static final int KEY_SEED_LEN = KEY_SEED.length();
-
- private static final char[] KEY_SEED_CHARS = KEY_SEED.toCharArray();
+ @Parameter
+ public String walProvider;
@Rule
public TestName name = new TestName();
- private HTableDescriptor getTableDesc(TableName tableName, byte[]... families) {
- HTableDescriptor htd = new HTableDescriptor(tableName);
- for (byte[] family : families) {
- HColumnDescriptor hcd = new HColumnDescriptor(family);
- // Set default to be three versions.
- hcd.setMaxVersions(Integer.MAX_VALUE);
- htd.addFamily(hcd);
- }
- return htd;
+ @Parameters(name = "{index}: wal={0}")
+ public static List