kgeisz commented on code in PR #7330:
URL: https://github.com/apache/hbase/pull/7330#discussion_r2377133614


##########
hbase-server/src/test/java/org/apache/hadoop/hbase/master/region/TestMasterRegionInitialize.java:
##########
@@ -114,4 +118,25 @@ public void testInitializingCleanup() throws IOException {
     // but the data should have been cleaned up
     assertTrue(region.get(new Get(row)).isEmpty());
   }
+
+  @Test
+  public void testMasterRegionDirSuffix() throws Exception {
+    HBaseTestingUtil testUtil = new HBaseTestingUtil();
+    Configuration conf = testUtil.getConfiguration();
+    conf.set(HConstants.HBASE_META_TABLE_SUFFIX, "replica1");
+
+    try {
+      testUtil.startMiniCluster(1);
+      FileSystem fs = CommonFSUtils.getRootDirFileSystem(conf);
+      Path rootDir = CommonFSUtils.getRootDir(conf);
+
+      assertTrue("Master region directory should use the suffix",
+        fs.exists(new Path(rootDir, "MasterData_replica1")));

Review Comment:
   nit
   ```suggestion
           fs.exists(new Path(rootDir, MasterRegionFactory.MASTER_STORE_DIR + 
"_replica1")));
   ```



##########
hbase-server/src/test/java/org/apache/hadoop/hbase/master/region/TestMasterRegionInitialize.java:
##########
@@ -114,4 +118,25 @@ public void testInitializingCleanup() throws IOException {
     // but the data should have been cleaned up
     assertTrue(region.get(new Get(row)).isEmpty());
   }
+
+  @Test
+  public void testMasterRegionDirSuffix() throws Exception {
+    HBaseTestingUtil testUtil = new HBaseTestingUtil();
+    Configuration conf = testUtil.getConfiguration();
+    conf.set(HConstants.HBASE_META_TABLE_SUFFIX, "replica1");
+
+    try {
+      testUtil.startMiniCluster(1);
+      FileSystem fs = CommonFSUtils.getRootDirFileSystem(conf);
+      Path rootDir = CommonFSUtils.getRootDir(conf);
+
+      assertTrue("Master region directory should use the suffix",
+        fs.exists(new Path(rootDir, "MasterData_replica1")));
+      assertFalse("Default master region directory should not exist when 
suffix is used",
+        fs.exists(new Path(rootDir, "MasterData")));

Review Comment:
   nit
   ```suggestion
           fs.exists(new Path(rootDir, MasterRegionFactory.MASTER_STORE_DIR)));
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to