HBASE-22729 Start RSGroupInfoManager as default (#555)
Amending-Author: Duo Zhang <zhangduo@apache.org> Signed-off-by: stack <stack@apache.org>
This commit is contained in:
parent
b3399ef365
commit
2bf2781df9
|
@ -188,6 +188,7 @@ import org.apache.hadoop.hbase.replication.master.ReplicationHFileCleaner;
|
|||
import org.apache.hadoop.hbase.replication.master.ReplicationLogCleaner;
|
||||
import org.apache.hadoop.hbase.replication.master.ReplicationPeerConfigUpgrader;
|
||||
import org.apache.hadoop.hbase.replication.regionserver.ReplicationStatus;
|
||||
import org.apache.hadoop.hbase.rsgroup.RSGroupInfoManager;
|
||||
import org.apache.hadoop.hbase.security.AccessDeniedException;
|
||||
import org.apache.hadoop.hbase.security.SecurityConstants;
|
||||
import org.apache.hadoop.hbase.security.UserProvider;
|
||||
|
@ -356,12 +357,15 @@ public class HMaster extends HRegionServer implements MasterServices {
|
|||
// manager of assignment nodes in zookeeper
|
||||
private AssignmentManager assignmentManager;
|
||||
|
||||
|
||||
/**
|
||||
* Cache for the meta region replica's locations. Also tracks their changes to avoid stale
|
||||
* cache entries.
|
||||
*/
|
||||
private final MetaRegionLocationCache metaRegionLocationCache;
|
||||
|
||||
private RSGroupInfoManager rsGroupInfoManager;
|
||||
|
||||
// manager of replication
|
||||
private ReplicationPeerManager replicationPeerManager;
|
||||
|
||||
|
@ -799,6 +803,8 @@ public class HMaster extends HRegionServer implements MasterServices {
|
|||
this.splitOrMergeTracker = new SplitOrMergeTracker(zooKeeper, conf, this);
|
||||
this.splitOrMergeTracker.start();
|
||||
|
||||
this.rsGroupInfoManager = RSGroupInfoManager.create(this);
|
||||
|
||||
this.replicationPeerManager = ReplicationPeerManager.create(zooKeeper, conf);
|
||||
|
||||
this.drainingServerTracker = new DrainingServerTracker(zooKeeper, this, this.serverManager);
|
||||
|
@ -3865,4 +3871,9 @@ public class HMaster extends HRegionServer implements MasterServices {
|
|||
public MetaRegionLocationCache getMetaRegionLocationCache() {
|
||||
return this.metaRegionLocationCache;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RSGroupInfoManager getRSRSGroupInfoManager() {
|
||||
return rsGroupInfoManager;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,10 +18,8 @@
|
|||
package org.apache.hadoop.hbase.master;
|
||||
|
||||
import com.google.protobuf.Service;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.hadoop.hbase.Server;
|
||||
import org.apache.hadoop.hbase.ServerName;
|
||||
import org.apache.hadoop.hbase.TableDescriptors;
|
||||
|
@ -51,6 +49,7 @@ import org.apache.hadoop.hbase.replication.ReplicationException;
|
|||
import org.apache.hadoop.hbase.replication.ReplicationPeerConfig;
|
||||
import org.apache.hadoop.hbase.replication.ReplicationPeerDescription;
|
||||
import org.apache.hadoop.hbase.replication.SyncReplicationState;
|
||||
import org.apache.hadoop.hbase.rsgroup.RSGroupInfoManager;
|
||||
import org.apache.hadoop.hbase.security.access.AccessChecker;
|
||||
import org.apache.hadoop.hbase.security.access.ZKPermissionWatcher;
|
||||
import org.apache.yetus.audience.InterfaceAudience;
|
||||
|
@ -541,4 +540,9 @@ public interface MasterServices extends Server {
|
|||
* Run the ReplicationBarrierChore.
|
||||
*/
|
||||
void runReplicationBarrierCleaner();
|
||||
|
||||
/**
|
||||
* @return the {@link RSGroupInfoManager}
|
||||
*/
|
||||
RSGroupInfoManager getRSRSGroupInfoManager();
|
||||
}
|
||||
|
|
|
@ -66,7 +66,7 @@ public class RSGroupAdminEndpoint implements MasterCoprocessor, MasterObserver {
|
|||
}
|
||||
|
||||
master = ((HasMasterServices) env).getMasterServices();
|
||||
groupInfoManager = RSGroupInfoManagerImpl.getInstance(master);
|
||||
groupInfoManager = master.getRSRSGroupInfoManager();
|
||||
groupAdminServer = new RSGroupAdminServer(master, groupInfoManager);
|
||||
Class<?> clazz =
|
||||
master.getConfiguration().getClass(HConstants.HBASE_MASTER_LOADBALANCER_CLASS, null);
|
||||
|
|
|
@ -21,6 +21,7 @@ import java.io.IOException;
|
|||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import org.apache.hadoop.hbase.TableName;
|
||||
import org.apache.hadoop.hbase.master.MasterServices;
|
||||
import org.apache.hadoop.hbase.net.Address;
|
||||
import org.apache.yetus.audience.InterfaceAudience;
|
||||
|
||||
|
@ -87,4 +88,8 @@ public interface RSGroupInfoManager {
|
|||
*/
|
||||
@Deprecated
|
||||
RSGroupInfo getRSGroupForTable(TableName tableName) throws IOException;
|
||||
|
||||
static RSGroupInfoManager create(MasterServices master) throws IOException {
|
||||
return RSGroupInfoManagerImpl.getInstance(master);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -54,6 +54,7 @@ import org.apache.hadoop.hbase.replication.ReplicationException;
|
|||
import org.apache.hadoop.hbase.replication.ReplicationPeerConfig;
|
||||
import org.apache.hadoop.hbase.replication.ReplicationPeerDescription;
|
||||
import org.apache.hadoop.hbase.replication.SyncReplicationState;
|
||||
import org.apache.hadoop.hbase.rsgroup.RSGroupInfoManager;
|
||||
import org.apache.hadoop.hbase.security.access.AccessChecker;
|
||||
import org.apache.hadoop.hbase.security.access.ZKPermissionWatcher;
|
||||
import org.apache.hadoop.hbase.zookeeper.ZKWatcher;
|
||||
|
@ -492,5 +493,11 @@ public class MockNoopMasterServices implements MasterServices {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void runReplicationBarrierCleaner() {}
|
||||
public void runReplicationBarrierCleaner() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public RSGroupInfoManager getRSRSGroupInfoManager() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue