You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by zh...@apache.org on 2021/04/03 15:10:43 UTC

[hbase] branch master updated: HBASE-25199 Remove deprecated HStore#getStoreHomedir methods (#2562)

This is an automated email from the ASF dual-hosted git repository.

zhangduo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/master by this push:
     new 5a63fe6  HBASE-25199 Remove deprecated HStore#getStoreHomedir methods (#2562)
5a63fe6 is described below

commit 5a63fe65aa8f95a6dd902f9cee3577235ac5bd6d
Author: Jan Hentschel <ja...@ultratendency.com>
AuthorDate: Sat Apr 3 17:10:20 2021 +0200

    HBASE-25199 Remove deprecated HStore#getStoreHomedir methods (#2562)
    
    Signed-off-by: Duo Zhang <zh...@apache.org>
---
 .../hbase/regionserver/HRegionFileSystem.java      | 22 ++++++++++++++++++
 .../apache/hadoop/hbase/regionserver/HStore.java   | 26 ----------------------
 .../apache/hadoop/hbase/util/HFileArchiveUtil.java | 11 ++++-----
 .../hbase/master/janitor/TestCatalogJanitor.java   | 14 +++++++-----
 .../regionserver/TestStripeStoreFileManager.java   |  3 ++-
 5 files changed, 39 insertions(+), 37 deletions(-)

diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionFileSystem.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionFileSystem.java
index 73234f1..dd26f1c 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionFileSystem.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionFileSystem.java
@@ -166,6 +166,28 @@ public class HRegionFileSystem {
   }
 
   /**
+   * @param tabledir {@link Path} to where the table is being stored
+   * @param hri {@link RegionInfo} for the region.
+   * @param family {@link ColumnFamilyDescriptor} describing the column family
+   * @return Path to family/Store home directory.
+   */
+  public static Path getStoreHomedir(final Path tabledir,
+    final RegionInfo hri, final byte[] family) {
+    return getStoreHomedir(tabledir, hri.getEncodedName(), family);
+  }
+
+  /**
+   * @param tabledir {@link Path} to where the table is being stored
+   * @param encodedName Encoded region name.
+   * @param family {@link ColumnFamilyDescriptor} describing the column family
+   * @return Path to family/Store home directory.
+   */
+  public static Path getStoreHomedir(final Path tabledir,
+    final String encodedName, final byte[] family) {
+    return new Path(tabledir, new Path(encodedName, Bytes.toString(family)));
+  }
+
+  /**
    * Create the store directory for the specified family name
    * @param familyName Column Family Name
    * @return {@link Path} to the directory of the specified family
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java
index a2a8f9d..45b17bb 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java
@@ -502,32 +502,6 @@ public class HStore implements Store, HeapSize, StoreConfigInformation,
   }
 
   /**
-   * @param tabledir {@link Path} to where the table is being stored
-   * @param hri {@link RegionInfo} for the region.
-   * @param family {@link ColumnFamilyDescriptor} describing the column family
-   * @return Path to family/Store home directory.
-   * @deprecated Since 05/05/2013, HBase-7808, hbase-1.0.0
-   */
-  @Deprecated
-  public static Path getStoreHomedir(final Path tabledir,
-      final RegionInfo hri, final byte[] family) {
-    return getStoreHomedir(tabledir, hri.getEncodedName(), family);
-  }
-
-  /**
-   * @param tabledir {@link Path} to where the table is being stored
-   * @param encodedName Encoded region name.
-   * @param family {@link ColumnFamilyDescriptor} describing the column family
-   * @return Path to family/Store home directory.
-   * @deprecated Since 05/05/2013, HBase-7808, hbase-1.0.0
-   */
-  @Deprecated
-  public static Path getStoreHomedir(final Path tabledir,
-      final String encodedName, final byte[] family) {
-    return new Path(tabledir, new Path(encodedName, Bytes.toString(family)));
-  }
-
-  /**
    * @return the data block encoder
    */
   public HFileDataBlockEncoder getDataBlockEncoder() {
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HFileArchiveUtil.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HFileArchiveUtil.java
index 450dd6f..f548644 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HFileArchiveUtil.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HFileArchiveUtil.java
@@ -24,7 +24,7 @@ import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.client.RegionInfo;
 import org.apache.hadoop.hbase.regionserver.HRegion;
-import org.apache.hadoop.hbase.regionserver.HStore;
+import org.apache.hadoop.hbase.regionserver.HRegionFileSystem;
 import org.apache.yetus.audience.InterfaceAudience;
 
 /**
@@ -48,7 +48,8 @@ public final class HFileArchiveUtil {
   public static Path getStoreArchivePath(final Configuration conf, final TableName tableName,
     final String regionName, final String familyName) throws IOException {
     Path tableArchiveDir = getTableArchivePath(conf, tableName);
-    return HStore.getStoreHomedir(tableArchiveDir, regionName, Bytes.toBytes(familyName));
+    return HRegionFileSystem.getStoreHomedir(tableArchiveDir, regionName,
+      Bytes.toBytes(familyName));
   }
 
   /**
@@ -77,7 +78,7 @@ public final class HFileArchiveUtil {
     throws IOException {
     Path rootDir = CommonFSUtils.getRootDir(conf);
     Path tableArchiveDir = getTableArchivePath(rootDir, region.getTable());
-    return HStore.getStoreHomedir(tableArchiveDir, region, family);
+    return HRegionFileSystem.getStoreHomedir(tableArchiveDir, region, family);
   }
 
   /**
@@ -93,13 +94,13 @@ public final class HFileArchiveUtil {
    */
   public static Path getStoreArchivePathForRootDir(Path rootDir, RegionInfo region, byte[] family) {
     Path tableArchiveDir = getTableArchivePath(rootDir, region.getTable());
-    return HStore.getStoreHomedir(tableArchiveDir, region, family);
+    return HRegionFileSystem.getStoreHomedir(tableArchiveDir, region, family);
   }
 
   public static Path getStoreArchivePathForArchivePath(Path archivePath, RegionInfo region,
     byte[] family) {
     Path tableArchiveDir = CommonFSUtils.getTableDir(archivePath, region.getTable());
-    return HStore.getStoreHomedir(tableArchiveDir, region, family);
+    return HRegionFileSystem.getStoreHomedir(tableArchiveDir, region, family);
   }
 
   /**
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/janitor/TestCatalogJanitor.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/janitor/TestCatalogJanitor.java
index b1fdf26..502f430 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/janitor/TestCatalogJanitor.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/janitor/TestCatalogJanitor.java
@@ -57,7 +57,7 @@ import org.apache.hadoop.hbase.master.assignment.MockMasterServices;
 import org.apache.hadoop.hbase.master.janitor.CatalogJanitor.SplitParentFirstComparator;
 import org.apache.hadoop.hbase.procedure2.ProcedureTestingUtility;
 import org.apache.hadoop.hbase.regionserver.ChunkCreator;
-import org.apache.hadoop.hbase.regionserver.HStore;
+import org.apache.hadoop.hbase.regionserver.HRegionFileSystem;
 import org.apache.hadoop.hbase.regionserver.MemStoreLAB;
 import org.apache.hadoop.hbase.testclassification.MasterTests;
 import org.apache.hadoop.hbase.testclassification.MediumTests;
@@ -144,7 +144,8 @@ public class TestCatalogJanitor {
     Path rootdir = this.masterServices.getMasterFileSystem().getRootDir();
     Path tabledir = CommonFSUtils.getTableDir(rootdir, td.getTableName());
     Path parentdir = new Path(tabledir, parent.getEncodedName());
-    Path storedir = HStore.getStoreHomedir(tabledir, splita, td.getColumnFamilies()[0].getName());
+    Path storedir = HRegionFileSystem.getStoreHomedir(tabledir, splita,
+      td.getColumnFamilies()[0].getName());
     Reference ref = Reference.createTopReference(Bytes.toBytes("ccc"));
     long now = System.currentTimeMillis();
     // Reference name has this format: StoreFile#REF_NAME_PARSER
@@ -445,7 +446,8 @@ public class TestCatalogJanitor {
     // the single test passes, but when the full suite is run, things get borked).
     CommonFSUtils.setRootDir(fs.getConf(), rootdir);
     Path tabledir = CommonFSUtils.getTableDir(rootdir, td.getTableName());
-    Path storedir = HStore.getStoreHomedir(tabledir, parent, td.getColumnFamilies()[0].getName());
+    Path storedir = HRegionFileSystem.getStoreHomedir(tabledir, parent,
+      td.getColumnFamilies()[0].getName());
     Path storeArchive = HFileArchiveUtil.getStoreArchivePath(this.masterServices.getConfiguration(),
       parent, tabledir, td.getColumnFamilies()[0].getName());
     LOG.debug("Table dir:" + tabledir);
@@ -519,7 +521,8 @@ public class TestCatalogJanitor {
     // the single test passes, but when the full suite is run, things get borked).
     CommonFSUtils.setRootDir(fs.getConf(), rootdir);
     Path tabledir = CommonFSUtils.getTableDir(rootdir, parent.getTable());
-    Path storedir = HStore.getStoreHomedir(tabledir, parent, td.getColumnFamilies()[0].getName());
+    Path storedir = HRegionFileSystem.getStoreHomedir(tabledir, parent,
+      td.getColumnFamilies()[0].getName());
     LOG.info("Old root:" + rootdir);
     LOG.info("Old table:" + tabledir);
     LOG.info("Old store:" + storedir);
@@ -613,7 +616,8 @@ public class TestCatalogJanitor {
     throws IOException {
     Path rootdir = services.getMasterFileSystem().getRootDir();
     Path tabledir = CommonFSUtils.getTableDir(rootdir, parent.getTable());
-    Path storedir = HStore.getStoreHomedir(tabledir, daughter, td.getColumnFamilies()[0].getName());
+    Path storedir = HRegionFileSystem.getStoreHomedir(tabledir, daughter,
+      td.getColumnFamilies()[0].getName());
     Reference ref =
       top ? Reference.createTopReference(midkey) : Reference.createBottomReference(midkey);
     long now = System.currentTimeMillis();
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStripeStoreFileManager.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStripeStoreFileManager.java
index 1d1e9fb..ae47b49 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStripeStoreFileManager.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStripeStoreFileManager.java
@@ -59,7 +59,8 @@ public class TestStripeStoreFileManager {
   private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
   private static final Path BASEDIR =
       TEST_UTIL.getDataTestDir(TestStripeStoreFileManager.class.getSimpleName());
-  private static final Path CFDIR = HStore.getStoreHomedir(BASEDIR, "region", Bytes.toBytes("cf"));
+  private static final Path CFDIR = HRegionFileSystem.getStoreHomedir(BASEDIR, "region",
+    Bytes.toBytes("cf"));
 
   private static final byte[] KEY_A = Bytes.toBytes("aaa");
   private static final byte[] KEY_B = Bytes.toBytes("aab");