Package org.apache.hadoop.hbase.rsgroup
Class RSGroupAdminEndpoint
java.lang.Object
org.apache.hadoop.hbase.rsgroup.RSGroupAdminEndpoint
- All Implemented Interfaces:
Coprocessor
,MasterCoprocessor
,MasterObserver
@Private
public class RSGroupAdminEndpoint
extends Object
implements MasterCoprocessor, MasterObserver
-
Nested Class Summary
Modifier and TypeClassDescriptionprivate class
Implementation of RSGroupAdminService defined in RSGroupAdmin.proto.Nested classes/interfaces inherited from interface org.apache.hadoop.hbase.Coprocessor
Coprocessor.State
-
Field Summary
Modifier and TypeFieldDescriptionprivate AccessChecker
private RSGroupAdminServer
private final org.apache.hadoop.hbase.protobuf.generated.RSGroupAdminProtos.RSGroupAdminService
private RSGroupInfoManager
private static final org.slf4j.Logger
private MasterServices
private UserProvider
Provider for mapping principal names to UsersFields inherited from interface org.apache.hadoop.hbase.Coprocessor
PRIORITY_HIGHEST, PRIORITY_LOWEST, PRIORITY_SYSTEM, PRIORITY_USER, VERSION
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription(package private) void
void
checkPermission
(String request) private RSGroupInfo
private User
Returns the active user to which authorization checks should be applied.(package private) RSGroupAdminServer
(package private) RSGroupInfoManager
Iterable<com.google.protobuf.Service>
Coprocessor endpoints providing protobuf services should override this method.private void
moveTableToRSGroup
(TableDescriptor desc, RSGroupInfo rsGroupInfo) private void
void
postClearDeadServers
(ObserverContext<MasterCoprocessorEnvironment> ctx, List<ServerName> servers, List<ServerName> notClearedServers) Called after clear dead region servers.void
postCompletedModifyTableAction
(ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName, TableDescriptor oldDescriptor, TableDescriptor currentDescriptor) Called after to modifying a table's properties.void
postDeleteTable
(ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName) Called after the deleteTable operation has been requested.void
preCloneSnapshot
(ObserverContext<MasterCoprocessorEnvironment> ctx, SnapshotDescription snapshot, TableDescriptor desc) Called before a snapshot is cloned.void
Called before a new namespace is created byHMaster
.void
preCreateTableAction
(ObserverContext<MasterCoprocessorEnvironment> ctx, TableDescriptor desc, RegionInfo[] regions) Called before a new table is created byHMaster
.void
Called prior to modifying a namespace's properties.void
preModifyTableAction
(ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName, TableDescriptor currentDescriptor, TableDescriptor newDescriptor) Called prior to modifying a table's properties.(package private) boolean
void
Called by theCoprocessorEnvironment
during it's own startup to initialize the coprocessor.void
Called by theCoprocessorEnvironment
during it's own shutdown to stop the coprocessor.private void
validateRSGroup
(TableDescriptor desc, RSGroupInfo rsGroupInfo) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.hadoop.hbase.coprocessor.MasterObserver
postAbortProcedure, postAddReplicationPeer, postAddRSGroup, postAssign, postBalance, postBalanceRSGroup, postBalanceSwitch, postCloneSnapshot, postCompletedCreateTableAction, postCompletedDeleteTableAction, postCompletedDisableTableAction, postCompletedEnableTableAction, postCompletedMergeRegionsAction, postCompletedModifyTableAction, postCompletedSnapshotAction, postCompletedSplitRegionAction, postCompletedTruncateTableAction, postCreateNamespace, postCreateTable, postDecommissionRegionServers, postDeleteNamespace, postDeleteSnapshot, postDisableReplicationPeer, postDisableTable, postEnableReplicationPeer, postEnableTable, postGetClusterMetrics, postGetLocks, postGetNamespaceDescriptor, postGetProcedures, postGetReplicationPeerConfig, postGetTableDescriptors, postGetTableNames, postGetUserPermissions, postGrant, postHasUserPermissions, postIsRpcThrottleEnabled, postListDecommissionedRegionServers, postListNamespaceDescriptors, postListNamespaces, postListReplicationPeers, postListSnapshot, postLockHeartbeat, postMasterStoreFlush, postMergeRegions, postMergeRegionsCommitAction, postModifyColumnFamilyStoreFileTracker, postModifyNamespace, postModifyNamespace, postModifyTable, postModifyTable, postModifyTableStoreFileTracker, postMove, postMoveServers, postMoveServersAndTables, postMoveTables, postRecommissionRegionServer, postRegionOffline, postRemoveReplicationPeer, postRemoveRSGroup, postRemoveServers, postRenameRSGroup, postRequestLock, postRestoreSnapshot, postRevoke, postRollBackMergeRegionsAction, postRollBackSplitRegionAction, postSetNamespaceQuota, postSetRegionServerQuota, postSetSplitOrMergeEnabled, postSetTableQuota, postSetUserQuota, postSetUserQuota, postSetUserQuota, postSnapshot, postStartMaster, postSwitchExceedThrottleQuota, postSwitchRpcThrottle, postTableFlush, postTruncateRegion, postTruncateRegionAction, postTruncateTable, postUnassign, postUnassign, postUpdateMasterConfiguration, postUpdateReplicationPeerConfig, postUpdateRSGroupConfig, preAbortProcedure, preAddReplicationPeer, preAddRSGroup, preAssign, preBalance, preBalanceRSGroup, preBalanceSwitch, preClearDeadServers, preCreateTable, preCreateTableRegionsInfos, preDecommissionRegionServers, preDeleteNamespace, preDeleteSnapshot, preDeleteTable, preDeleteTableAction, preDisableReplicationPeer, preDisableTable, preDisableTableAction, preEnableReplicationPeer, preEnableTable, preEnableTableAction, preGetClusterMetrics, preGetLocks, preGetNamespaceDescriptor, preGetProcedures, preGetReplicationPeerConfig, preGetTableDescriptors, preGetTableNames, preGetUserPermissions, preGrant, preHasUserPermissions, preIsRpcThrottleEnabled, preListDecommissionedRegionServers, preListNamespaceDescriptors, preListNamespaces, preListReplicationPeers, preListSnapshot, preLockHeartbeat, preMasterInitialization, preMasterStoreFlush, preMergeRegions, preMergeRegionsAction, preMergeRegionsCommitAction, preModifyColumnFamilyStoreFileTracker, preModifyNamespace, preModifyTable, preModifyTable, preModifyTableAction, preModifyTableStoreFileTracker, preMove, preMoveServers, preMoveServersAndTables, preMoveTables, preRecommissionRegionServer, preRegionOffline, preRemoveReplicationPeer, preRemoveRSGroup, preRemoveServers, preRenameRSGroup, preRequestLock, preRestoreSnapshot, preRevoke, preSetNamespaceQuota, preSetRegionServerQuota, preSetSplitOrMergeEnabled, preSetTableQuota, preSetUserQuota, preSetUserQuota, preSetUserQuota, preShutdown, preSnapshot, preSplitRegion, preSplitRegionAction, preSplitRegionAfterMETAAction, preSplitRegionBeforeMETAAction, preStopMaster, preSwitchExceedThrottleQuota, preSwitchRpcThrottle, preTableFlush, preTruncateRegion, preTruncateRegionAction, preTruncateTable, preTruncateTableAction, preUnassign, preUnassign, preUpdateMasterConfiguration, preUpdateReplicationPeerConfig, preUpdateRSGroupConfig
-
Field Details
-
LOG
-
master
-
groupInfoManager
-
groupAdminServer
-
groupAdminService
private final org.apache.hadoop.hbase.protobuf.generated.RSGroupAdminProtos.RSGroupAdminService groupAdminService -
accessChecker
-
userProvider
Provider for mapping principal names to Users
-
-
Constructor Details
-
RSGroupAdminEndpoint
public RSGroupAdminEndpoint()
-
-
Method Details
-
start
Description copied from interface:Coprocessor
Called by theCoprocessorEnvironment
during it's own startup to initialize the coprocessor.- Specified by:
start
in interfaceCoprocessor
- Throws:
IOException
-
stop
Description copied from interface:Coprocessor
Called by theCoprocessorEnvironment
during it's own shutdown to stop the coprocessor.- Specified by:
stop
in interfaceCoprocessor
-
getServices
Description copied from interface:Coprocessor
Coprocessor endpoints providing protobuf services should override this method.- Specified by:
getServices
in interfaceCoprocessor
- Returns:
- Iterable of
Service
s or empty collection. Implementations should never return null.
-
getMasterObserver
- Specified by:
getMasterObserver
in interfaceMasterCoprocessor
-
getGroupInfoManager
-
getGroupAdminServer
-
rsgroupHasServersOnline
- Throws:
IOException
-
assignTableToGroup
- Throws:
IOException
-
preCreateTableAction
public void preCreateTableAction(ObserverContext<MasterCoprocessorEnvironment> ctx, TableDescriptor desc, RegionInfo[] regions) throws IOException Description copied from interface:MasterObserver
Called before a new table is created byHMaster
. Called as part of create table procedure and it is async to the create RPC call.- Specified by:
preCreateTableAction
in interfaceMasterObserver
- Parameters:
ctx
- the environment to interact with the framework and masterdesc
- the TableDescriptor for the tableregions
- the initial regions created for the table- Throws:
IOException
-
preModifyTableAction
public void preModifyTableAction(ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName, TableDescriptor currentDescriptor, TableDescriptor newDescriptor) throws IOException Description copied from interface:MasterObserver
Called prior to modifying a table's properties. Called as part of modify table procedure and it is async to the modify table RPC call.- Specified by:
preModifyTableAction
in interfaceMasterObserver
- Parameters:
ctx
- the environment to interact with the framework and mastertableName
- the name of the tablecurrentDescriptor
- current TableDescriptor of the tablenewDescriptor
- after modify operation, table will have this descriptor- Throws:
IOException
-
postCompletedModifyTableAction
public void postCompletedModifyTableAction(ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName, TableDescriptor oldDescriptor, TableDescriptor currentDescriptor) throws IOException Description copied from interface:MasterObserver
Called after to modifying a table's properties. Called as part of modify table procedure and it is async to the modify table RPC call.- Specified by:
postCompletedModifyTableAction
in interfaceMasterObserver
- Parameters:
ctx
- the environment to interact with the framework and mastertableName
- the name of the tableoldDescriptor
- descriptor of table before modify operation happenedcurrentDescriptor
- current TableDescriptor of the table- Throws:
IOException
-
moveTableToValidRSGroup
- Throws:
IOException
-
validateRSGroup
- Throws:
IOException
-
moveTableToRSGroup
- Throws:
IOException
-
determineRSGroupInfoForTable
- Throws:
IOException
-
postDeleteTable
public void postDeleteTable(ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName) throws IOException Description copied from interface:MasterObserver
Called after the deleteTable operation has been requested. Called as part of delete table RPC call.- Specified by:
postDeleteTable
in interfaceMasterObserver
- Parameters:
ctx
- the environment to interact with the framework and mastertableName
- the name of the table- Throws:
IOException
-
preCreateNamespace
public void preCreateNamespace(ObserverContext<MasterCoprocessorEnvironment> ctx, NamespaceDescriptor ns) throws IOException Description copied from interface:MasterObserver
Called before a new namespace is created byHMaster
.- Specified by:
preCreateNamespace
in interfaceMasterObserver
- Parameters:
ctx
- the environment to interact with the framework and masterns
- the NamespaceDescriptor for the table- Throws:
IOException
-
preModifyNamespace
public void preModifyNamespace(ObserverContext<MasterCoprocessorEnvironment> ctx, NamespaceDescriptor ns) throws IOException Description copied from interface:MasterObserver
Called prior to modifying a namespace's properties.- Specified by:
preModifyNamespace
in interfaceMasterObserver
- Parameters:
ctx
- the environment to interact with the framework and masterns
- after modify operation, namespace will have this descriptor- Throws:
IOException
-
preCloneSnapshot
public void preCloneSnapshot(ObserverContext<MasterCoprocessorEnvironment> ctx, SnapshotDescription snapshot, TableDescriptor desc) throws IOException Description copied from interface:MasterObserver
Called before a snapshot is cloned. Called as part of restoreSnapshot RPC call.- Specified by:
preCloneSnapshot
in interfaceMasterObserver
- Parameters:
ctx
- the environment to interact with the framework and mastersnapshot
- the SnapshotDescriptor for the snapshotdesc
- the TableDescriptor of the table to create- Throws:
IOException
-
postClearDeadServers
public void postClearDeadServers(ObserverContext<MasterCoprocessorEnvironment> ctx, List<ServerName> servers, List<ServerName> notClearedServers) throws IOException Description copied from interface:MasterObserver
Called after clear dead region servers.- Specified by:
postClearDeadServers
in interfaceMasterObserver
- Throws:
IOException
-
checkPermission
- Throws:
IOException
-
getActiveUser
Returns the active user to which authorization checks should be applied. If we are in the context of an RPC call, the remote user is used, otherwise the currently logged in user is used.- Throws:
IOException
-