Class AccessController
- All Implemented Interfaces:
Coprocessor,BulkLoadObserver,EndpointObserver,MasterCoprocessor,MasterObserver,RegionCoprocessor,RegionObserver,RegionServerCoprocessor,RegionServerObserver,org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.AccessControlService.Interface
AccessController performs authorization checks for HBase operations based on:
- the identity of the user performing the operation
- the scope over which the operation is performed, in increasing specificity: global, table, column family, or qualifier
- the type of action being performed (as mapped to
Permission.Actionvalues)
If the authorization check fails, an AccessDeniedException will be thrown for the
operation.
To perform authorization checks, AccessController relies on the RpcServerEngine being
loaded to provide the user identities for remote requests.
The access control lists used for authorization can be manipulated via the exposed
AccessControlProtos.AccessControlService Interface implementation, and the associated grant,
revoke, and user_permission HBase shell commands.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.apache.hadoop.hbase.Coprocessor
Coprocessor.StateNested classes/interfaces inherited from interface org.apache.hadoop.hbase.coprocessor.RegionObserver
RegionObserver.MutationType -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate AccessCheckerprivate booleanflags if we are running on a region of the _acl_ tableprivate booleanif the ACL table is available, only relevant in the masterprivate static final org.slf4j.Loggerprivate booleanif we are active, usually false, only true if "hbase.security.authorization" has been set to true in site configurationprivate booleanif we are able to support cell ACLsprivate static final Stringprivate booleanif we should terminate access checks early as soon as table or CF grants allow access; pre-0.98 compatible behaviorprivate booleanif we have been successfully initializedprivate static final org.slf4j.Loggerprivate RegionCoprocessorEnvironmentdefined only for Endpoint implementation, so it can have way to access region servicesprivate Map<InternalScanner,String> Mapping of scanner instances to the user who created themprivate booleanif we should check EXEC permissionsprivate Map<TableName,List<UserPermission>> private static final Stringprivate static final byte[]private UserProviderProvider for mapping principal names to Usersprivate ZKPermissionWatcherFields inherited from interface org.apache.hadoop.hbase.Coprocessor
PRIORITY_HIGHEST, PRIORITY_LOWEST, PRIORITY_SYSTEM, PRIORITY_USER, VERSION -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidaddCellPermissions(byte[] perms, Map<byte[], List<Cell>> familyMap) private booleancheckCoveringPermission(User user, AccessController.OpType request, RegionCoprocessorEnvironment e, byte[] row, Map<byte[], ? extends Collection<?>> familyMap, long opTs, Permission.Action... actions) Determine if cell ACLs covered by the operation grant access.private voidcheckForReservedTagPresence(User user, Mutation m) voidcheckLockPermissions(ObserverContext<?> ctx, String namespace, TableName tableName, RegionInfo[] regionInfos, String reason) voidcheckPermissions(com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.CheckPermissionsRequest request, com.google.protobuf.RpcCallback<org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.CheckPermissionsResponse> done) Deprecated.since 2.2.0 and will be removed 4.0.0.private voidcheckSystemOrSuperUser(User activeUser) private static voidcreateACLTable(Admin admin) Create the ACL tableprivate CellcreateNewCellWithTags(Mutation mutation, Cell oldCell, Cell newCell) private UsergetActiveUser(ObserverContext<?> ctx) Returns the active user to which authorization checks should be applied.private RegionObserver/Service GettersIterable<com.google.protobuf.Service>Coprocessor endpoints providing protobuf services should override this method.private TableNameprivate TableNamegetTableName(Region region) voidgetUserPermissions(com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.GetUserPermissionsRequest request, com.google.protobuf.RpcCallback<org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.GetUserPermissionsResponse> done) Deprecated.since 2.2.0 and will be removed in 4.0.0.voidgrant(com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.GrantRequest request, com.google.protobuf.RpcCallback<org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.GrantResponse> done) Deprecated.since 2.2.0 and will be removed in 4.0.0.private booleanhasFamilyQualifierPermission(User user, Permission.Action perm, RegionCoprocessorEnvironment env, Map<byte[], ? extends Collection<byte[]>> familyMap) Returnstrueif the current user is allowed the given action over at least one of the column qualifiers in the given column families.voidhasPermission(com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.HasPermissionRequest request, com.google.protobuf.RpcCallback<org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.HasPermissionResponse> done) Deprecated.since 2.2.0 and will be removed in 4.0.0.private voidprivate voidinternalPreRead(ObserverContext<RegionCoprocessorEnvironment> c, Query query, AccessController.OpType opType) static booleanisCellAuthorizationSupported(org.apache.hadoop.conf.Configuration conf) private Map<byte[],? extends Collection<byte[]>> makeFamilyMap(byte[] family, byte[] qualifier) private AuthResultpermissionGranted(AccessController.OpType opType, User user, RegionCoprocessorEnvironment e, Map<byte[], ? extends Collection<?>> families, Permission.Action... actions) Check the current user for authorization to perform a specific action against the given set of row data.voidCalled after a abortProcedure request has been processed.postAppendBeforeWAL(ObserverContext<RegionCoprocessorEnvironment> ctx, Mutation mutation, List<Pair<Cell, Cell>> cellPairs) Called after a list of new cells has been created during an append operation, but before they are committed to the WAL or memstore.voidpostCompletedCreateTableAction(ObserverContext<MasterCoprocessorEnvironment> c, TableDescriptor desc, RegionInfo[] regions) Called after the createTable operation has been requested.postCreateReplicationEndPoint(ObserverContext<RegionServerCoprocessorEnvironment> ctx, ReplicationEndpoint endpoint) This will be called after the replication endpoint is instantiated.voidpostDelete(ObserverContext<RegionCoprocessorEnvironment> c, Delete delete, WALEdit edit, Durability durability) Called after the client deletes a value.voidpostDeleteNamespace(ObserverContext<MasterCoprocessorEnvironment> ctx, String namespace) Called after the deleteNamespace operation has been requested.voidpostDeleteTable(ObserverContext<MasterCoprocessorEnvironment> c, TableName tableName) Called after the deleteTable operation has been requested.voidpostEndpointInvocation(ObserverContext<RegionCoprocessorEnvironment> ctx, com.google.protobuf.Service service, String methodName, com.google.protobuf.Message request, com.google.protobuf.Message.Builder responseBuilder) Called after an Endpoint service method is invoked.voidpostGetTableDescriptors(ObserverContext<MasterCoprocessorEnvironment> ctx, List<TableName> tableNamesList, List<TableDescriptor> descriptors, String regex) Called after a getTableDescriptors request has been processed.voidpostGetTableNames(ObserverContext<MasterCoprocessorEnvironment> ctx, List<TableDescriptor> descriptors, String regex) Called after a getTableNames request has been processed.postIncrementBeforeWAL(ObserverContext<RegionCoprocessorEnvironment> ctx, Mutation mutation, List<Pair<Cell, Cell>> cellPairs) Called after a list of new cells has been created during an increment operation, but before they are committed to the WAL or memstore.voidpostListNamespaceDescriptors(ObserverContext<MasterCoprocessorEnvironment> ctx, List<NamespaceDescriptor> descriptors) Called after a listNamespaceDescriptors request has been processed.voidpostListNamespaces(ObserverContext<MasterCoprocessorEnvironment> ctx, List<String> namespaces) Called after a listNamespaces request has been processed.voidpostModifyTable(ObserverContext<MasterCoprocessorEnvironment> c, TableName tableName, TableDescriptor htd) Called after the modifyTable operation has been requested.voidCalled after the region is reported as open to the master.voidpostPut(ObserverContext<RegionCoprocessorEnvironment> c, Put put, WALEdit edit, Durability durability) Called after the client stores a value.voidThis will be called after executing user request to roll a region server WAL.voidCalled after the client closes a scanner.Called after the client opens a new scanner.voidCalled immediately after an active master instance has completed initialization.voidpostTruncateTable(ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName) Called after the truncateTable operation has been requested.voidpreAbortProcedure(ObserverContext<MasterCoprocessorEnvironment> ctx, long procId) Called before a abortProcedure request has been processed.voidpreAddReplicationPeer(ObserverContext<MasterCoprocessorEnvironment> ctx, String peerId, ReplicationPeerConfig peerConfig) Called before add a replication peerpreAppend(ObserverContext<RegionCoprocessorEnvironment> c, Append append) Called before Append.voidpreAssign(ObserverContext<MasterCoprocessorEnvironment> c, RegionInfo regionInfo) Called prior to assigning a specific region.voidCalled prior to requesting rebalancing of the cluster regions, though after the initial checks for regions in transition and the balance switch flag.voidpreBalanceSwitch(ObserverContext<MasterCoprocessorEnvironment> c, boolean newValue) Called prior to modifying the flag used to enable/disable region balancing.voidpreBatchMutate(ObserverContext<RegionCoprocessorEnvironment> c, MiniBatchOperationInProgress<Mutation> miniBatchOp) This will be called for every batch mutation operation happening at the server.voidpreBulkLoadHFile(ObserverContext<RegionCoprocessorEnvironment> ctx, List<Pair<byte[], String>> familyPaths) Verifies user has CREATE or ADMIN privileges on the Column Families involved in the bulkLoadHFile request.booleanpreCheckAndDelete(ObserverContext<RegionCoprocessorEnvironment> c, byte[] row, byte[] family, byte[] qualifier, CompareOperator op, ByteArrayComparable comparator, Delete delete, boolean result) Called before checkAndDelete.booleanpreCheckAndDeleteAfterRowLock(ObserverContext<RegionCoprocessorEnvironment> c, byte[] row, byte[] family, byte[] qualifier, CompareOperator op, ByteArrayComparable comparator, Delete delete, boolean result) Called before checkAndDelete but after acquiring rowock.booleanpreCheckAndPut(ObserverContext<RegionCoprocessorEnvironment> c, byte[] row, byte[] family, byte[] qualifier, CompareOperator op, ByteArrayComparable comparator, Put put, boolean result) Called before checkAndPut.booleanpreCheckAndPutAfterRowLock(ObserverContext<RegionCoprocessorEnvironment> c, byte[] row, byte[] family, byte[] qualifier, CompareOperator opp, ByteArrayComparable comparator, Put put, boolean result) Called before checkAndPut but after acquiring rowlock.voidAuthorization security check for SecureBulkLoadProtocol.cleanupBulkLoad()voidThis will be called before clearing compaction queuesvoidCalled before clear dead region servers.voidvoidpreCloneSnapshot(ObserverContext<MasterCoprocessorEnvironment> ctx, SnapshotDescription snapshot, TableDescriptor hTableDescriptor) Called before a snapshot is cloned.voidpreClose(ObserverContext<RegionCoprocessorEnvironment> c, boolean abortRequested) Called before the region is reported as closed to the master.preCompact(ObserverContext<RegionCoprocessorEnvironment> c, Store store, InternalScanner scanner, ScanType scanType, CompactionLifeCycleTracker tracker, CompactionRequest request) Called prior to writing theStoreFiles selected for compaction into a newStoreFile.voidCalled before a new namespace is created byHMaster.voidpreCreateTable(ObserverContext<MasterCoprocessorEnvironment> c, TableDescriptor desc, RegionInfo[] regions) Observer implementationsvoidpreDecommissionRegionServers(ObserverContext<MasterCoprocessorEnvironment> ctx, List<ServerName> servers, boolean offload) Called before decommission region servers.voidpreDelete(ObserverContext<RegionCoprocessorEnvironment> c, Delete delete, WALEdit edit, Durability durability) Called before the client deletes a value.voidpreDeleteNamespace(ObserverContext<MasterCoprocessorEnvironment> ctx, String namespace) Called beforeHMasterdeletes a namespacevoidCalled before a snapshot is deleted.voidpreDeleteTable(ObserverContext<MasterCoprocessorEnvironment> c, TableName tableName) Called beforeHMasterdeletes a table.voidCalled before disable a replication peervoidpreDisableTable(ObserverContext<MasterCoprocessorEnvironment> c, TableName tableName) Called prior to disabling a table.voidCalled before enable a replication peervoidpreEnableTable(ObserverContext<MasterCoprocessorEnvironment> c, TableName tableName) Called prior to enabling a table.com.google.protobuf.MessagepreEndpointInvocation(ObserverContext<RegionCoprocessorEnvironment> ctx, com.google.protobuf.Service service, String methodName, com.google.protobuf.Message request) Called before an Endpoint service method is invoked.voidThis will be called before executing proceduresbooleanpreExists(ObserverContext<RegionCoprocessorEnvironment> c, Get get, boolean exists) Called before the client tests for existence using a Get.voidCalled before the memstore is flushed to disk.voidCalled before a getLocks request has been processed.voidpreGetNamespaceDescriptor(ObserverContext<MasterCoprocessorEnvironment> ctx, String namespace) Called before a getNamespaceDescriptor request has been processed.voidpreGetOp(ObserverContext<RegionCoprocessorEnvironment> c, Get get, List<Cell> result) Called before the client performs a GetvoidCalled before a getProcedures request has been processed.voidCalled before get the configured ReplicationPeerConfig for the specified peervoidpreGetTableDescriptors(ObserverContext<MasterCoprocessorEnvironment> ctx, List<TableName> tableNamesList, List<TableDescriptor> descriptors, String regex) Called before a getTableDescriptors request has been processed.voidpreGetUserPermissions(ObserverContext<MasterCoprocessorEnvironment> ctx, String userName, String namespace, TableName tableName, byte[] family, byte[] qualifier) Called before getting user permissions.private voidpreGetUserPermissions(User caller, String userName, String namespace, TableName tableName, byte[] family, byte[] qualifier) voidpreGrant(ObserverContext<MasterCoprocessorEnvironment> ctx, UserPermission userPermission, boolean mergeExistingPermissions) Called before granting user permissions.private voidpreGrantOrRevoke(User caller, String request, UserPermission userPermission) voidpreHasUserPermissions(ObserverContext<MasterCoprocessorEnvironment> ctx, String userName, List<Permission> permissions) private voidpreHasUserPermissions(User caller, String userName, List<Permission> permissions) preIncrement(ObserverContext<RegionCoprocessorEnvironment> c, Increment increment) Called before Increment.voidCalled before getting if is rpc throttle enabled.voidCalled before list decommissioned region servers.voidCalled before list replication peers.voidCalled before listSnapshots request has been processed.voidpreLockHeartbeat(ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName, String description) Called before heartbeat to a lock.voidpreMergeRegions(ObserverContext<MasterCoprocessorEnvironment> ctx, RegionInfo[] regionsToMerge) Called before merge regions request.preModifyColumnFamilyStoreFileTracker(ObserverContext<MasterCoprocessorEnvironment> c, TableName tableName, byte[] family, String dstSFT) Called prior to modifying a family's store file tracker.voidCalled prior to modifying a namespace's properties.preModifyTable(ObserverContext<MasterCoprocessorEnvironment> c, TableName tableName, TableDescriptor currentDesc, TableDescriptor newDesc) Called prior to modifying a table's properties.preModifyTableStoreFileTracker(ObserverContext<MasterCoprocessorEnvironment> c, TableName tableName, String dstSFT) Called prior to modifying a table's store file tracker.voidpreMove(ObserverContext<MasterCoprocessorEnvironment> c, RegionInfo region, ServerName srcServer, ServerName destServer) Called prior to moving a given region from one region server to another.voidCalled before the region is reported as open to the master.voidAuthorization check for SecureBulkLoadProtocol.prepareBulkLoad()voidprePut(ObserverContext<RegionCoprocessorEnvironment> c, Put put, WALEdit edit, Durability durability) Called before the client stores a value.voidpreRecommissionRegionServer(ObserverContext<MasterCoprocessorEnvironment> ctx, ServerName server, List<byte[]> encodedRegionNames) Called before recommission region server.voidpreRegionOffline(ObserverContext<MasterCoprocessorEnvironment> c, RegionInfo regionInfo) Called prior to marking a given region as offline.voidCalled before remove a replication peervoidThis will be called before executing replication request to shipping log entries.voidpreRequestLock(ObserverContext<MasterCoprocessorEnvironment> ctx, String namespace, TableName tableName, RegionInfo[] regionInfos, String description) Called before new LockProcedure is queued.voidpreRestoreSnapshot(ObserverContext<MasterCoprocessorEnvironment> ctx, SnapshotDescription snapshot, TableDescriptor hTableDescriptor) Called before a snapshot is restored.voidpreRevoke(ObserverContext<MasterCoprocessorEnvironment> ctx, UserPermission userPermission) Called before revoking user permissions.voidThis will be called before executing user request to roll a region server WAL.voidCalled before the client closes a scanner.booleanpreScannerNext(ObserverContext<RegionCoprocessorEnvironment> c, InternalScanner s, List<Result> result, int limit, boolean hasNext) Called before the client asks for the next row on a scanner.voidCalled before the client opens a new scanner.voidpreSetNamespaceQuota(ObserverContext<MasterCoprocessorEnvironment> ctx, String namespace, GlobalQuotaSettings quotas) Called before the quota for the namespace is stored.voidpreSetRegionServerQuota(ObserverContext<MasterCoprocessorEnvironment> ctx, String regionServer, GlobalQuotaSettings quotas) Called before the quota for the region server is stored.voidpreSetSplitOrMergeEnabled(ObserverContext<MasterCoprocessorEnvironment> ctx, boolean newValue, MasterSwitchType switchType) Called prior to setting split / merge switch Supports Coprocessor 'bypass'.voidpreSetTableQuota(ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName, GlobalQuotaSettings quotas) Called before the quota for the table is stored.voidpreSetUserQuota(ObserverContext<MasterCoprocessorEnvironment> ctx, String userName, String namespace, GlobalQuotaSettings quotas) Called before the quota for the user on the specified namespace is stored.voidpreSetUserQuota(ObserverContext<MasterCoprocessorEnvironment> ctx, String userName, GlobalQuotaSettings quotas) Called before the quota for the user is stored.voidpreSetUserQuota(ObserverContext<MasterCoprocessorEnvironment> ctx, String userName, TableName tableName, GlobalQuotaSettings quotas) Called before the quota for the user on the specified table is stored.voidCalled prior to shutting down the full HBase cluster, including thisHMasterprocess.voidpreSnapshot(ObserverContext<MasterCoprocessorEnvironment> ctx, SnapshotDescription snapshot, TableDescriptor hTableDescriptor) Called before a new snapshot is taken.voidpreSplitRegion(ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName, byte[] splitRow) Called before the split region procedure is called.voidCalled immediately prior to stopping thisHMasterprocess.voidCalled before stopping region server.voidpreSwitchExceedThrottleQuota(ObserverContext<MasterCoprocessorEnvironment> ctx, boolean enable) Called before switching exceed throttle quota state.voidpreSwitchRpcThrottle(ObserverContext<MasterCoprocessorEnvironment> ctx, boolean enable) Called before switching rpc throttle enabled state.voidpreTableFlush(ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName) Called before the table memstore is flushed to disk.voidpreTruncateTable(ObserverContext<MasterCoprocessorEnvironment> c, TableName tableName) Called beforeHMastertruncates a table.voidpreUnassign(ObserverContext<MasterCoprocessorEnvironment> c, RegionInfo regionInfo) Called prior to unassigning a given region.voidpreUpdateMasterConfiguration(ObserverContext<MasterCoprocessorEnvironment> ctx, org.apache.hadoop.conf.Configuration preReloadConf) voidpreUpdateRegionServerConfiguration(ObserverContext<RegionServerCoprocessorEnvironment> ctx, org.apache.hadoop.conf.Configuration preReloadConf) Called before reloading the RegionServer'sConfigurationfrom diskvoidpreUpdateReplicationPeerConfig(ObserverContext<MasterCoprocessorEnvironment> ctx, String peerId, ReplicationPeerConfig peerConfig) Called before update peerConfig for the specified peervoidrequireAccess(ObserverContext<?> ctx, String request, TableName tableName, Permission.Action... permissions) voidrequireGlobalPermission(ObserverContext<?> ctx, String request, Permission.Action perm, String namespace) voidrequireGlobalPermission(ObserverContext<?> ctx, String request, Permission.Action perm, TableName tableName, Map<byte[], ? extends Collection<byte[]>> familyMap) voidrequireNamespacePermission(ObserverContext<?> ctx, String request, String namespace, Permission.Action... permissions) voidrequireNamespacePermission(ObserverContext<?> ctx, String request, String namespace, TableName tableName, Map<byte[], ? extends Collection<byte[]>> familyMap, Permission.Action... permissions) voidrequirePermission(ObserverContext<?> ctx, String request, Permission.Action perm) voidrequirePermission(ObserverContext<?> ctx, String request, TableName tableName, byte[] family, byte[] qualifier, Permission.Action... permissions) private voidVerify, when servicing an RPC, that the caller is the scanner owner.voidrequireTablePermission(ObserverContext<?> ctx, String request, TableName tableName, byte[] family, byte[] qualifier, Permission.Action... permissions) voidrevoke(com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.RevokeRequest request, com.google.protobuf.RpcCallback<org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.RevokeResponse> done) Deprecated.since 2.2.0 and will be removed in 4.0.0.voidCalled by theCoprocessorEnvironmentduring it's own startup to initialize the coprocessor.voidCalled by theCoprocessorEnvironmentduring it's own shutdown to stop the coprocessor.private voidupdateACL(RegionCoprocessorEnvironment e, Map<byte[], List<Cell>> familyMap) Writes all table ACLs for the tables in the given Map up into ZooKeeper znodes.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.hadoop.hbase.coprocessor.MasterObserver
postAddReplicationPeer, postAddRSGroup, postAssign, postBalance, postBalanceRSGroup, postBalanceSwitch, postClearDeadServers, postCloneSnapshot, postCompletedDeleteTableAction, postCompletedDisableTableAction, postCompletedEnableTableAction, postCompletedMergeRegionsAction, postCompletedModifyTableAction, postCompletedModifyTableAction, postCompletedSnapshotAction, postCompletedSplitRegionAction, postCompletedTruncateTableAction, postCreateNamespace, postCreateTable, postDecommissionRegionServers, postDeleteSnapshot, postDisableReplicationPeer, postDisableTable, postEnableReplicationPeer, postEnableTable, postGetClusterMetrics, postGetLocks, postGetNamespaceDescriptor, postGetProcedures, postGetReplicationPeerConfig, postGetUserPermissions, postGrant, postHasUserPermissions, postIsRpcThrottleEnabled, postListDecommissionedRegionServers, postListReplicationPeers, postListSnapshot, postLockHeartbeat, postMasterStoreFlush, postMergeRegions, postMergeRegionsCommitAction, postModifyColumnFamilyStoreFileTracker, postModifyNamespace, postModifyNamespace, 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, postSwitchExceedThrottleQuota, postSwitchRpcThrottle, postTableFlush, postTruncateRegion, postTruncateRegionAction, postUnassign, postUnassign, postUpdateMasterConfiguration, postUpdateReplicationPeerConfig, postUpdateRSGroupConfig, preAddRSGroup, preBalanceRSGroup, preCreateTableAction, preCreateTableRegionsInfos, preDeleteTableAction, preDisableTableAction, preEnableTableAction, preGetClusterMetrics, preGetTableNames, preListNamespaceDescriptors, preListNamespaces, preMasterInitialization, preMasterStoreFlush, preMergeRegionsAction, preMergeRegionsCommitAction, preModifyNamespace, preModifyTable, preModifyTableAction, preModifyTableAction, preMoveServers, preMoveServersAndTables, preMoveTables, preRemoveRSGroup, preRemoveServers, preRenameRSGroup, preSplitRegionAction, preSplitRegionAfterMETAAction, preSplitRegionBeforeMETAAction, preTruncateRegion, preTruncateRegionAction, preTruncateTableAction, preUnassign, preUpdateRSGroupConfigMethods inherited from interface org.apache.hadoop.hbase.coprocessor.RegionObserver
postAppend, postAppend, postBatchMutate, postBatchMutateIndispensably, postBulkLoadHFile, postCheckAndDelete, postCheckAndDelete, postCheckAndMutate, postCheckAndPut, postCheckAndPut, postClose, postCloseRegionOperation, postCommitStoreFile, postCompact, postCompactSelection, postDelete, postExists, postFlush, postFlush, postGetOp, postIncrement, postIncrement, postInstantiateDeleteTracker, postMemStoreCompaction, postMutationBeforeWAL, postPut, postReplayWALs, postScannerFilterRow, postScannerNext, postStartRegionOperation, postStoreFileReaderOpen, postWALRestore, preAppend, preAppendAfterRowLock, preCheckAndDelete, preCheckAndDeleteAfterRowLock, preCheckAndMutate, preCheckAndMutateAfterRowLock, preCheckAndPut, preCheckAndPutAfterRowLock, preCommitStoreFile, preCompactScannerOpen, preCompactSelection, preDelete, preFlush, preFlushScannerOpen, preIncrement, preIncrementAfterRowLock, preMemStoreCompaction, preMemStoreCompactionCompact, preMemStoreCompactionCompactScannerOpen, prePrepareTimeStampForDeleteVersion, prePut, preReplayWALs, preStoreFileReaderOpen, preStoreScannerOpen, preWALAppend, preWALRestoreMethods inherited from interface org.apache.hadoop.hbase.coprocessor.RegionServerObserver
postClearCompactionQueues, postClearRegionBlockCache, postExecuteProcedures, postReplicateLogEntries, postReplicationSinkBatchMutate, postUpdateRegionServerConfiguration, preReplicationSinkBatchMutate
-
Field Details
-
LOG
-
AUDITLOG
-
CHECK_COVERING_PERM
- See Also:
-
TAG_CHECK_PASSED
- See Also:
-
TRUE
-
accessChecker
-
zkPermissionWatcher
-
aclRegion
flags if we are running on a region of the _acl_ table -
regionEnv
defined only for Endpoint implementation, so it can have way to access region services -
scannerOwners
Mapping of scanner instances to the user who created them -
tableAcls
-
userProvider
Provider for mapping principal names to Users -
authorizationEnabled
if we are active, usually false, only true if "hbase.security.authorization" has been set to true in site configuration -
cellFeaturesEnabled
if we are able to support cell ACLs -
shouldCheckExecPermission
if we should check EXEC permissions -
compatibleEarlyTermination
if we should terminate access checks early as soon as table or CF grants allow access; pre-0.98 compatible behavior -
initialized
if we have been successfully initialized -
aclTabAvailable
if the ACL table is available, only relevant in the master
-
-
Constructor Details
-
AccessController
public AccessController()
-
-
Method Details
-
isCellAuthorizationSupported
-
getRegion
-
getAuthManager
-
initialize
- Throws:
IOException
-
updateACL
Writes all table ACLs for the tables in the given Map up into ZooKeeper znodes. This is called to synchronize ACL changes following_acl_table updates. -
permissionGranted
private AuthResult permissionGranted(AccessController.OpType opType, User user, RegionCoprocessorEnvironment e, Map<byte[], ? extends Collection<?>> families, Permission.Action... actions) Check the current user for authorization to perform a specific action against the given set of row data.- Parameters:
opType- the operation typeuser- the usere- the coprocessor environmentfamilies- the map of column families to qualifiers present in the requestactions- the desired actions- Returns:
- an authorization result
-
requireAccess
public void requireAccess(ObserverContext<?> ctx, String request, TableName tableName, Permission.Action... permissions) throws IOException - Throws:
IOException
-
requirePermission
public void requirePermission(ObserverContext<?> ctx, String request, Permission.Action perm) throws IOException - Throws:
IOException
-
requireGlobalPermission
public void requireGlobalPermission(ObserverContext<?> ctx, String request, Permission.Action perm, TableName tableName, Map<byte[], ? extends Collection<byte[]>> familyMap) throws IOException- Throws:
IOException
-
requireGlobalPermission
public void requireGlobalPermission(ObserverContext<?> ctx, String request, Permission.Action perm, String namespace) throws IOException - Throws:
IOException
-
requireNamespacePermission
public void requireNamespacePermission(ObserverContext<?> ctx, String request, String namespace, Permission.Action... permissions) throws IOException - Throws:
IOException
-
requireNamespacePermission
public void requireNamespacePermission(ObserverContext<?> ctx, String request, String namespace, TableName tableName, Map<byte[], ? extends Collection<byte[]>> familyMap, Permission.Action... permissions) throws IOException- Throws:
IOException
-
requirePermission
public void requirePermission(ObserverContext<?> ctx, String request, TableName tableName, byte[] family, byte[] qualifier, Permission.Action... permissions) throws IOException - Throws:
IOException
-
requireTablePermission
public void requireTablePermission(ObserverContext<?> ctx, String request, TableName tableName, byte[] family, byte[] qualifier, Permission.Action... permissions) throws IOException - Throws:
IOException
-
checkLockPermissions
public void checkLockPermissions(ObserverContext<?> ctx, String namespace, TableName tableName, RegionInfo[] regionInfos, String reason) throws IOException - Throws:
IOException
-
hasFamilyQualifierPermission
private boolean hasFamilyQualifierPermission(User user, Permission.Action perm, RegionCoprocessorEnvironment env, Map<byte[], ? extends Collection<byte[]>> familyMap) throws IOExceptionReturnstrueif the current user is allowed the given action over at least one of the column qualifiers in the given column families.- Throws:
IOException
-
checkCoveringPermission
private boolean checkCoveringPermission(User user, AccessController.OpType request, RegionCoprocessorEnvironment e, byte[] row, Map<byte[], ? extends Collection<?>> familyMap, long opTs, Permission.Action... actions) throws IOExceptionDetermine if cell ACLs covered by the operation grant access. This is expensive.- Returns:
- false if cell ACLs failed to grant access, true otherwise
- Throws:
IOException
-
addCellPermissions
-
checkForReservedTagPresence
- Throws:
IOException
-
start
Description copied from interface:CoprocessorCalled by theCoprocessorEnvironmentduring it's own startup to initialize the coprocessor.- Specified by:
startin interfaceCoprocessor- Throws:
IOException
-
stop
Description copied from interface:CoprocessorCalled by theCoprocessorEnvironmentduring it's own shutdown to stop the coprocessor.- Specified by:
stopin interfaceCoprocessor
-
getRegionObserver
Observer/Service Getters- Specified by:
getRegionObserverin interfaceRegionCoprocessor
-
getMasterObserver
- Specified by:
getMasterObserverin interfaceMasterCoprocessor
-
getEndpointObserver
- Specified by:
getEndpointObserverin interfaceRegionCoprocessor
-
getBulkLoadObserver
- Specified by:
getBulkLoadObserverin interfaceRegionCoprocessor
-
getRegionServerObserver
- Specified by:
getRegionServerObserverin interfaceRegionServerCoprocessor
-
getServices
Description copied from interface:CoprocessorCoprocessor endpoints providing protobuf services should override this method.- Specified by:
getServicesin interfaceCoprocessor- Returns:
- Iterable of
Services or empty collection. Implementations should never return null.
-
preCreateTable
public void preCreateTable(ObserverContext<MasterCoprocessorEnvironment> c, TableDescriptor desc, RegionInfo[] regions) throws IOException Observer implementations- Specified by:
preCreateTablein interfaceMasterObserver- Parameters:
c- the environment to interact with the framework and masterdesc- the TableDescriptor for the tableregions- the initial regions created for the table- Throws:
IOException
-
postCompletedCreateTableAction
public void postCompletedCreateTableAction(ObserverContext<MasterCoprocessorEnvironment> c, TableDescriptor desc, RegionInfo[] regions) throws IOException Description copied from interface:MasterObserverCalled after the createTable operation has been requested. Called as part of create table RPC call. Called as part of create table procedure and it is async to the create RPC call.- Specified by:
postCompletedCreateTableActionin interfaceMasterObserver- Parameters:
c- the environment to interact with the framework and masterdesc- the TableDescriptor for the tableregions- the initial regions created for the table- Throws:
IOException
-
preDeleteTable
public void preDeleteTable(ObserverContext<MasterCoprocessorEnvironment> c, TableName tableName) throws IOException Description copied from interface:MasterObserverCalled beforeHMasterdeletes a table. Called as part of delete table RPC call.- Specified by:
preDeleteTablein interfaceMasterObserver- Parameters:
c- the environment to interact with the framework and mastertableName- the name of the table- Throws:
IOException
-
postDeleteTable
public void postDeleteTable(ObserverContext<MasterCoprocessorEnvironment> c, TableName tableName) throws IOException Description copied from interface:MasterObserverCalled after the deleteTable operation has been requested. Called as part of delete table RPC call.- Specified by:
postDeleteTablein interfaceMasterObserver- Parameters:
c- the environment to interact with the framework and mastertableName- the name of the table- Throws:
IOException
-
preTruncateTable
public void preTruncateTable(ObserverContext<MasterCoprocessorEnvironment> c, TableName tableName) throws IOException Description copied from interface:MasterObserverCalled beforeHMastertruncates a table. Called as part of truncate table RPC call.- Specified by:
preTruncateTablein interfaceMasterObserver- Parameters:
c- the environment to interact with the framework and mastertableName- the name of the table- Throws:
IOException
-
postTruncateTable
public void postTruncateTable(ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName) throws IOException Description copied from interface:MasterObserverCalled after the truncateTable operation has been requested. Called as part of truncate table RPC call. The truncate is synchronous, so this method will be called when the truncate operation is terminated.- Specified by:
postTruncateTablein interfaceMasterObserver- Parameters:
ctx- the environment to interact with the framework and mastertableName- the name of the table- Throws:
IOException
-
preModifyTable
public TableDescriptor preModifyTable(ObserverContext<MasterCoprocessorEnvironment> c, TableName tableName, TableDescriptor currentDesc, TableDescriptor newDesc) throws IOException Description copied from interface:MasterObserverCalled prior to modifying a table's properties. Called as part of modify table RPC call.- Specified by:
preModifyTablein interfaceMasterObserver- Parameters:
c- the environment to interact with the framework and mastertableName- the name of the tablecurrentDesc- current TableDescriptor of the tablenewDesc- after modify operation, table will have this descriptor- Throws:
IOException
-
postModifyTable
public void postModifyTable(ObserverContext<MasterCoprocessorEnvironment> c, TableName tableName, TableDescriptor htd) throws IOException Description copied from interface:MasterObserverCalled after the modifyTable operation has been requested. Called as part of modify table RPC call.- Specified by:
postModifyTablein interfaceMasterObserver- Parameters:
c- the environment to interact with the framework and mastertableName- the name of the tablehtd- current TableDescriptor of the table- Throws:
IOException
-
preModifyTableStoreFileTracker
public String preModifyTableStoreFileTracker(ObserverContext<MasterCoprocessorEnvironment> c, TableName tableName, String dstSFT) throws IOException Description copied from interface:MasterObserverCalled prior to modifying a table's store file tracker. Called as part of modify table store file tracker RPC call.- Specified by:
preModifyTableStoreFileTrackerin interfaceMasterObserver- Parameters:
c- the environment to interact with the framework and mastertableName- the name of the tabledstSFT- the store file tracker- Returns:
- the store file tracker
- Throws:
IOException
-
preModifyColumnFamilyStoreFileTracker
public String preModifyColumnFamilyStoreFileTracker(ObserverContext<MasterCoprocessorEnvironment> c, TableName tableName, byte[] family, String dstSFT) throws IOException Description copied from interface:MasterObserverCalled prior to modifying a family's store file tracker. Called as part of modify family store file tracker RPC call.- Specified by:
preModifyColumnFamilyStoreFileTrackerin interfaceMasterObserver- Parameters:
c- the environment to interact with the framework and mastertableName- the name of the tablefamily- the column familydstSFT- the store file tracker- Returns:
- the store file tracker
- Throws:
IOException
-
preEnableTable
public void preEnableTable(ObserverContext<MasterCoprocessorEnvironment> c, TableName tableName) throws IOException Description copied from interface:MasterObserverCalled prior to enabling a table. Called as part of enable table RPC call.- Specified by:
preEnableTablein interfaceMasterObserver- Parameters:
c- the environment to interact with the framework and mastertableName- the name of the table- Throws:
IOException
-
preDisableTable
public void preDisableTable(ObserverContext<MasterCoprocessorEnvironment> c, TableName tableName) throws IOException Description copied from interface:MasterObserverCalled prior to disabling a table. Called as part of disable table RPC call.- Specified by:
preDisableTablein interfaceMasterObserver- Parameters:
c- the environment to interact with the framework and mastertableName- the name of the table- Throws:
IOException
-
preAbortProcedure
public void preAbortProcedure(ObserverContext<MasterCoprocessorEnvironment> ctx, long procId) throws IOException Description copied from interface:MasterObserverCalled before a abortProcedure request has been processed.- Specified by:
preAbortProcedurein interfaceMasterObserver- Parameters:
ctx- the environment to interact with the framework and masterprocId- the Id of the procedure- Throws:
IOException
-
postAbortProcedure
public void postAbortProcedure(ObserverContext<MasterCoprocessorEnvironment> ctx) throws IOException Description copied from interface:MasterObserverCalled after a abortProcedure request has been processed.- Specified by:
postAbortProcedurein interfaceMasterObserver- Parameters:
ctx- the environment to interact with the framework and master- Throws:
IOException
-
preGetProcedures
Description copied from interface:MasterObserverCalled before a getProcedures request has been processed.- Specified by:
preGetProceduresin interfaceMasterObserver- Parameters:
ctx- the environment to interact with the framework and master- Throws:
IOException
-
preGetLocks
Description copied from interface:MasterObserverCalled before a getLocks request has been processed.- Specified by:
preGetLocksin interfaceMasterObserver- Parameters:
ctx- the environment to interact with the framework and master- Throws:
IOException- if something went wrong
-
preMove
public void preMove(ObserverContext<MasterCoprocessorEnvironment> c, RegionInfo region, ServerName srcServer, ServerName destServer) throws IOException Description copied from interface:MasterObserverCalled prior to moving a given region from one region server to another.- Specified by:
preMovein interfaceMasterObserver- Parameters:
c- the environment to interact with the framework and masterregion- the RegionInfosrcServer- the source ServerNamedestServer- the destination ServerName- Throws:
IOException
-
preAssign
public void preAssign(ObserverContext<MasterCoprocessorEnvironment> c, RegionInfo regionInfo) throws IOException Description copied from interface:MasterObserverCalled prior to assigning a specific region.- Specified by:
preAssignin interfaceMasterObserver- Parameters:
c- the environment to interact with the framework and masterregionInfo- the regionInfo of the region- Throws:
IOException
-
preUnassign
public void preUnassign(ObserverContext<MasterCoprocessorEnvironment> c, RegionInfo regionInfo) throws IOException Description copied from interface:MasterObserverCalled prior to unassigning a given region.- Specified by:
preUnassignin interfaceMasterObserver- Parameters:
c- the environment to interact with the framework and master- Throws:
IOException
-
preRegionOffline
public void preRegionOffline(ObserverContext<MasterCoprocessorEnvironment> c, RegionInfo regionInfo) throws IOException Description copied from interface:MasterObserverCalled prior to marking a given region as offline.- Specified by:
preRegionOfflinein interfaceMasterObserver- Parameters:
c- the environment to interact with the framework and master- Throws:
IOException
-
preSetSplitOrMergeEnabled
public void preSetSplitOrMergeEnabled(ObserverContext<MasterCoprocessorEnvironment> ctx, boolean newValue, MasterSwitchType switchType) throws IOException Description copied from interface:MasterObserverCalled prior to setting split / merge switch Supports Coprocessor 'bypass'.- Specified by:
preSetSplitOrMergeEnabledin interfaceMasterObserver- Parameters:
ctx- the coprocessor instance's environmentnewValue- the new value submitted in the callswitchType- type of switch- Throws:
IOException
-
preBalance
public void preBalance(ObserverContext<MasterCoprocessorEnvironment> c, BalanceRequest request) throws IOException Description copied from interface:MasterObserverCalled prior to requesting rebalancing of the cluster regions, though after the initial checks for regions in transition and the balance switch flag.- Specified by:
preBalancein interfaceMasterObserver- Parameters:
c- the environment to interact with the framework and masterrequest- the request used to trigger the balancer- Throws:
IOException
-
preBalanceSwitch
public void preBalanceSwitch(ObserverContext<MasterCoprocessorEnvironment> c, boolean newValue) throws IOException Description copied from interface:MasterObserverCalled prior to modifying the flag used to enable/disable region balancing.- Specified by:
preBalanceSwitchin interfaceMasterObserver- Parameters:
c- the coprocessor instance's environment- Throws:
IOException
-
preShutdown
Description copied from interface:MasterObserverCalled prior to shutting down the full HBase cluster, including thisHMasterprocess.- Specified by:
preShutdownin interfaceMasterObserver- Throws:
IOException
-
preStopMaster
Description copied from interface:MasterObserverCalled immediately prior to stopping thisHMasterprocess.- Specified by:
preStopMasterin interfaceMasterObserver- Throws:
IOException
-
postStartMaster
Description copied from interface:MasterObserverCalled immediately after an active master instance has completed initialization. Will not be called on standby master instances unless they take over the active role.- Specified by:
postStartMasterin interfaceMasterObserver- Throws:
IOException
-
createACLTable
Create the ACL table- Throws:
IOException
-
preSnapshot
public void preSnapshot(ObserverContext<MasterCoprocessorEnvironment> ctx, SnapshotDescription snapshot, TableDescriptor hTableDescriptor) throws IOException Description copied from interface:MasterObserverCalled before a new snapshot is taken. Called as part of snapshot RPC call.- Specified by:
preSnapshotin interfaceMasterObserver- Parameters:
ctx- the environment to interact with the framework and mastersnapshot- the SnapshotDescriptor for the snapshothTableDescriptor- the TableDescriptor of the table to snapshot- Throws:
IOException
-
preListSnapshot
public void preListSnapshot(ObserverContext<MasterCoprocessorEnvironment> ctx, SnapshotDescription snapshot) throws IOException Description copied from interface:MasterObserverCalled before listSnapshots request has been processed.- Specified by:
preListSnapshotin interfaceMasterObserver- Parameters:
ctx- the environment to interact with the framework and mastersnapshot- the SnapshotDescriptor of the snapshot to list- Throws:
IOException
-
preCloneSnapshot
public void preCloneSnapshot(ObserverContext<MasterCoprocessorEnvironment> ctx, SnapshotDescription snapshot, TableDescriptor hTableDescriptor) throws IOException Description copied from interface:MasterObserverCalled before a snapshot is cloned. Called as part of restoreSnapshot RPC call.- Specified by:
preCloneSnapshotin interfaceMasterObserver- Parameters:
ctx- the environment to interact with the framework and mastersnapshot- the SnapshotDescriptor for the snapshothTableDescriptor- the TableDescriptor of the table to create- Throws:
IOException
-
preRestoreSnapshot
public void preRestoreSnapshot(ObserverContext<MasterCoprocessorEnvironment> ctx, SnapshotDescription snapshot, TableDescriptor hTableDescriptor) throws IOException Description copied from interface:MasterObserverCalled before a snapshot is restored. Called as part of restoreSnapshot RPC call.- Specified by:
preRestoreSnapshotin interfaceMasterObserver- Parameters:
ctx- the environment to interact with the framework and mastersnapshot- the SnapshotDescriptor for the snapshothTableDescriptor- the TableDescriptor of the table to restore- Throws:
IOException
-
preDeleteSnapshot
public void preDeleteSnapshot(ObserverContext<MasterCoprocessorEnvironment> ctx, SnapshotDescription snapshot) throws IOException Description copied from interface:MasterObserverCalled before a snapshot is deleted. Called as part of deleteSnapshot RPC call.- Specified by:
preDeleteSnapshotin interfaceMasterObserver- Parameters:
ctx- the environment to interact with the framework and mastersnapshot- the SnapshotDescriptor of the snapshot to delete- Throws:
IOException
-
preCreateNamespace
public void preCreateNamespace(ObserverContext<MasterCoprocessorEnvironment> ctx, NamespaceDescriptor ns) throws IOException Description copied from interface:MasterObserverCalled before a new namespace is created byHMaster.- Specified by:
preCreateNamespacein interfaceMasterObserver- Parameters:
ctx- the environment to interact with the framework and masterns- the NamespaceDescriptor for the table- Throws:
IOException
-
preDeleteNamespace
public void preDeleteNamespace(ObserverContext<MasterCoprocessorEnvironment> ctx, String namespace) throws IOException Description copied from interface:MasterObserverCalled beforeHMasterdeletes a namespace- Specified by:
preDeleteNamespacein interfaceMasterObserver- Parameters:
ctx- the environment to interact with the framework and masternamespace- the name of the namespace- Throws:
IOException
-
postDeleteNamespace
public void postDeleteNamespace(ObserverContext<MasterCoprocessorEnvironment> ctx, String namespace) throws IOException Description copied from interface:MasterObserverCalled after the deleteNamespace operation has been requested.- Specified by:
postDeleteNamespacein interfaceMasterObserver- Parameters:
ctx- the environment to interact with the framework and masternamespace- the name of the namespace- Throws:
IOException
-
preModifyNamespace
public void preModifyNamespace(ObserverContext<MasterCoprocessorEnvironment> ctx, NamespaceDescriptor ns) throws IOException Description copied from interface:MasterObserverCalled prior to modifying a namespace's properties.- Specified by:
preModifyNamespacein interfaceMasterObserver- Parameters:
ctx- the environment to interact with the framework and masterns- after modify operation, namespace will have this descriptor- Throws:
IOException
-
preGetNamespaceDescriptor
public void preGetNamespaceDescriptor(ObserverContext<MasterCoprocessorEnvironment> ctx, String namespace) throws IOException Description copied from interface:MasterObserverCalled before a getNamespaceDescriptor request has been processed.- Specified by:
preGetNamespaceDescriptorin interfaceMasterObserver- Parameters:
ctx- the environment to interact with the framework and masternamespace- the name of the namespace- Throws:
IOException
-
postListNamespaces
public void postListNamespaces(ObserverContext<MasterCoprocessorEnvironment> ctx, List<String> namespaces) throws IOException Description copied from interface:MasterObserverCalled after a listNamespaces request has been processed.- Specified by:
postListNamespacesin interfaceMasterObserver- Parameters:
ctx- the environment to interact with the framework and masternamespaces- the list of namespaces about to be returned- Throws:
IOException- if something went wrong
-
postListNamespaceDescriptors
public void postListNamespaceDescriptors(ObserverContext<MasterCoprocessorEnvironment> ctx, List<NamespaceDescriptor> descriptors) throws IOException Description copied from interface:MasterObserverCalled after a listNamespaceDescriptors request has been processed.- Specified by:
postListNamespaceDescriptorsin interfaceMasterObserver- Parameters:
ctx- the environment to interact with the framework and masterdescriptors- the list of descriptors about to be returned- Throws:
IOException
-
preTableFlush
public void preTableFlush(ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName) throws IOException Description copied from interface:MasterObserverCalled before the table memstore is flushed to disk.- Specified by:
preTableFlushin interfaceMasterObserver- Parameters:
ctx- the environment to interact with the framework and mastertableName- the name of the table- Throws:
IOException
-
preSplitRegion
public void preSplitRegion(ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName, byte[] splitRow) throws IOException Description copied from interface:MasterObserverCalled before the split region procedure is called.- Specified by:
preSplitRegionin interfaceMasterObserver- Parameters:
ctx- the environment to interact with the framework and mastertableName- the table where the region belongs tosplitRow- split point- Throws:
IOException
-
preClearDeadServers
public void preClearDeadServers(ObserverContext<MasterCoprocessorEnvironment> ctx) throws IOException Description copied from interface:MasterObserverCalled before clear dead region servers.- Specified by:
preClearDeadServersin interfaceMasterObserver- Throws:
IOException
-
preDecommissionRegionServers
public void preDecommissionRegionServers(ObserverContext<MasterCoprocessorEnvironment> ctx, List<ServerName> servers, boolean offload) throws IOException Description copied from interface:MasterObserverCalled before decommission region servers.- Specified by:
preDecommissionRegionServersin interfaceMasterObserver- Throws:
IOException
-
preListDecommissionedRegionServers
public void preListDecommissionedRegionServers(ObserverContext<MasterCoprocessorEnvironment> ctx) throws IOException Description copied from interface:MasterObserverCalled before list decommissioned region servers.- Specified by:
preListDecommissionedRegionServersin interfaceMasterObserver- Throws:
IOException
-
preRecommissionRegionServer
public void preRecommissionRegionServer(ObserverContext<MasterCoprocessorEnvironment> ctx, ServerName server, List<byte[]> encodedRegionNames) throws IOException Description copied from interface:MasterObserverCalled before recommission region server.- Specified by:
preRecommissionRegionServerin interfaceMasterObserver- Throws:
IOException
-
preOpen
Description copied from interface:RegionObserverCalled before the region is reported as open to the master.- Specified by:
preOpenin interfaceRegionObserver- Parameters:
c- the environment provided by the region server- Throws:
IOException
-
postOpen
Description copied from interface:RegionObserverCalled after the region is reported as open to the master.- Specified by:
postOpenin interfaceRegionObserver- Parameters:
c- the environment provided by the region server
-
preFlush
public void preFlush(ObserverContext<RegionCoprocessorEnvironment> c, FlushLifeCycleTracker tracker) throws IOException Description copied from interface:RegionObserverCalled before the memstore is flushed to disk.- Specified by:
preFlushin interfaceRegionObserver- Parameters:
c- the environment provided by the region servertracker- tracker used to track the life cycle of a flush- Throws:
IOException
-
preCompact
public InternalScanner preCompact(ObserverContext<RegionCoprocessorEnvironment> c, Store store, InternalScanner scanner, ScanType scanType, CompactionLifeCycleTracker tracker, CompactionRequest request) throws IOException Description copied from interface:RegionObserverCalled prior to writing theStoreFiles selected for compaction into a newStoreFile.To override or modify the compaction process, implementing classes can wrap the provided
InternalScannerwith a custom implementation that is returned from this method. The custom scanner can then inspectCells from the wrapped scanner, applying its own policy to what gets written.If implementations are wrapping the passed in
InternalScanner, they can also have their implementation implementShipperand delegate to the original scanner. This will cause compactions to free up memory as they progress, which is especially important for people using off-heap memory pools.Keep in mind that when
Shipper.shipped()is called, any cell references you maintain in your implementation may get corrupted. As such you should make sure to deep clone any cells that you need to keep reference to across invocations of shipped.- Specified by:
preCompactin interfaceRegionObserver- Parameters:
c- the environment provided by the region serverstore- the store being compactedscanner- the scanner over existing data used in the store file rewritingscanType- type of Scantracker- tracker used to track the life cycle of a compactionrequest- the requested compaction- Returns:
- the scanner to use during compaction. Should not be
nullunless the implementation is writing new store files on its own. - Throws:
IOException
-
internalPreRead
private void internalPreRead(ObserverContext<RegionCoprocessorEnvironment> c, Query query, AccessController.OpType opType) throws IOException - Throws:
IOException
-
preGetOp
public void preGetOp(ObserverContext<RegionCoprocessorEnvironment> c, Get get, List<Cell> result) throws IOException Description copied from interface:RegionObserverCalled before the client performs a GetCall CoprocessorEnvironment#bypass to skip default actions. If 'bypass' is set, we skip out on calling any subsequent chained coprocessors.
- Specified by:
preGetOpin interfaceRegionObserver- Parameters:
c- the environment provided by the region serverget- the Get requestresult- The result to return to the client if default processing is bypassed. Can be modified. Will not be used if default processing is not bypassed.- Throws:
IOException
-
preExists
public boolean preExists(ObserverContext<RegionCoprocessorEnvironment> c, Get get, boolean exists) throws IOException Description copied from interface:RegionObserverCalled before the client tests for existence using a Get.Call CoprocessorEnvironment#bypass to skip default actions. If 'bypass' is set, we skip out on calling any subsequent chained coprocessors.
- Specified by:
preExistsin interfaceRegionObserver- Parameters:
c- the environment provided by the region serverget- the Get requestexists- the result returned by the region server- Returns:
- the value to return to the client if bypassing default processing
- Throws:
IOException
-
prePut
public void prePut(ObserverContext<RegionCoprocessorEnvironment> c, Put put, WALEdit edit, Durability durability) throws IOException Description copied from interface:RegionObserverCalled before the client stores a value.Call CoprocessorEnvironment#bypass to skip default actions. If 'bypass' is set, we skip out on calling any subsequent chained coprocessors.
Note: Do not retain references to any Cells in 'put' beyond the life of this invocation. If need a Cell reference for later use, copy the cell and use that.
- Specified by:
prePutin interfaceRegionObserver- Parameters:
c- the environment provided by the region serverput- The Put objectedit- The WALEdit object that will be written to the waldurability- Persistence guarantee for this Put- Throws:
IOException
-
postPut
public void postPut(ObserverContext<RegionCoprocessorEnvironment> c, Put put, WALEdit edit, Durability durability) Description copied from interface:RegionObserverCalled after the client stores a value.Note: Do not retain references to any Cells in 'put' beyond the life of this invocation. If need a Cell reference for later use, copy the cell and use that.
- Specified by:
postPutin interfaceRegionObserver- Parameters:
c- the environment provided by the region serverput- The Put objectedit- The WALEdit object for the waldurability- Persistence guarantee for this Put
-
preDelete
public void preDelete(ObserverContext<RegionCoprocessorEnvironment> c, Delete delete, WALEdit edit, Durability durability) throws IOException Description copied from interface:RegionObserverCalled before the client deletes a value.Call CoprocessorEnvironment#bypass to skip default actions. If 'bypass' is set, we skip out on calling any subsequent chained coprocessors.
Note: Do not retain references to any Cells in 'delete' beyond the life of this invocation. If need a Cell reference for later use, copy the cell and use that.
- Specified by:
preDeletein interfaceRegionObserver- Parameters:
c- the environment provided by the region serverdelete- The Delete objectedit- The WALEdit object for the waldurability- Persistence guarantee for this Delete- Throws:
IOException
-
preBatchMutate
public void preBatchMutate(ObserverContext<RegionCoprocessorEnvironment> c, MiniBatchOperationInProgress<Mutation> miniBatchOp) throws IOException Description copied from interface:RegionObserverThis will be called for every batch mutation operation happening at the server. This will be called after acquiring the locks on the mutating rows and after applying the proper timestamp for each Mutation at the server. The batch may contain Put/Delete/Increment/Append. By setting OperationStatus of Mutations (MiniBatchOperationInProgress.setOperationStatus(int, OperationStatus)),RegionObservercan make Region to skip these Mutations.Note: Do not retain references to any Cells in Mutations beyond the life of this invocation. If need a Cell reference for later use, copy the cell and use that.
- Specified by:
preBatchMutatein interfaceRegionObserver- Parameters:
c- the environment provided by the region serverminiBatchOp- batch of Mutations getting applied to region.- Throws:
IOException
-
postDelete
public void postDelete(ObserverContext<RegionCoprocessorEnvironment> c, Delete delete, WALEdit edit, Durability durability) throws IOException Description copied from interface:RegionObserverCalled after the client deletes a value.Note: Do not retain references to any Cells in 'delete' beyond the life of this invocation. If need a Cell reference for later use, copy the cell and use that.
- Specified by:
postDeletein interfaceRegionObserver- Parameters:
c- the environment provided by the region serverdelete- The Delete objectedit- The WALEdit object for the waldurability- Persistence guarantee for this Delete- Throws:
IOException
-
preCheckAndPut
public boolean preCheckAndPut(ObserverContext<RegionCoprocessorEnvironment> c, byte[] row, byte[] family, byte[] qualifier, CompareOperator op, ByteArrayComparable comparator, Put put, boolean result) throws IOException Description copied from interface:RegionObserverCalled before checkAndPut.Call CoprocessorEnvironment#bypass to skip default actions. If 'bypass' is set, we skip out on calling any subsequent chained coprocessors.
Note: Do not retain references to any Cells in 'put' beyond the life of this invocation. If need a Cell reference for later use, copy the cell and use that.
- Specified by:
preCheckAndPutin interfaceRegionObserver- Parameters:
c- the environment provided by the region serverrow- row to checkfamily- column familyqualifier- column qualifierop- the comparison operationcomparator- the comparatorput- data to put if check succeedsresult- the default value of the result- Returns:
- the return value to return to client if bypassing default processing
- Throws:
IOException
-
preCheckAndPutAfterRowLock
public boolean preCheckAndPutAfterRowLock(ObserverContext<RegionCoprocessorEnvironment> c, byte[] row, byte[] family, byte[] qualifier, CompareOperator opp, ByteArrayComparable comparator, Put put, boolean result) throws IOException Description copied from interface:RegionObserverCalled before checkAndPut but after acquiring rowlock.Note: Caution to be taken for not doing any long time operation in this hook. Row will be locked for longer time. Trying to acquire lock on another row, within this, can lead to potential deadlock.
Call CoprocessorEnvironment#bypass to skip default actions. If 'bypass' is set, we skip out on calling any subsequent chained coprocessors.
Note: Do not retain references to any Cells in 'put' beyond the life of this invocation. If need a Cell reference for later use, copy the cell and use that.
- Specified by:
preCheckAndPutAfterRowLockin interfaceRegionObserver- Parameters:
c- the environment provided by the region serverrow- row to checkfamily- column familyqualifier- column qualifieropp- the comparison operationcomparator- the comparatorput- data to put if check succeedsresult- the default value of the result- Returns:
- the return value to return to client if bypassing default processing
- Throws:
IOException
-
preCheckAndDelete
public boolean preCheckAndDelete(ObserverContext<RegionCoprocessorEnvironment> c, byte[] row, byte[] family, byte[] qualifier, CompareOperator op, ByteArrayComparable comparator, Delete delete, boolean result) throws IOException Description copied from interface:RegionObserverCalled before checkAndDelete.Call CoprocessorEnvironment#bypass to skip default actions. If 'bypass' is set, we skip out on calling any subsequent chained coprocessors.
Note: Do not retain references to any Cells in 'delete' beyond the life of this invocation. If need a Cell reference for later use, copy the cell and use that.
- Specified by:
preCheckAndDeletein interfaceRegionObserver- Parameters:
c- the environment provided by the region serverrow- row to checkfamily- column familyqualifier- column qualifierop- the comparison operationcomparator- the comparatordelete- delete to commit if check succeedsresult- the default value of the result- Returns:
- the value to return to client if bypassing default processing
- Throws:
IOException
-
preCheckAndDeleteAfterRowLock
public boolean preCheckAndDeleteAfterRowLock(ObserverContext<RegionCoprocessorEnvironment> c, byte[] row, byte[] family, byte[] qualifier, CompareOperator op, ByteArrayComparable comparator, Delete delete, boolean result) throws IOException Description copied from interface:RegionObserverCalled before checkAndDelete but after acquiring rowock.Note: Caution to be taken for not doing any long time operation in this hook. Row will be locked for longer time. Trying to acquire lock on another row, within this, can lead to potential deadlock.
Call CoprocessorEnvironment#bypass to skip default actions. If 'bypass' is set, we skip out on calling any subsequent chained coprocessors.
Note: Do not retain references to any Cells in 'delete' beyond the life of this invocation. If need a Cell reference for later use, copy the cell and use that.
- Specified by:
preCheckAndDeleteAfterRowLockin interfaceRegionObserver- Parameters:
c- the environment provided by the region serverrow- row to checkfamily- column familyqualifier- column qualifierop- the comparison operationcomparator- the comparatordelete- delete to commit if check succeedsresult- the default value of the result- Returns:
- the value to return to client if bypassing default processing
- Throws:
IOException
-
preAppend
public Result preAppend(ObserverContext<RegionCoprocessorEnvironment> c, Append append) throws IOException Description copied from interface:RegionObserverCalled before Append.Call CoprocessorEnvironment#bypass to skip default actions. If 'bypass' is set, we skip out on calling any subsequent chained coprocessors.
Note: Do not retain references to any Cells in 'append' beyond the life of this invocation. If need a Cell reference for later use, copy the cell and use that.
- Specified by:
preAppendin interfaceRegionObserver- Parameters:
c- the environment provided by the region serverappend- Append object- Returns:
- result to return to the client if bypassing default processing
- Throws:
IOException
-
preIncrement
public Result preIncrement(ObserverContext<RegionCoprocessorEnvironment> c, Increment increment) throws IOException Description copied from interface:RegionObserverCalled before Increment.Call CoprocessorEnvironment#bypass to skip default actions. If 'bypass' is set, we skip out on calling any subsequent chained coprocessors.
Note: Do not retain references to any Cells in 'increment' beyond the life of this invocation. If need a Cell reference for later use, copy the cell and use that.
- Specified by:
preIncrementin interfaceRegionObserver- Parameters:
c- the environment provided by the region serverincrement- increment object- Returns:
- result to return to the client if bypassing default processing
- Throws:
IOException
-
postIncrementBeforeWAL
public List<Pair<Cell,Cell>> postIncrementBeforeWAL(ObserverContext<RegionCoprocessorEnvironment> ctx, Mutation mutation, List<Pair<Cell, Cell>> cellPairs) throws IOExceptionDescription copied from interface:RegionObserverCalled after a list of new cells has been created during an increment operation, but before they are committed to the WAL or memstore.- Specified by:
postIncrementBeforeWALin interfaceRegionObserver- Parameters:
ctx- the environment provided by the region servermutation- the current mutationcellPairs- a list of cell pair. The first cell is old cell which may be null. And the second cell is the new cell.- Returns:
- a list of cell pair, possibly changed.
- Throws:
IOException
-
postAppendBeforeWAL
public List<Pair<Cell,Cell>> postAppendBeforeWAL(ObserverContext<RegionCoprocessorEnvironment> ctx, Mutation mutation, List<Pair<Cell, Cell>> cellPairs) throws IOExceptionDescription copied from interface:RegionObserverCalled after a list of new cells has been created during an append operation, but before they are committed to the WAL or memstore.- Specified by:
postAppendBeforeWALin interfaceRegionObserver- Parameters:
ctx- the environment provided by the region servermutation- the current mutationcellPairs- a list of cell pair. The first cell is old cell which may be null. And the second cell is the new cell.- Returns:
- a list of cell pair, possibly changed.
- Throws:
IOException
-
createNewCellWithTags
-
preScannerOpen
public void preScannerOpen(ObserverContext<RegionCoprocessorEnvironment> c, Scan scan) throws IOException Description copied from interface:RegionObserverCalled before the client opens a new scanner.Note: Do not retain references to any Cells returned by scanner, beyond the life of this invocation. If need a Cell reference for later use, copy the cell and use that.
- Specified by:
preScannerOpenin interfaceRegionObserver- Parameters:
c- the environment provided by the region serverscan- the Scan specification- Throws:
IOException
-
postScannerOpen
public RegionScanner postScannerOpen(ObserverContext<RegionCoprocessorEnvironment> c, Scan scan, RegionScanner s) throws IOException Description copied from interface:RegionObserverCalled after the client opens a new scanner.Note: Do not retain references to any Cells returned by scanner, beyond the life of this invocation. If need a Cell reference for later use, copy the cell and use that.
- Specified by:
postScannerOpenin interfaceRegionObserver- Parameters:
c- the environment provided by the region serverscan- the Scan specifications- if not null, the base scanner- Returns:
- the scanner instance to use
- Throws:
IOException
-
preScannerNext
public boolean preScannerNext(ObserverContext<RegionCoprocessorEnvironment> c, InternalScanner s, List<Result> result, int limit, boolean hasNext) throws IOException Description copied from interface:RegionObserverCalled before the client asks for the next row on a scanner.Call CoprocessorEnvironment#bypass to skip default actions. If 'bypass' is set, we skip out on calling any subsequent chained coprocessors.
Note: Do not retain references to any Cells returned by scanner, beyond the life of this invocation. If need a Cell reference for later use, copy the cell and use that.
- Specified by:
preScannerNextin interfaceRegionObserver- Parameters:
c- the environment provided by the region servers- the scannerresult- The result to return to the client if default processing is bypassed. Can be modified. Will not be returned if default processing is not bypassed.limit- the maximum number of results to returnhasNext- the 'has more' indication- Returns:
- 'has more' indication that should be sent to client
- Throws:
IOException
-
preScannerClose
public void preScannerClose(ObserverContext<RegionCoprocessorEnvironment> c, InternalScanner s) throws IOException Description copied from interface:RegionObserverCalled before the client closes a scanner.Call CoprocessorEnvironment#bypass to skip default actions. If 'bypass' is set, we skip out on calling any subsequent chained coprocessors.
- Specified by:
preScannerClosein interfaceRegionObserver- Parameters:
c- the environment provided by the region servers- the scanner- Throws:
IOException
-
postScannerClose
public void postScannerClose(ObserverContext<RegionCoprocessorEnvironment> c, InternalScanner s) throws IOException Description copied from interface:RegionObserverCalled after the client closes a scanner.- Specified by:
postScannerClosein interfaceRegionObserver- Parameters:
c- the environment provided by the region servers- the scanner- Throws:
IOException
-
requireScannerOwner
Verify, when servicing an RPC, that the caller is the scanner owner. If so, we assume that access control is correctly enforced based on the checks performed in preScannerOpen()- Throws:
AccessDeniedException
-
preBulkLoadHFile
public void preBulkLoadHFile(ObserverContext<RegionCoprocessorEnvironment> ctx, List<Pair<byte[], String>> familyPaths) throws IOExceptionVerifies user has CREATE or ADMIN privileges on the Column Families involved in the bulkLoadHFile request. Specific Column Write privileges are presently ignored.- Specified by:
preBulkLoadHFilein interfaceRegionObserver- Parameters:
ctx- the environment provided by the region serverfamilyPaths- pairs of { CF, HFile path } submitted for bulk load. Adding or removing from this list will add or remove HFiles to be bulk loaded.- Throws:
IOException
-
prePrepareBulkLoad
public void prePrepareBulkLoad(ObserverContext<RegionCoprocessorEnvironment> ctx) throws IOException Authorization check for SecureBulkLoadProtocol.prepareBulkLoad()- Specified by:
prePrepareBulkLoadin interfaceBulkLoadObserver- Parameters:
ctx- the context- Throws:
IOException
-
preCleanupBulkLoad
public void preCleanupBulkLoad(ObserverContext<RegionCoprocessorEnvironment> ctx) throws IOException Authorization security check for SecureBulkLoadProtocol.cleanupBulkLoad()- Specified by:
preCleanupBulkLoadin interfaceBulkLoadObserver- Parameters:
ctx- the context- Throws:
IOException
-
preEndpointInvocation
public com.google.protobuf.Message preEndpointInvocation(ObserverContext<RegionCoprocessorEnvironment> ctx, com.google.protobuf.Service service, String methodName, com.google.protobuf.Message request) throws IOException Description copied from interface:EndpointObserverCalled before an Endpoint service method is invoked. The request message can be altered by returning a new instance. Throwing an exception will abort the invocation. CallingObserverContext.bypass()has no effect in this hook.- Specified by:
preEndpointInvocationin interfaceEndpointObserver- Parameters:
ctx- the environment provided by the region serverservice- the endpoint servicemethodName- the invoked service methodrequest- Request message expected by givenService's method (by the namemethodName).- Returns:
- the possibly modified message
- Throws:
IOException
-
postEndpointInvocation
public void postEndpointInvocation(ObserverContext<RegionCoprocessorEnvironment> ctx, com.google.protobuf.Service service, String methodName, com.google.protobuf.Message request, com.google.protobuf.Message.Builder responseBuilder) throws IOException Description copied from interface:EndpointObserverCalled after an Endpoint service method is invoked. The response message can be altered using the builder.- Specified by:
postEndpointInvocationin interfaceEndpointObserver- Parameters:
ctx- the environment provided by the region serverservice- the endpoint servicemethodName- the invoked service methodrequest- Request message expected by givenService's method (by the namemethodName).responseBuilder- Builder for final response to the client, with original response from Service's method merged into it.- Throws:
IOException
-
grant
@Deprecated public void grant(com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.GrantRequest request, com.google.protobuf.RpcCallback<org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.GrantResponse> done) Deprecated.since 2.2.0 and will be removed in 4.0.0. UseAdmin.grant(UserPermission, boolean)instead.- Specified by:
grantin interfaceorg.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.AccessControlService.Interface- See Also:
-
revoke
@Deprecated public void revoke(com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.RevokeRequest request, com.google.protobuf.RpcCallback<org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.RevokeResponse> done) Deprecated.since 2.2.0 and will be removed in 4.0.0. UseAdmin.revoke(UserPermission)instead.- Specified by:
revokein interfaceorg.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.AccessControlService.Interface- See Also:
-
getUserPermissions
@Deprecated public void getUserPermissions(com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.GetUserPermissionsRequest request, com.google.protobuf.RpcCallback<org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.GetUserPermissionsResponse> done) Deprecated.since 2.2.0 and will be removed in 4.0.0. UseAdmin.getUserPermissions(GetUserPermissionsRequest)instead.- Specified by:
getUserPermissionsin interfaceorg.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.AccessControlService.Interface- See Also:
-
checkPermissions
@Deprecated public void checkPermissions(com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.CheckPermissionsRequest request, com.google.protobuf.RpcCallback<org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.CheckPermissionsResponse> done) Deprecated.since 2.2.0 and will be removed 4.0.0. UseAdmin.hasUserPermissions(List)instead.- Specified by:
checkPermissionsin interfaceorg.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.AccessControlService.Interface- See Also:
-
getRegion
-
getTableName
-
getTableName
-
preClose
public void preClose(ObserverContext<RegionCoprocessorEnvironment> c, boolean abortRequested) throws IOException Description copied from interface:RegionObserverCalled before the region is reported as closed to the master.- Specified by:
preClosein interfaceRegionObserver- Parameters:
c- the environment provided by the region serverabortRequested- true if the region server is aborting- Throws:
IOException
-
checkSystemOrSuperUser
- Throws:
IOException
-
preStopRegionServer
public void preStopRegionServer(ObserverContext<RegionServerCoprocessorEnvironment> ctx) throws IOException Description copied from interface:RegionServerObserverCalled before stopping region server.- Specified by:
preStopRegionServerin interfaceRegionServerObserver- Parameters:
ctx- the environment to interact with the framework and region server.- Throws:
IOException
-
makeFamilyMap
-
preGetTableDescriptors
public void preGetTableDescriptors(ObserverContext<MasterCoprocessorEnvironment> ctx, List<TableName> tableNamesList, List<TableDescriptor> descriptors, String regex) throws IOException Description copied from interface:MasterObserverCalled before a getTableDescriptors request has been processed.- Specified by:
preGetTableDescriptorsin interfaceMasterObserver- Parameters:
ctx- the environment to interact with the framework and mastertableNamesList- the list of table names, or null if querying for alldescriptors- an empty list, can be filled with what to return in coprocessorregex- regular expression used for filtering the table names- Throws:
IOException
-
postGetTableDescriptors
public void postGetTableDescriptors(ObserverContext<MasterCoprocessorEnvironment> ctx, List<TableName> tableNamesList, List<TableDescriptor> descriptors, String regex) throws IOException Description copied from interface:MasterObserverCalled after a getTableDescriptors request has been processed.- Specified by:
postGetTableDescriptorsin interfaceMasterObserver- Parameters:
ctx- the environment to interact with the framework and mastertableNamesList- the list of table names, or null if querying for alldescriptors- the list of descriptors about to be returnedregex- regular expression used for filtering the table names- Throws:
IOException
-
postGetTableNames
public void postGetTableNames(ObserverContext<MasterCoprocessorEnvironment> ctx, List<TableDescriptor> descriptors, String regex) throws IOException Description copied from interface:MasterObserverCalled after a getTableNames request has been processed.- Specified by:
postGetTableNamesin interfaceMasterObserver- Parameters:
ctx- the environment to interact with the framework and masterdescriptors- the list of descriptors about to be returnedregex- regular expression used for filtering the table names- Throws:
IOException
-
preMergeRegions
public void preMergeRegions(ObserverContext<MasterCoprocessorEnvironment> ctx, RegionInfo[] regionsToMerge) throws IOException Description copied from interface:MasterObserverCalled before merge regions request.- Specified by:
preMergeRegionsin interfaceMasterObserver- Parameters:
ctx- coprocessor environmentregionsToMerge- regions to be merged- Throws:
IOException
-
preRollWALWriterRequest
public void preRollWALWriterRequest(ObserverContext<RegionServerCoprocessorEnvironment> ctx) throws IOException Description copied from interface:RegionServerObserverThis will be called before executing user request to roll a region server WAL.- Specified by:
preRollWALWriterRequestin interfaceRegionServerObserver- Parameters:
ctx- the environment to interact with the framework and region server.- Throws:
IOException
-
postRollWALWriterRequest
public void postRollWALWriterRequest(ObserverContext<RegionServerCoprocessorEnvironment> ctx) throws IOException Description copied from interface:RegionServerObserverThis will be called after executing user request to roll a region server WAL.- Specified by:
postRollWALWriterRequestin interfaceRegionServerObserver- Parameters:
ctx- the environment to interact with the framework and region server.- Throws:
IOException
-
preSetUserQuota
public void preSetUserQuota(ObserverContext<MasterCoprocessorEnvironment> ctx, String userName, GlobalQuotaSettings quotas) throws IOException Description copied from interface:MasterObserverCalled before the quota for the user is stored.- Specified by:
preSetUserQuotain interfaceMasterObserver- Parameters:
ctx- the environment to interact with the framework and masteruserName- the name of userquotas- the current quota for the user- Throws:
IOException
-
preSetUserQuota
public void preSetUserQuota(ObserverContext<MasterCoprocessorEnvironment> ctx, String userName, TableName tableName, GlobalQuotaSettings quotas) throws IOException Description copied from interface:MasterObserverCalled before the quota for the user on the specified table is stored.- Specified by:
preSetUserQuotain interfaceMasterObserver- Parameters:
ctx- the environment to interact with the framework and masteruserName- the name of usertableName- the name of the tablequotas- the current quota for the user on the table- Throws:
IOException
-
preSetUserQuota
public void preSetUserQuota(ObserverContext<MasterCoprocessorEnvironment> ctx, String userName, String namespace, GlobalQuotaSettings quotas) throws IOException Description copied from interface:MasterObserverCalled before the quota for the user on the specified namespace is stored.- Specified by:
preSetUserQuotain interfaceMasterObserver- Parameters:
ctx- the environment to interact with the framework and masteruserName- the name of usernamespace- the name of the namespacequotas- the current quota for the user on the namespace- Throws:
IOException
-
preSetTableQuota
public void preSetTableQuota(ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName, GlobalQuotaSettings quotas) throws IOException Description copied from interface:MasterObserverCalled before the quota for the table is stored.- Specified by:
preSetTableQuotain interfaceMasterObserver- Parameters:
ctx- the environment to interact with the framework and mastertableName- the name of the tablequotas- the current quota for the table- Throws:
IOException
-
preSetNamespaceQuota
public void preSetNamespaceQuota(ObserverContext<MasterCoprocessorEnvironment> ctx, String namespace, GlobalQuotaSettings quotas) throws IOException Description copied from interface:MasterObserverCalled before the quota for the namespace is stored.- Specified by:
preSetNamespaceQuotain interfaceMasterObserver- Parameters:
ctx- the environment to interact with the framework and masternamespace- the name of the namespacequotas- the current quota for the namespace- Throws:
IOException
-
preSetRegionServerQuota
public void preSetRegionServerQuota(ObserverContext<MasterCoprocessorEnvironment> ctx, String regionServer, GlobalQuotaSettings quotas) throws IOException Description copied from interface:MasterObserverCalled before the quota for the region server is stored.- Specified by:
preSetRegionServerQuotain interfaceMasterObserver- Parameters:
ctx- the environment to interact with the framework and masterregionServer- the name of the region serverquotas- the current quota for the region server- Throws:
IOException
-
postCreateReplicationEndPoint
public ReplicationEndpoint postCreateReplicationEndPoint(ObserverContext<RegionServerCoprocessorEnvironment> ctx, ReplicationEndpoint endpoint) Description copied from interface:RegionServerObserverThis will be called after the replication endpoint is instantiated.- Specified by:
postCreateReplicationEndPointin interfaceRegionServerObserver- Parameters:
ctx- the environment to interact with the framework and region server.endpoint- - the base endpoint for replication- Returns:
- the endpoint to use during replication.
-
preReplicateLogEntries
public void preReplicateLogEntries(ObserverContext<RegionServerCoprocessorEnvironment> ctx) throws IOException Description copied from interface:RegionServerObserverThis will be called before executing replication request to shipping log entries.- Specified by:
preReplicateLogEntriesin interfaceRegionServerObserver- Parameters:
ctx- the environment to interact with the framework and region server.- Throws:
IOException
-
preClearCompactionQueues
public void preClearCompactionQueues(ObserverContext<RegionServerCoprocessorEnvironment> ctx) throws IOException Description copied from interface:RegionServerObserverThis will be called before clearing compaction queues- Specified by:
preClearCompactionQueuesin interfaceRegionServerObserver- Parameters:
ctx- the environment to interact with the framework and region server.- Throws:
IOException
-
preAddReplicationPeer
public void preAddReplicationPeer(ObserverContext<MasterCoprocessorEnvironment> ctx, String peerId, ReplicationPeerConfig peerConfig) throws IOException Description copied from interface:MasterObserverCalled before add a replication peer- Specified by:
preAddReplicationPeerin interfaceMasterObserver- Parameters:
ctx- the environment to interact with the framework and masterpeerId- a short name that identifies the peerpeerConfig- configuration for the replication peer- Throws:
IOException
-
preRemoveReplicationPeer
public void preRemoveReplicationPeer(ObserverContext<MasterCoprocessorEnvironment> ctx, String peerId) throws IOException Description copied from interface:MasterObserverCalled before remove a replication peer- Specified by:
preRemoveReplicationPeerin interfaceMasterObserverpeerId- a short name that identifies the peer- Throws:
IOException
-
preEnableReplicationPeer
public void preEnableReplicationPeer(ObserverContext<MasterCoprocessorEnvironment> ctx, String peerId) throws IOException Description copied from interface:MasterObserverCalled before enable a replication peer- Specified by:
preEnableReplicationPeerin interfaceMasterObserverpeerId- a short name that identifies the peer- Throws:
IOException
-
preDisableReplicationPeer
public void preDisableReplicationPeer(ObserverContext<MasterCoprocessorEnvironment> ctx, String peerId) throws IOException Description copied from interface:MasterObserverCalled before disable a replication peer- Specified by:
preDisableReplicationPeerin interfaceMasterObserverpeerId- a short name that identifies the peer- Throws:
IOException
-
preGetReplicationPeerConfig
public void preGetReplicationPeerConfig(ObserverContext<MasterCoprocessorEnvironment> ctx, String peerId) throws IOException Description copied from interface:MasterObserverCalled before get the configured ReplicationPeerConfig for the specified peer- Specified by:
preGetReplicationPeerConfigin interfaceMasterObserverpeerId- a short name that identifies the peer- Throws:
IOException
-
preUpdateReplicationPeerConfig
public void preUpdateReplicationPeerConfig(ObserverContext<MasterCoprocessorEnvironment> ctx, String peerId, ReplicationPeerConfig peerConfig) throws IOException Description copied from interface:MasterObserverCalled before update peerConfig for the specified peer- Specified by:
preUpdateReplicationPeerConfigin interfaceMasterObserverpeerId- a short name that identifies the peer- Throws:
IOException
-
preListReplicationPeers
public void preListReplicationPeers(ObserverContext<MasterCoprocessorEnvironment> ctx, String regex) throws IOException Description copied from interface:MasterObserverCalled before list replication peers.- Specified by:
preListReplicationPeersin interfaceMasterObserver- Parameters:
ctx- the environment to interact with the framework and masterregex- The regular expression to match peer id- Throws:
IOException
-
preRequestLock
public void preRequestLock(ObserverContext<MasterCoprocessorEnvironment> ctx, String namespace, TableName tableName, RegionInfo[] regionInfos, String description) throws IOException Description copied from interface:MasterObserverCalled before new LockProcedure is queued.- Specified by:
preRequestLockin interfaceMasterObserver- Parameters:
ctx- the environment to interact with the framework and master- Throws:
IOException
-
preLockHeartbeat
public void preLockHeartbeat(ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName, String description) throws IOException Description copied from interface:MasterObserverCalled before heartbeat to a lock.- Specified by:
preLockHeartbeatin interfaceMasterObserver- Parameters:
ctx- the environment to interact with the framework and master- Throws:
IOException
-
preExecuteProcedures
public void preExecuteProcedures(ObserverContext<RegionServerCoprocessorEnvironment> ctx) throws IOException Description copied from interface:RegionServerObserverThis will be called before executing procedures- Specified by:
preExecuteProceduresin interfaceRegionServerObserver- Parameters:
ctx- the environment to interact with the framework and region server.- Throws:
IOException
-
preSwitchRpcThrottle
public void preSwitchRpcThrottle(ObserverContext<MasterCoprocessorEnvironment> ctx, boolean enable) throws IOException Description copied from interface:MasterObserverCalled before switching rpc throttle enabled state.- Specified by:
preSwitchRpcThrottlein interfaceMasterObserver- Parameters:
ctx- the coprocessor instance's environmentenable- the rpc throttle value- Throws:
IOException
-
preIsRpcThrottleEnabled
public void preIsRpcThrottleEnabled(ObserverContext<MasterCoprocessorEnvironment> ctx) throws IOException Description copied from interface:MasterObserverCalled before getting if is rpc throttle enabled.- Specified by:
preIsRpcThrottleEnabledin interfaceMasterObserver- Parameters:
ctx- the coprocessor instance's environment- Throws:
IOException
-
preSwitchExceedThrottleQuota
public void preSwitchExceedThrottleQuota(ObserverContext<MasterCoprocessorEnvironment> ctx, boolean enable) throws IOException Description copied from interface:MasterObserverCalled before switching exceed throttle quota state.- Specified by:
preSwitchExceedThrottleQuotain interfaceMasterObserver- Parameters:
ctx- the coprocessor instance's environmentenable- the exceed throttle quota value- 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
-
hasPermission
@Deprecated public void hasPermission(com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.HasPermissionRequest request, com.google.protobuf.RpcCallback<org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.HasPermissionResponse> done) Deprecated.since 2.2.0 and will be removed in 4.0.0. UseAdmin.hasUserPermissions(String, List)instead.- Specified by:
hasPermissionin interfaceorg.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.AccessControlService.Interface- See Also:
-
preGrant
public void preGrant(ObserverContext<MasterCoprocessorEnvironment> ctx, UserPermission userPermission, boolean mergeExistingPermissions) throws IOException Description copied from interface:MasterObserverCalled before granting user permissions.- Specified by:
preGrantin interfaceMasterObserver- Parameters:
ctx- the coprocessor instance's environmentuserPermission- the user and permissionsmergeExistingPermissions- True if merge with previous granted permissions- Throws:
IOException
-
preRevoke
public void preRevoke(ObserverContext<MasterCoprocessorEnvironment> ctx, UserPermission userPermission) throws IOException Description copied from interface:MasterObserverCalled before revoking user permissions.- Specified by:
preRevokein interfaceMasterObserver- Parameters:
ctx- the coprocessor instance's environmentuserPermission- the user and permissions- Throws:
IOException
-
preGrantOrRevoke
private void preGrantOrRevoke(User caller, String request, UserPermission userPermission) throws IOException - Throws:
IOException
-
preGetUserPermissions
public void preGetUserPermissions(ObserverContext<MasterCoprocessorEnvironment> ctx, String userName, String namespace, TableName tableName, byte[] family, byte[] qualifier) throws IOException Description copied from interface:MasterObserverCalled before getting user permissions.- Specified by:
preGetUserPermissionsin interfaceMasterObserver- Parameters:
ctx- the coprocessor instance's environmentuserName- the user name, null if get all user permissionsnamespace- the namespace, null if don't get namespace permissiontableName- the table name, null if don't get table permissionfamily- the table column family, null if don't get table family permissionqualifier- the table column qualifier, null if don't get table qualifier permission- Throws:
IOException- if something went wrong
-
preGetUserPermissions
private void preGetUserPermissions(User caller, String userName, String namespace, TableName tableName, byte[] family, byte[] qualifier) throws IOException - Throws:
IOException
-
preHasUserPermissions
public void preHasUserPermissions(ObserverContext<MasterCoprocessorEnvironment> ctx, String userName, List<Permission> permissions) throws IOException - Specified by:
preHasUserPermissionsin interfaceMasterObserver- Throws:
IOException
-
preHasUserPermissions
private void preHasUserPermissions(User caller, String userName, List<Permission> permissions) throws IOException - Throws:
IOException
-
preClearRegionBlockCache
public void preClearRegionBlockCache(ObserverContext<RegionServerCoprocessorEnvironment> ctx) throws IOException - Specified by:
preClearRegionBlockCachein interfaceRegionServerObserver- Throws:
IOException
-
preUpdateRegionServerConfiguration
public void preUpdateRegionServerConfiguration(ObserverContext<RegionServerCoprocessorEnvironment> ctx, org.apache.hadoop.conf.Configuration preReloadConf) throws IOException Description copied from interface:RegionServerObserverCalled before reloading the RegionServer'sConfigurationfrom disk- Specified by:
preUpdateRegionServerConfigurationin interfaceRegionServerObserver- Parameters:
ctx- the coprocessor instance's environmentpreReloadConf- theConfigurationin use prior to reload- Throws:
IOException- if you need to signal an IO error
-
preUpdateMasterConfiguration
public void preUpdateMasterConfiguration(ObserverContext<MasterCoprocessorEnvironment> ctx, org.apache.hadoop.conf.Configuration preReloadConf) throws IOException - Specified by:
preUpdateMasterConfigurationin interfaceMasterObserver- Throws:
IOException
-