HBASE-16068 Procedure v2 - use consts for conf properties in tests
This commit is contained in:
parent
7056b66d37
commit
339cb81747
|
@ -71,36 +71,36 @@ public class WALProcedureStore extends ProcedureStoreBase {
|
|||
void recoverFileLease(FileSystem fs, Path path) throws IOException;
|
||||
}
|
||||
|
||||
private static final String MAX_RETRIES_BEFORE_ROLL_CONF_KEY =
|
||||
public static final String MAX_RETRIES_BEFORE_ROLL_CONF_KEY =
|
||||
"hbase.procedure.store.wal.max.retries.before.roll";
|
||||
private static final int DEFAULT_MAX_RETRIES_BEFORE_ROLL = 3;
|
||||
|
||||
private static final String WAIT_BEFORE_ROLL_CONF_KEY =
|
||||
public static final String WAIT_BEFORE_ROLL_CONF_KEY =
|
||||
"hbase.procedure.store.wal.wait.before.roll";
|
||||
private static final int DEFAULT_WAIT_BEFORE_ROLL = 500;
|
||||
|
||||
private static final String ROLL_RETRIES_CONF_KEY =
|
||||
public static final String ROLL_RETRIES_CONF_KEY =
|
||||
"hbase.procedure.store.wal.max.roll.retries";
|
||||
private static final int DEFAULT_ROLL_RETRIES = 3;
|
||||
|
||||
private static final String MAX_SYNC_FAILURE_ROLL_CONF_KEY =
|
||||
public static final String MAX_SYNC_FAILURE_ROLL_CONF_KEY =
|
||||
"hbase.procedure.store.wal.sync.failure.roll.max";
|
||||
private static final int DEFAULT_MAX_SYNC_FAILURE_ROLL = 3;
|
||||
|
||||
private static final String PERIODIC_ROLL_CONF_KEY =
|
||||
public static final String PERIODIC_ROLL_CONF_KEY =
|
||||
"hbase.procedure.store.wal.periodic.roll.msec";
|
||||
private static final int DEFAULT_PERIODIC_ROLL = 60 * 60 * 1000; // 1h
|
||||
|
||||
private static final String SYNC_WAIT_MSEC_CONF_KEY = "hbase.procedure.store.wal.sync.wait.msec";
|
||||
public static final String SYNC_WAIT_MSEC_CONF_KEY = "hbase.procedure.store.wal.sync.wait.msec";
|
||||
private static final int DEFAULT_SYNC_WAIT_MSEC = 100;
|
||||
|
||||
private static final String USE_HSYNC_CONF_KEY = "hbase.procedure.store.wal.use.hsync";
|
||||
public static final String USE_HSYNC_CONF_KEY = "hbase.procedure.store.wal.use.hsync";
|
||||
private static final boolean DEFAULT_USE_HSYNC = true;
|
||||
|
||||
private static final String ROLL_THRESHOLD_CONF_KEY = "hbase.procedure.store.wal.roll.threshold";
|
||||
public static final String ROLL_THRESHOLD_CONF_KEY = "hbase.procedure.store.wal.roll.threshold";
|
||||
private static final long DEFAULT_ROLL_THRESHOLD = 32 * 1024 * 1024; // 32M
|
||||
|
||||
private static final String STORE_WAL_SYNC_STATS_COUNT =
|
||||
public static final String STORE_WAL_SYNC_STATS_COUNT =
|
||||
"hbase.procedure.store.wal.sync.stats.count";
|
||||
private static final int DEFAULT_SYNC_STATS_COUNT = 10;
|
||||
|
||||
|
|
|
@ -31,6 +31,7 @@ import org.apache.hadoop.fs.Path;
|
|||
import org.apache.hadoop.hbase.HBaseCommonTestingUtility;
|
||||
import org.apache.hadoop.hbase.io.util.StreamUtils;
|
||||
import org.apache.hadoop.hbase.procedure2.store.ProcedureStore;
|
||||
import org.apache.hadoop.hbase.procedure2.store.wal.WALProcedureStore;
|
||||
import org.apache.hadoop.hbase.testclassification.LargeTests;
|
||||
|
||||
import org.junit.After;
|
||||
|
@ -60,7 +61,7 @@ public class TestProcedureReplayOrder {
|
|||
@Before
|
||||
public void setUp() throws IOException {
|
||||
htu = new HBaseCommonTestingUtility();
|
||||
htu.getConfiguration().setInt("hbase.procedure.store.wal.sync.wait.msec", 25);
|
||||
htu.getConfiguration().setInt(WALProcedureStore.SYNC_WAIT_MSEC_CONF_KEY, 25);
|
||||
|
||||
testDir = htu.getDataTestDir();
|
||||
fs = testDir.getFileSystem(htu.getConfiguration());
|
||||
|
|
|
@ -62,9 +62,9 @@ public class TestStressWALProcedureStore {
|
|||
private Path logDir;
|
||||
|
||||
private void setupConfiguration(Configuration conf) {
|
||||
conf.setBoolean("hbase.procedure.store.wal.use.hsync", false);
|
||||
conf.setInt("hbase.procedure.store.wal.periodic.roll.msec", 5000);
|
||||
conf.setInt("hbase.procedure.store.wal.roll.threshold", 128 * 1024);
|
||||
conf.setBoolean(WALProcedureStore.USE_HSYNC_CONF_KEY, false);
|
||||
conf.setInt(WALProcedureStore.PERIODIC_ROLL_CONF_KEY, 5000);
|
||||
conf.setInt(WALProcedureStore.ROLL_THRESHOLD_CONF_KEY, 128 * 1024);
|
||||
}
|
||||
|
||||
@Before
|
||||
|
|
|
@ -34,6 +34,7 @@ import org.apache.hadoop.hbase.master.HMaster;
|
|||
import org.apache.hadoop.hbase.master.AssignmentManager;
|
||||
import org.apache.hadoop.hbase.procedure2.ProcedureExecutor;
|
||||
import org.apache.hadoop.hbase.procedure2.ProcedureTestingUtility;
|
||||
import org.apache.hadoop.hbase.procedure2.store.wal.WALProcedureStore;
|
||||
import org.apache.hadoop.hbase.regionserver.HRegionServer;
|
||||
import org.apache.hadoop.hbase.testclassification.MasterTests;
|
||||
import org.apache.hadoop.hbase.testclassification.MediumTests;
|
||||
|
@ -58,7 +59,7 @@ public class TestMasterProcedureEvents {
|
|||
|
||||
private static void setupConf(Configuration conf) {
|
||||
conf.setInt(MasterProcedureConstants.MASTER_PROCEDURE_THREADS, 8);
|
||||
conf.setBoolean("hbase.procedure.store.wal.use.hsync", false);
|
||||
conf.setBoolean(WALProcedureStore.USE_HSYNC_CONF_KEY, false);
|
||||
}
|
||||
|
||||
@BeforeClass
|
||||
|
|
|
@ -88,9 +88,9 @@ public class TestWALProcedureStoreOnHDFS {
|
|||
conf.setInt("dfs.namenode.replication.min", 3);
|
||||
|
||||
// increase the value for slow test-env
|
||||
conf.setInt("hbase.procedure.store.wal.wait.before.roll", 1000);
|
||||
conf.setInt("hbase.procedure.store.wal.max.roll.retries", 10);
|
||||
conf.setInt("hbase.procedure.store.wal.sync.failure.roll.max", 10);
|
||||
conf.setInt(WALProcedureStore.WAIT_BEFORE_ROLL_CONF_KEY, 1000);
|
||||
conf.setInt(WALProcedureStore.ROLL_RETRIES_CONF_KEY, 10);
|
||||
conf.setInt(WALProcedureStore.MAX_SYNC_FAILURE_ROLL_CONF_KEY, 10);
|
||||
}
|
||||
|
||||
public void setup() throws Exception {
|
||||
|
|
Loading…
Reference in New Issue