hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mberto...@apache.org
Subject [1/4] hbase git commit: HBASE-16068 Procedure v2 - use consts for conf properties in tests
Date Thu, 23 Jun 2016 06:53:03 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1 7056b66d3 -> 339cb8174
  refs/heads/branch-1.2 15cab50c6 -> 7d33f824b
  refs/heads/branch-1.3 f2405b19c -> d500f6fd0
  refs/heads/master c1a559a66 -> d66316fd8


HBASE-16068 Procedure v2 - use consts for conf properties in tests


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

Branch: refs/heads/master
Commit: d66316fd80fbcdf8d978a22de50783d03d8860e8
Parents: c1a559a
Author: Matteo Bertozzi <matteo.bertozzi@cloudera.com>
Authored: Wed Jun 22 22:48:07 2016 -0700
Committer: Matteo Bertozzi <matteo.bertozzi@cloudera.com>
Committed: Wed Jun 22 22:48:07 2016 -0700

----------------------------------------------------------------------
 .../procedure2/store/wal/WALProcedureStore.java   | 18 +++++++++---------
 .../procedure2/TestProcedureReplayOrder.java      |  3 ++-
 .../store/wal/TestStressWALProcedureStore.java    |  6 +++---
 .../TestMasterFailoverWithProcedures.java         | 10 +++++-----
 .../procedure/TestMasterProcedureEvents.java      |  3 ++-
 .../procedure/TestWALProcedureStoreOnHDFS.java    |  6 +++---
 6 files changed, 24 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/d66316fd/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.java
----------------------------------------------------------------------
diff --git a/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.java
b/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.java
index c8f4946..560072f 100644
--- a/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.java
+++ b/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.java
@@ -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;
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/d66316fd/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureReplayOrder.java
----------------------------------------------------------------------
diff --git a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureReplayOrder.java
b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureReplayOrder.java
index a7f5d9f..f838c25 100644
--- a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureReplayOrder.java
+++ b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureReplayOrder.java
@@ -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.apache.hadoop.hbase.testclassification.MasterTests;
 
@@ -61,7 +62,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());

http://git-wip-us.apache.org/repos/asf/hbase/blob/d66316fd/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/store/wal/TestStressWALProcedureStore.java
----------------------------------------------------------------------
diff --git a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/store/wal/TestStressWALProcedureStore.java
b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/store/wal/TestStressWALProcedureStore.java
index 1c1af79..023354c 100644
--- a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/store/wal/TestStressWALProcedureStore.java
+++ b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/store/wal/TestStressWALProcedureStore.java
@@ -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

http://git-wip-us.apache.org/repos/asf/hbase/blob/d66316fd/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestMasterFailoverWithProcedures.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestMasterFailoverWithProcedures.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestMasterFailoverWithProcedures.java
index 25a3b36..4d347f2 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestMasterFailoverWithProcedures.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestMasterFailoverWithProcedures.java
@@ -74,10 +74,10 @@ public class TestMasterFailoverWithProcedures {
 
   private static void setupConf(Configuration conf) {
     // don't waste time retrying with the roll, the test is already slow enough.
-    conf.setInt("hbase.procedure.store.wal.max.retries.before.roll", 1);
-    conf.setInt("hbase.procedure.store.wal.wait.before.roll", 0);
-    conf.setInt("hbase.procedure.store.wal.max.roll.retries", 1);
-    conf.setInt("hbase.procedure.store.wal.sync.failure.roll.max", 1);
+    conf.setInt(WALProcedureStore.MAX_RETRIES_BEFORE_ROLL_CONF_KEY, 1);
+    conf.setInt(WALProcedureStore.WAIT_BEFORE_ROLL_CONF_KEY, 0);
+    conf.setInt(WALProcedureStore.ROLL_RETRIES_CONF_KEY, 1);
+    conf.setInt(WALProcedureStore.MAX_SYNC_FAILURE_ROLL_CONF_KEY, 1);
   }
 
   @Before
@@ -198,7 +198,7 @@ public class TestMasterFailoverWithProcedures {
     HMaster firstMaster = UTIL.getHBaseCluster().getMaster();
 
     // cause WAL rolling after a delete in WAL:
-    firstMaster.getConfiguration().setLong("hbase.procedure.store.wal.roll.threshold", 1);
+    firstMaster.getConfiguration().setLong(WALProcedureStore.ROLL_THRESHOLD_CONF_KEY, 1);
 
     HMaster backupMaster3 = Mockito.mock(HMaster.class);
     Mockito.doReturn(firstMaster.getConfiguration()).when(backupMaster3).getConfiguration();

http://git-wip-us.apache.org/repos/asf/hbase/blob/d66316fd/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestMasterProcedureEvents.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestMasterProcedureEvents.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestMasterProcedureEvents.java
index edb1115..f684c49 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestMasterProcedureEvents.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestMasterProcedureEvents.java
@@ -31,6 +31,7 @@ import org.apache.hadoop.hbase.client.Table;
 import org.apache.hadoop.hbase.master.HMaster;
 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;
@@ -53,7 +54,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

http://git-wip-us.apache.org/repos/asf/hbase/blob/d66316fd/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestWALProcedureStoreOnHDFS.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestWALProcedureStoreOnHDFS.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestWALProcedureStoreOnHDFS.java
index 17e9850..81b415c 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestWALProcedureStoreOnHDFS.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestWALProcedureStoreOnHDFS.java
@@ -67,9 +67,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 {


Mime
View raw message