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:55:08 UTC

[hbase] branch branch-2.3 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 branch-2.3
in repository https://gitbox.apache.org/repos/asf/hbase.git


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

commit 96773913ce232dfb1ae65642e8292c90028a6169
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 ++++-----
 .../hadoop/hbase/master/TestCatalogJanitor.java    | 26 ++++++++++++----------
 .../regionserver/TestStripeStoreFileManager.java   |  3 ++-
 5 files changed, 44 insertions(+), 44 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 d5ef30e..37da10e 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
@@ -167,6 +167,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 32ec2c3..bc26297 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
@@ -523,32 +523,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/TestCatalogJanitor.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestCatalogJanitor.java
index 5486817..3f97880 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestCatalogJanitor.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestCatalogJanitor.java
@@ -54,7 +54,7 @@ import org.apache.hadoop.hbase.master.CatalogJanitor.SplitParentFirstComparator;
 import org.apache.hadoop.hbase.master.assignment.MockMasterServices;
 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;
@@ -128,7 +128,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
@@ -443,10 +444,10 @@ 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 storeArchive =
-        HFileArchiveUtil.getStoreArchivePath(this.masterServices.getConfiguration(), parent,
-            tabledir, 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);
     LOG.debug("Store dir:" + storedir);
     LOG.debug("Store archive dir:" + storeArchive);
@@ -518,15 +519,16 @@ 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());
-    System.out.println("Old root:" + rootdir);
-    System.out.println("Old table:" + tabledir);
-    System.out.println("Old store:" + storedir);
+    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);
 
     Path storeArchive =
         HFileArchiveUtil.getStoreArchivePath(this.masterServices.getConfiguration(), parent,
       tabledir, td.getColumnFamilies()[0].getName());
-    System.out.println("Old archive:" + storeArchive);
+    LOG.info("Old archive:" + storeArchive);
 
     // enable archiving, make sure that files get archived
     addMockStoreFiles(2, this.masterServices, storedir);
@@ -614,7 +616,7 @@ public class TestCatalogJanitor {
   throws IOException {
     Path rootdir = services.getMasterFileSystem().getRootDir();
     Path tabledir = CommonFSUtils.getTableDir(rootdir, parent.getTable());
-    Path storedir = HStore.getStoreHomedir(tabledir, daughter,
+    Path storedir = HRegionFileSystem.getStoreHomedir(tabledir, daughter,
       td.getColumnFamilies()[0].getName());
     Reference ref =
       top? Reference.createTopReference(midkey): Reference.createBottomReference(midkey);
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");