HBASE-25199 Remove deprecated HStore#getStoreHomedir methods (#2562)

Signed-off-by: Duo Zhang <zhangduo@apache.org>
This commit is contained in:
Jan Hentschel 2021-04-03 17:10:20 +02:00 committed by GitHub
parent 2a44f3efdf
commit 5a63fe65aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 39 additions and 37 deletions

View File

@ -165,6 +165,28 @@ public class HRegionFileSystem {
return new Path(this.getRegionDir(), familyName);
}
/**
* @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

View File

@ -501,32 +501,6 @@ public class HStore implements Store, HeapSize, StoreConfigInformation,
return StoreUtils.getMaxMemStoreTSInList(this.getStorefiles());
}
/**
* @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
*/

View File

@ -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);
}
/**

View File

@ -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();

View File

@ -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");