HBASE-25253 Deprecated master carrys regions related methods and configs (#2635)

Signed-off-by: Duo Zhang <zhangduo@apache.org>
This commit is contained in:
WenFeiYi 2020-11-12 22:13:24 +08:00 committed by Duo Zhang
parent b19df076a4
commit ea1375d6be
3 changed files with 43 additions and 1 deletions

View File

@ -146,9 +146,11 @@ public final class ZNodeClearer {
}
/**
*
* @return true if cluster is configured with master-rs collocation
* @deprecated since 2.4.0, will be removed in 3.0.0.
* @see <a href="https://issues.apache.org/jira/browse/HBASE-15549">HBASE-15549</a>
*/
@Deprecated
private static boolean tablesOnMaster(Configuration conf) {
boolean tablesOnMaster = true;
String confValue = conf.get(BaseLoadBalancer.TABLES_ON_MASTER);

View File

@ -53,12 +53,20 @@ public interface LoadBalancer extends Configurable, Stoppable, ConfigurationObse
* Master can carry regions as of hbase-2.0.0.
* By default, it carries no tables.
* TODO: Add any | system as flags to indicate what it can do.
*
* @deprecated since 2.4.0, will be removed in 3.0.0.
* @see <a href="https://issues.apache.org/jira/browse/HBASE-15549">HBASE-15549</a>
*/
@Deprecated
String TABLES_ON_MASTER = "hbase.balancer.tablesOnMaster";
/**
* Master carries system tables.
*
* @deprecated since 2.4.0, will be removed in 3.0.0.
* @see <a href="https://issues.apache.org/jira/browse/HBASE-15549">HBASE-15549</a>
*/
@Deprecated
String SYSTEM_TABLES_ON_MASTER = "hbase.balancer.tablesOnMaster.systemTablesOnly";
// Used to signal to the caller that the region(s) cannot be assigned
@ -163,15 +171,28 @@ public interface LoadBalancer extends Configurable, Stoppable, ConfigurationObse
/**
* @return true if Master carries regions
* @deprecated since 2.4.0, will be removed in 3.0.0.
* @see <a href="https://issues.apache.org/jira/browse/HBASE-15549">HBASE-15549</a>
*/
@Deprecated
static boolean isTablesOnMaster(Configuration conf) {
return conf.getBoolean(TABLES_ON_MASTER, false);
}
/**
* @deprecated since 2.4.0, will be removed in 3.0.0.
* @see <a href="https://issues.apache.org/jira/browse/HBASE-15549">HBASE-15549</a>
*/
@Deprecated
static boolean isSystemTablesOnlyOnMaster(Configuration conf) {
return conf.getBoolean(SYSTEM_TABLES_ON_MASTER, false);
}
/**
* @deprecated since 2.4.0, will be removed in 3.0.0.
* @see <a href="https://issues.apache.org/jira/browse/HBASE-15549">HBASE-15549</a>
*/
@Deprecated
static boolean isMasterCanHostUserRegions(Configuration conf) {
return isTablesOnMaster(conf) && !isSystemTablesOnlyOnMaster(conf);
}

View File

@ -1041,7 +1041,14 @@ public abstract class BaseLoadBalancer implements LoadBalancer {
protected ClusterMetrics clusterStatus = null;
protected ServerName masterServerName;
protected MasterServices services;
/**
* @deprecated since 2.4.0, will be removed in 3.0.0.
* @see <a href="https://issues.apache.org/jira/browse/HBASE-15549">HBASE-15549</a>
*/
@Deprecated
protected boolean onlySystemTablesOnMaster;
protected boolean maintenanceMode;
@Override
@ -1074,7 +1081,11 @@ public abstract class BaseLoadBalancer implements LoadBalancer {
/**
* Check if a region belongs to some system table.
* If so, the primary replica may be expected to be put on the master regionserver.
*
* @deprecated since 2.4.0, will be removed in 3.0.0.
* @see <a href="https://issues.apache.org/jira/browse/HBASE-15549">HBASE-15549</a>
*/
@Deprecated
public boolean shouldBeOnMaster(RegionInfo region) {
return (this.maintenanceMode || this.onlySystemTablesOnMaster)
&& region.getTable().isSystemTable();
@ -1082,7 +1093,11 @@ public abstract class BaseLoadBalancer implements LoadBalancer {
/**
* Balance the regions that should be on master regionserver.
*
* @deprecated since 2.4.0, will be removed in 3.0.0.
* @see <a href="https://issues.apache.org/jira/browse/HBASE-15549">HBASE-15549</a>
*/
@Deprecated
protected List<RegionPlan> balanceMasterRegions(Map<ServerName, List<RegionInfo>> clusterMap) {
if (masterServerName == null || clusterMap == null || clusterMap.size() <= 1) return null;
List<RegionPlan> plans = null;
@ -1131,7 +1146,11 @@ public abstract class BaseLoadBalancer implements LoadBalancer {
/**
* If master is configured to carry system tables only, in here is
* where we figure what to assign it.
*
* @deprecated since 2.4.0, will be removed in 3.0.0.
* @see <a href="https://issues.apache.org/jira/browse/HBASE-15549">HBASE-15549</a>
*/
@Deprecated
@NonNull
protected Map<ServerName, List<RegionInfo>> assignMasterSystemRegions(
Collection<RegionInfo> regions, List<ServerName> servers) {