@InterfaceAudience.LimitedPrivate(value="Configuration") public class AccessController extends Object implements MasterObserver, RegionObserver, RegionServerObserver, org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.AccessControlService.Interface, CoprocessorService, EndpointObserver, BulkLoadObserver
AccessController
performs authorization checks for HBase operations
based on:
Permission.Action
values)
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.
RegionObserver.MutationType
Coprocessor.State
PRIORITY_HIGHEST, PRIORITY_LOWEST, PRIORITY_SYSTEM, PRIORITY_USER, VERSION
Constructor and Description |
---|
AccessController() |
Modifier and Type | Method and Description |
---|---|
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) |
TableAuthManager |
getAuthManager() |
Region |
getRegion() |
com.google.protobuf.Service |
getService() |
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) |
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) |
static boolean |
isAuthorizationSupported(org.apache.hadoop.conf.Configuration conf) |
static boolean |
isCellAuthorizationSupported(org.apache.hadoop.conf.Configuration conf) |
void |
postAbortProcedure(ObserverContext<MasterCoprocessorEnvironment> ctx)
Called after a abortProcedure request has been processed.
|
void |
postCompletedCreateTableAction(ObserverContext<MasterCoprocessorEnvironment> c,
TableDescriptor desc,
HRegionInfo[] regions)
Called after the createTable operation has been requested.
|
ReplicationEndpoint |
postCreateReplicationEndPoint(ObserverContext<RegionServerCoprocessorEnvironment> ctx,
ReplicationEndpoint endpoint)
This will be called after the replication endpoint is instantiated.
|
void |
postDelete(ObserverContext<RegionCoprocessorEnvironment> c,
Delete delete,
WALEdit edit,
Durability durability)
Called after the client deletes a value.
|
void |
postDeleteColumnFamily(ObserverContext<MasterCoprocessorEnvironment> ctx,
TableName tableName,
byte[] columnFamily)
Called after the column family has been deleted.
|
void |
postDeleteNamespace(ObserverContext<MasterCoprocessorEnvironment> ctx,
String namespace)
Called after the deleteNamespace operation has been requested.
|
void |
postDeleteTable(ObserverContext<MasterCoprocessorEnvironment> c,
TableName tableName)
Called after the deleteTable operation has been requested.
|
void |
postEndpointInvocation(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.
|
void |
postGetProcedures(ObserverContext<MasterCoprocessorEnvironment> ctx,
List<Procedure<?>> procList)
Called after a getProcedures request has been processed.
|
void |
postGetTableDescriptors(ObserverContext<MasterCoprocessorEnvironment> ctx,
List<TableName> tableNamesList,
List<TableDescriptor> descriptors,
String regex)
Called after a getTableDescriptors request has been processed.
|
void |
postGetTableNames(ObserverContext<MasterCoprocessorEnvironment> ctx,
List<TableDescriptor> descriptors,
String regex)
Called after a getTableNames request has been processed.
|
void |
postListNamespaceDescriptors(ObserverContext<MasterCoprocessorEnvironment> ctx,
List<NamespaceDescriptor> descriptors)
Called after a listNamespaceDescriptors request has been processed.
|
void |
postLogReplay(ObserverContext<RegionCoprocessorEnvironment> c)
Called after the log replay on the region is over.
|
void |
postMerge(ObserverContext<RegionServerCoprocessorEnvironment> c,
Region regionA,
Region regionB,
Region mergedRegion)
called after the regions merge.
|
void |
postMergeCommit(ObserverContext<RegionServerCoprocessorEnvironment> ctx,
Region regionA,
Region regionB,
Region mergedRegion)
This will be called after PONR step as part of regions merge transaction.
|
void |
postModifyTable(ObserverContext<MasterCoprocessorEnvironment> c,
TableName tableName,
TableDescriptor htd)
Called after the modifyTable operation has been requested.
|
Cell |
postMutationBeforeWAL(ObserverContext<RegionCoprocessorEnvironment> ctx,
RegionObserver.MutationType opType,
Mutation mutation,
Cell oldCell,
Cell newCell)
Called after a new cell has been created during an increment operation, but before
it is committed to the WAL or memstore.
|
void |
postOpen(ObserverContext<RegionCoprocessorEnvironment> c)
Called after the region is reported as open to the master.
|
void |
postPut(ObserverContext<RegionCoprocessorEnvironment> c,
Put put,
WALEdit edit,
Durability durability)
Called after the client stores a value.
|
void |
postReplicateLogEntries(ObserverContext<RegionServerCoprocessorEnvironment> ctx,
List<org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.WALEntry> entries,
CellScanner cells)
This will be called after executing replication request to shipping log entries.
|
void |
postRollBackMerge(ObserverContext<RegionServerCoprocessorEnvironment> ctx,
Region regionA,
Region regionB)
This will be called after the roll back of the regions merge.
|
void |
postRollWALWriterRequest(ObserverContext<RegionServerCoprocessorEnvironment> ctx)
This will be called after executing user request to roll a region server WAL.
|
void |
postScannerClose(ObserverContext<RegionCoprocessorEnvironment> c,
InternalScanner s)
Called after the client closes a scanner.
|
boolean |
postScannerFilterRow(ObserverContext<RegionCoprocessorEnvironment> e,
InternalScanner s,
Cell curRowCell,
boolean hasMore)
This will be called by the scan flow when the current scanned row is being filtered out by the
filter.
|
RegionScanner |
postScannerOpen(ObserverContext<RegionCoprocessorEnvironment> c,
Scan scan,
RegionScanner s)
Called after the client opens a new scanner.
|
void |
postSetSplitOrMergeEnabled(ObserverContext<MasterCoprocessorEnvironment> ctx,
boolean newValue,
MasterSwitchType switchType)
Called after setting split / merge switch
|
void |
postStartMaster(ObserverContext<MasterCoprocessorEnvironment> ctx)
Called immediately after an active master instance has completed
initialization.
|
void |
postTruncateTable(ObserverContext<MasterCoprocessorEnvironment> ctx,
TableName tableName)
Called after the truncateTable operation has been requested.
|
void |
preAbortProcedure(ObserverContext<MasterCoprocessorEnvironment> ctx,
ProcedureExecutor<MasterProcedureEnv> procEnv,
long procId)
Called before a abortProcedure request has been processed.
|
void |
preAddColumnFamily(ObserverContext<MasterCoprocessorEnvironment> ctx,
TableName tableName,
ColumnFamilyDescriptor columnFamily)
Called prior to adding a new column family to the table.
|
void |
preAddReplicationPeer(ObserverContext<MasterCoprocessorEnvironment> ctx,
String peerId,
ReplicationPeerConfig peerConfig)
Called before add a replication peer
|
void |
preAddRSGroup(ObserverContext<MasterCoprocessorEnvironment> ctx,
String name)
Called before a new region server group is added
|
Result |
preAppend(ObserverContext<RegionCoprocessorEnvironment> c,
Append append)
Called before Append.
|
Result |
preAppendAfterRowLock(ObserverContext<RegionCoprocessorEnvironment> c,
Append append)
Called before Append but after acquiring rowlock.
|
void |
preAssign(ObserverContext<MasterCoprocessorEnvironment> c,
HRegionInfo regionInfo)
Called prior to assigning a specific region.
|
void |
preBalance(ObserverContext<MasterCoprocessorEnvironment> c)
Called prior to requesting rebalancing of the cluster regions, though after
the initial checks for regions in transition and the balance switch flag.
|
void |
preBalanceRSGroup(ObserverContext<MasterCoprocessorEnvironment> ctx,
String groupName)
Called before a region server group is removed
|
boolean |
preBalanceSwitch(ObserverContext<MasterCoprocessorEnvironment> c,
boolean newValue)
Called prior to modifying the flag used to enable/disable region balancing.
|
void |
preBatchMutate(ObserverContext<RegionCoprocessorEnvironment> c,
MiniBatchOperationInProgress<Mutation> miniBatchOp)
This will be called for every batch mutation operation happening at the server.
|
void |
preBulkLoadHFile(ObserverContext<RegionCoprocessorEnvironment> ctx,
List<Pair<byte[],String>> familyPaths)
Verifies user has CREATE privileges on
the Column Families involved in the bulkLoadHFile
request.
|
boolean |
preCheckAndDelete(ObserverContext<RegionCoprocessorEnvironment> c,
byte[] row,
byte[] family,
byte[] qualifier,
CompareOperator op,
ByteArrayComparable comparator,
Delete delete,
boolean result)
Called before checkAndDelete.
|
boolean |
preCheckAndDeleteAfterRowLock(ObserverContext<RegionCoprocessorEnvironment> c,
byte[] row,
byte[] family,
byte[] qualifier,
CompareOperator op,
ByteArrayComparable comparator,
Delete delete,
boolean result)
Called before checkAndDelete but after acquiring rowock.
|
boolean |
preCheckAndPut(ObserverContext<RegionCoprocessorEnvironment> c,
byte[] row,
byte[] family,
byte[] qualifier,
CompareOperator op,
ByteArrayComparable comparator,
Put put,
boolean result)
Called before checkAndPut.
|
boolean |
preCheckAndPutAfterRowLock(ObserverContext<RegionCoprocessorEnvironment> c,
byte[] row,
byte[] family,
byte[] qualifier,
CompareOperator opp,
ByteArrayComparable comparator,
Put put,
boolean result)
Called before checkAndPut but after acquiring rowlock.
|
void |
preCleanupBulkLoad(ObserverContext<RegionCoprocessorEnvironment> ctx,
org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.CleanupBulkLoadRequest request)
Authorization security check for
SecureBulkLoadProtocol.cleanupBulkLoad()
|
void |
preClearCompactionQueues(ObserverContext<RegionServerCoprocessorEnvironment> ctx)
This will be called before clearing compaction queues
|
void |
preClearDeadServers(ObserverContext<MasterCoprocessorEnvironment> ctx)
Called before clear dead region servers.
|
void |
preCloneSnapshot(ObserverContext<MasterCoprocessorEnvironment> ctx,
org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescription snapshot,
TableDescriptor hTableDescriptor)
Called before a snapshot is cloned.
|
void |
preClose(ObserverContext<RegionCoprocessorEnvironment> c,
boolean abortRequested)
Called before the region is reported as closed to the master.
|
InternalScanner |
preCompact(ObserverContext<RegionCoprocessorEnvironment> c,
Store store,
InternalScanner scanner,
ScanType scanType,
CompactionLifeCycleTracker tracker)
Called prior to writing the
StoreFile s selected for compaction into a new
StoreFile . |
void |
preCreateNamespace(ObserverContext<MasterCoprocessorEnvironment> ctx,
NamespaceDescriptor ns)
Called before a new namespace is created by
HMaster . |
void |
preCreateTable(ObserverContext<MasterCoprocessorEnvironment> c,
TableDescriptor desc,
HRegionInfo[] regions)
Called before a new table is created by
HMaster . |
void |
preDelete(ObserverContext<RegionCoprocessorEnvironment> c,
Delete delete,
WALEdit edit,
Durability durability)
Called before the client deletes a value.
|
void |
preDeleteColumnFamily(ObserverContext<MasterCoprocessorEnvironment> ctx,
TableName tableName,
byte[] columnFamily)
Called prior to deleting the entire column family.
|
void |
preDeleteNamespace(ObserverContext<MasterCoprocessorEnvironment> ctx,
String namespace)
Called before
HMaster deletes a
namespace
It can't bypass the default action, e.g., ctx.bypass() won't have effect. |
void |
preDeleteSnapshot(ObserverContext<MasterCoprocessorEnvironment> ctx,
org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescription snapshot)
Called before a snapshot is deleted.
|
void |
preDeleteTable(ObserverContext<MasterCoprocessorEnvironment> c,
TableName tableName)
Called before
HMaster deletes a
table. |
void |
preDisableReplicationPeer(ObserverContext<MasterCoprocessorEnvironment> ctx,
String peerId)
Called before disable a replication peer
|
void |
preDisableTable(ObserverContext<MasterCoprocessorEnvironment> c,
TableName tableName)
Called prior to disabling a table.
|
void |
preEnableReplicationPeer(ObserverContext<MasterCoprocessorEnvironment> ctx,
String peerId)
Called before enable a replication peer
|
void |
preEnableTable(ObserverContext<MasterCoprocessorEnvironment> c,
TableName tableName)
Called prior to enabling a table.
|
com.google.protobuf.Message |
preEndpointInvocation(ObserverContext<RegionCoprocessorEnvironment> ctx,
com.google.protobuf.Service service,
String methodName,
com.google.protobuf.Message request)
Called before an Endpoint service method is invoked.
|
boolean |
preExists(ObserverContext<RegionCoprocessorEnvironment> c,
Get get,
boolean exists)
Called before the client tests for existence using a Get.
|
void |
preFlush(ObserverContext<RegionCoprocessorEnvironment> c)
Called before the memstore is flushed to disk.
|
void |
preGetLocks(ObserverContext<MasterCoprocessorEnvironment> ctx)
Called before a getLocks request has been processed.
|
void |
preGetNamespaceDescriptor(ObserverContext<MasterCoprocessorEnvironment> ctx,
String namespace)
Called before a getNamespaceDescriptor request has been processed.
|
void |
preGetOp(ObserverContext<RegionCoprocessorEnvironment> c,
Get get,
List<Cell> result)
Called before the client performs a Get
|
void |
preGetProcedures(ObserverContext<MasterCoprocessorEnvironment> ctx)
Called before a getProcedures request has been processed.
|
void |
preGetReplicationPeerConfig(ObserverContext<MasterCoprocessorEnvironment> ctx,
String peerId)
Called before get the configured ReplicationPeerConfig for the specified peer
|
void |
preGetTableDescriptors(ObserverContext<MasterCoprocessorEnvironment> ctx,
List<TableName> tableNamesList,
List<TableDescriptor> descriptors,
String regex)
Called before a getTableDescriptors request has been processed.
|
Result |
preIncrement(ObserverContext<RegionCoprocessorEnvironment> c,
Increment increment)
Called before Increment.
|
Result |
preIncrementAfterRowLock(ObserverContext<RegionCoprocessorEnvironment> c,
Increment increment)
Called before Increment but after acquiring rowlock.
|
void |
preListReplicationPeers(ObserverContext<MasterCoprocessorEnvironment> ctx,
String regex)
Called before list replication peers.
|
void |
preListSnapshot(ObserverContext<MasterCoprocessorEnvironment> ctx,
org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescription snapshot)
Called before listSnapshots request has been processed.
|
void |
preLockHeartbeat(ObserverContext<MasterCoprocessorEnvironment> ctx,
LockProcedure proc,
boolean keepAlive)
Called before heartbeat to a lock.
|
void |
preMerge(ObserverContext<RegionServerCoprocessorEnvironment> ctx,
Region regionA,
Region regionB)
Called before the regions merge.
|
void |
preMergeCommit(ObserverContext<RegionServerCoprocessorEnvironment> ctx,
Region regionA,
Region regionB,
List<Mutation> metaEntries)
This will be called before PONR step as part of regions merge transaction.
|
void |
preMergeRegions(ObserverContext<MasterCoprocessorEnvironment> ctx,
HRegionInfo[] regionsToMerge)
Called before merge regions request.
|
void |
preModifyColumnFamily(ObserverContext<MasterCoprocessorEnvironment> ctx,
TableName tableName,
ColumnFamilyDescriptor columnFamily)
Called prior to modifying a column family's attributes.
|
void |
preModifyNamespace(ObserverContext<MasterCoprocessorEnvironment> ctx,
NamespaceDescriptor ns)
Called prior to modifying a namespace's properties.
|
void |
preModifyTable(ObserverContext<MasterCoprocessorEnvironment> c,
TableName tableName,
TableDescriptor htd)
Called prior to modifying a table's properties.
|
void |
preMove(ObserverContext<MasterCoprocessorEnvironment> c,
HRegionInfo region,
ServerName srcServer,
ServerName destServer)
Called prior to moving a given region from one region server to another.
|
void |
preMoveServers(ObserverContext<MasterCoprocessorEnvironment> ctx,
Set<Address> servers,
String targetGroup)
Called before servers are moved to target region server group
|
void |
preMoveServersAndTables(ObserverContext<MasterCoprocessorEnvironment> ctx,
Set<Address> servers,
Set<TableName> tables,
String targetGroup)
Called before servers are moved to target region server group
|
void |
preMoveTables(ObserverContext<MasterCoprocessorEnvironment> ctx,
Set<TableName> tables,
String targetGroup)
Called before tables are moved to target region server group
|
void |
preOpen(ObserverContext<RegionCoprocessorEnvironment> c)
Called before the region is reported as open to the master.
|
void |
prePrepareBulkLoad(ObserverContext<RegionCoprocessorEnvironment> ctx,
org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.PrepareBulkLoadRequest request)
Authorization check for
SecureBulkLoadProtocol.prepareBulkLoad()
|
void |
prePut(ObserverContext<RegionCoprocessorEnvironment> c,
Put put,
WALEdit edit,
Durability durability)
Called before the client stores a value.
|
void |
preRegionOffline(ObserverContext<MasterCoprocessorEnvironment> c,
HRegionInfo regionInfo)
Called prior to marking a given region as offline.
|
void |
preRemoveReplicationPeer(ObserverContext<MasterCoprocessorEnvironment> ctx,
String peerId)
Called before remove a replication peer
|
void |
preRemoveRSGroup(ObserverContext<MasterCoprocessorEnvironment> ctx,
String name)
Called before a region server group is removed
|
void |
preReplicateLogEntries(ObserverContext<RegionServerCoprocessorEnvironment> ctx,
List<org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.WALEntry> entries,
CellScanner cells)
This will be called before executing replication request to shipping log entries.
|
void |
preRequestLock(ObserverContext<MasterCoprocessorEnvironment> ctx,
String namespace,
TableName tableName,
HRegionInfo[] regionInfos,
LockType type,
String description)
Called before new LockProcedure is queued.
|
void |
preRestoreSnapshot(ObserverContext<MasterCoprocessorEnvironment> ctx,
org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescription snapshot,
TableDescriptor hTableDescriptor)
Called before a snapshot is restored.
|
void |
preRollBackMerge(ObserverContext<RegionServerCoprocessorEnvironment> ctx,
Region regionA,
Region regionB)
This will be called before the roll back of the regions merge.
|
void |
preRollWALWriterRequest(ObserverContext<RegionServerCoprocessorEnvironment> ctx)
This will be called before executing user request to roll a region server WAL.
|
void |
preScannerClose(ObserverContext<RegionCoprocessorEnvironment> c,
InternalScanner s)
Called before the client closes a scanner.
|
boolean |
preScannerNext(ObserverContext<RegionCoprocessorEnvironment> c,
InternalScanner s,
List<Result> result,
int limit,
boolean hasNext)
Called before the client asks for the next row on a scanner.
|
RegionScanner |
preScannerOpen(ObserverContext<RegionCoprocessorEnvironment> c,
Scan scan,
RegionScanner s)
Called before the client opens a new scanner.
|
void |
preSetNamespaceQuota(ObserverContext<MasterCoprocessorEnvironment> ctx,
String namespace,
org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.Quotas quotas)
Called before the quota for the namespace is stored.
|
boolean |
preSetSplitOrMergeEnabled(ObserverContext<MasterCoprocessorEnvironment> ctx,
boolean newValue,
MasterSwitchType switchType)
Called prior to setting split / merge switch
|
void |
preSetTableQuota(ObserverContext<MasterCoprocessorEnvironment> ctx,
TableName tableName,
org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.Quotas quotas)
Called before the quota for the table is stored.
|
void |
preSetUserQuota(ObserverContext<MasterCoprocessorEnvironment> ctx,
String userName,
org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.Quotas quotas)
Called before the quota for the user is stored.
|
void |
preSetUserQuota(ObserverContext<MasterCoprocessorEnvironment> ctx,
String userName,
String namespace,
org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.Quotas quotas)
Called before the quota for the user on the specified namespace is stored.
|
void |
preSetUserQuota(ObserverContext<MasterCoprocessorEnvironment> ctx,
String userName,
TableName tableName,
org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.Quotas quotas)
Called before the quota for the user on the specified table is stored.
|
void |
preShutdown(ObserverContext<MasterCoprocessorEnvironment> c)
Called prior to shutting down the full HBase cluster, including this
HMaster process. |
void |
preSnapshot(ObserverContext<MasterCoprocessorEnvironment> ctx,
org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescription snapshot,
TableDescriptor hTableDescriptor)
Called before a new snapshot is taken.
|
void |
preSplitRegion(ObserverContext<MasterCoprocessorEnvironment> ctx,
TableName tableName,
byte[] splitRow)
Called before the split region procedure is called.
|
void |
preStopMaster(ObserverContext<MasterCoprocessorEnvironment> c)
Called immediately prior to stopping this
HMaster process. |
void |
preStopRegionServer(ObserverContext<RegionServerCoprocessorEnvironment> ctx)
Called before stopping region server.
|
void |
preTableFlush(ObserverContext<MasterCoprocessorEnvironment> ctx,
TableName tableName)
Called before the table memstore is flushed to disk.
|
void |
preTruncateTable(ObserverContext<MasterCoprocessorEnvironment> c,
TableName tableName)
Called before
HMaster truncates a
table. |
void |
preUnassign(ObserverContext<MasterCoprocessorEnvironment> c,
HRegionInfo regionInfo,
boolean force)
Called prior to unassigning a given region.
|
void |
preUpdateReplicationPeerConfig(ObserverContext<MasterCoprocessorEnvironment> ctx,
String peerId,
ReplicationPeerConfig peerConfig)
Called before update peerConfig for the specified peer
|
void |
requireNamespacePermission(User user,
String request,
String namespace,
Permission.Action... permissions)
Checks that the user has the given global or namespace permission.
|
void |
requireNamespacePermission(User user,
String request,
String namespace,
TableName tableName,
Map<byte[],? extends Collection<byte[]>> familyMap,
Permission.Action... permissions)
Checks that the user has the given global or namespace permission.
|
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) |
void |
start(CoprocessorEnvironment env) |
void |
stop(CoprocessorEnvironment env) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
postAddColumnFamily, postAddReplicationPeer, postAddRSGroup, postAssign, postBalance, postBalanceRSGroup, postBalanceSwitch, postClearDeadServers, postCloneSnapshot, postCompletedAddColumnFamilyAction, postCompletedDeleteColumnFamilyAction, postCompletedDeleteTableAction, postCompletedDisableTableAction, postCompletedEnableTableAction, postCompletedMergeRegionsAction, postCompletedModifyColumnFamilyAction, postCompletedModifyTableAction, postCompletedSplitRegionAction, postCompletedTruncateTableAction, postCreateNamespace, postCreateTable, postDeleteSnapshot, postDisableReplicationPeer, postDisableTable, postEnableReplicationPeer, postEnableTable, postGetLocks, postGetNamespaceDescriptor, postGetReplicationPeerConfig, postListDeadServers, postListReplicationPeers, postListSnapshot, postLockHeartbeat, postMergeRegions, postMergeRegionsCommitAction, postModifyColumnFamily, postModifyNamespace, postMove, postMoveServers, postMoveServersAndTables, postMoveTables, postRegionOffline, postRemoveReplicationPeer, postRemoveRSGroup, postRequestLock, postRestoreSnapshot, postRollBackMergeRegionsAction, postRollBackSplitRegionAction, postSetNamespaceQuota, postSetTableQuota, postSetUserQuota, postSetUserQuota, postSetUserQuota, postSnapshot, postTableFlush, postUnassign, postUpdateReplicationPeerConfig, preAddColumnFamilyAction, preCreateTableAction, preDeleteColumnFamilyAction, preDeleteTableAction, preDisableTableAction, preEnableTableAction, preGetTableNames, preListDeadServers, preListNamespaceDescriptors, preMasterInitialization, preMergeRegionsAction, preMergeRegionsCommitAction, preModifyColumnFamilyAction, preModifyTableAction, preSplitRegionAction, preSplitRegionAfterPONRAction, preSplitRegionBeforePONRAction, preTruncateTableAction
postAppend, postBatchMutate, postBatchMutateIndispensably, postBulkLoadHFile, postCheckAndDelete, postCheckAndPut, postClose, postCloseRegionOperation, postCommitStoreFile, postCompact, postCompactSelection, postExists, postFlush, postFlush, postGetOp, postIncrement, postInstantiateDeleteTracker, postReplayWALs, postScannerNext, postStartRegionOperation, postStoreFileReaderOpen, postWALRestore, preCommitStoreFile, preCompactScannerOpen, preCompactSelection, preFlush, preFlushScannerOpen, prePrepareTimeStampForDeleteVersion, preReplayWALs, preStoreFileReaderOpen, preStoreScannerOpen, preWALRestore
postClearCompactionQueues
public static boolean isAuthorizationSupported(org.apache.hadoop.conf.Configuration conf)
public static boolean isCellAuthorizationSupported(org.apache.hadoop.conf.Configuration conf)
public Region getRegion()
public TableAuthManager getAuthManager()
public void requireNamespacePermission(User user, String request, String namespace, Permission.Action... permissions) throws IOException
namespace
- permissions
- Actions being requestedIOException
public void requireNamespacePermission(User user, String request, String namespace, TableName tableName, Map<byte[],? extends Collection<byte[]>> familyMap, Permission.Action... permissions) throws IOException
namespace
- permissions
- Actions being requestedIOException
public void start(CoprocessorEnvironment env) throws IOException
start
in interface Coprocessor
IOException
public void stop(CoprocessorEnvironment env)
stop
in interface Coprocessor
public void preCreateTable(ObserverContext<MasterCoprocessorEnvironment> c, TableDescriptor desc, HRegionInfo[] regions) throws IOException
MasterObserver
HMaster
. Called as part of create
table RPC call.
It can't bypass the default action, e.g., ctx.bypass() won't have effect.preCreateTable
in interface MasterObserver
c
- the environment to interact with the framework and masterdesc
- the TableDescriptor for the tableregions
- the initial regions created for the tableIOException
public void postCompletedCreateTableAction(ObserverContext<MasterCoprocessorEnvironment> c, TableDescriptor desc, HRegionInfo[] regions) throws IOException
MasterObserver
postCompletedCreateTableAction
in interface MasterObserver
c
- the environment to interact with the framework and masterdesc
- the TableDescriptor for the tableregions
- the initial regions created for the tableIOException
public void preDeleteTable(ObserverContext<MasterCoprocessorEnvironment> c, TableName tableName) throws IOException
MasterObserver
HMaster
deletes a
table. Called as part of delete table RPC call.
It can't bypass the default action, e.g., ctx.bypass() won't have effect.preDeleteTable
in interface MasterObserver
c
- the environment to interact with the framework and mastertableName
- the name of the tableIOException
public void postDeleteTable(ObserverContext<MasterCoprocessorEnvironment> c, TableName tableName) throws IOException
MasterObserver
postDeleteTable
in interface MasterObserver
c
- the environment to interact with the framework and mastertableName
- the name of the tableIOException
public void preTruncateTable(ObserverContext<MasterCoprocessorEnvironment> c, TableName tableName) throws IOException
MasterObserver
HMaster
truncates a
table. Called as part of truncate table RPC call.
It can't bypass the default action, e.g., ctx.bypass() won't have effect.preTruncateTable
in interface MasterObserver
c
- the environment to interact with the framework and mastertableName
- the name of the tableIOException
public void postTruncateTable(ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName) throws IOException
MasterObserver
postTruncateTable
in interface MasterObserver
ctx
- the environment to interact with the framework and mastertableName
- the name of the tableIOException
public void preModifyTable(ObserverContext<MasterCoprocessorEnvironment> c, TableName tableName, TableDescriptor htd) throws IOException
MasterObserver
preModifyTable
in interface MasterObserver
c
- the environment to interact with the framework and mastertableName
- the name of the tablehtd
- the TableDescriptorIOException
public void postModifyTable(ObserverContext<MasterCoprocessorEnvironment> c, TableName tableName, TableDescriptor htd) throws IOException
MasterObserver
postModifyTable
in interface MasterObserver
c
- the environment to interact with the framework and mastertableName
- the name of the tablehtd
- the TableDescriptorIOException
public void preAddColumnFamily(ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName, ColumnFamilyDescriptor columnFamily) throws IOException
MasterObserver
preAddColumnFamily
in interface MasterObserver
ctx
- the environment to interact with the framework and mastertableName
- the name of the tablecolumnFamily
- the ColumnFamilyDescriptorIOException
public void preModifyColumnFamily(ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName, ColumnFamilyDescriptor columnFamily) throws IOException
MasterObserver
preModifyColumnFamily
in interface MasterObserver
ctx
- the environment to interact with the framework and mastertableName
- the name of the tablecolumnFamily
- the ColumnFamilyDescriptorIOException
public void preDeleteColumnFamily(ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName, byte[] columnFamily) throws IOException
MasterObserver
preDeleteColumnFamily
in interface MasterObserver
ctx
- the environment to interact with the framework and mastertableName
- the name of the tablecolumnFamily
- the columnIOException
public void postDeleteColumnFamily(ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName, byte[] columnFamily) throws IOException
MasterObserver
postDeleteColumnFamily
in interface MasterObserver
ctx
- the environment to interact with the framework and mastertableName
- the name of the tablecolumnFamily
- the column familyIOException
public void preEnableTable(ObserverContext<MasterCoprocessorEnvironment> c, TableName tableName) throws IOException
MasterObserver
preEnableTable
in interface MasterObserver
c
- the environment to interact with the framework and mastertableName
- the name of the tableIOException
public void preDisableTable(ObserverContext<MasterCoprocessorEnvironment> c, TableName tableName) throws IOException
MasterObserver
preDisableTable
in interface MasterObserver
c
- the environment to interact with the framework and mastertableName
- the name of the tableIOException
public void preAbortProcedure(ObserverContext<MasterCoprocessorEnvironment> ctx, ProcedureExecutor<MasterProcedureEnv> procEnv, long procId) throws IOException
MasterObserver
preAbortProcedure
in interface MasterObserver
ctx
- the environment to interact with the framework and masterprocEnv
- procedure executorprocId
- the Id of the procedureIOException
public void postAbortProcedure(ObserverContext<MasterCoprocessorEnvironment> ctx) throws IOException
MasterObserver
postAbortProcedure
in interface MasterObserver
ctx
- the environment to interact with the framework and masterIOException
public void preGetProcedures(ObserverContext<MasterCoprocessorEnvironment> ctx) throws IOException
MasterObserver
preGetProcedures
in interface MasterObserver
ctx
- the environment to interact with the framework and masterIOException
public void postGetProcedures(ObserverContext<MasterCoprocessorEnvironment> ctx, List<Procedure<?>> procList) throws IOException
MasterObserver
postGetProcedures
in interface MasterObserver
ctx
- the environment to interact with the framework and masterprocList
- the list of procedures about to be returnedIOException
public void preGetLocks(ObserverContext<MasterCoprocessorEnvironment> ctx) throws IOException
MasterObserver
preGetLocks
in interface MasterObserver
ctx
- the environment to interact with the framework and masterIOException
- if something went wrongpublic void preMove(ObserverContext<MasterCoprocessorEnvironment> c, HRegionInfo region, ServerName srcServer, ServerName destServer) throws IOException
MasterObserver
preMove
in interface MasterObserver
c
- the environment to interact with the framework and masterregion
- the HRegionInfosrcServer
- the source ServerNamedestServer
- the destination ServerNameIOException
public void preAssign(ObserverContext<MasterCoprocessorEnvironment> c, HRegionInfo regionInfo) throws IOException
MasterObserver
preAssign
in interface MasterObserver
c
- the environment to interact with the framework and masterregionInfo
- the regionInfo of the regionIOException
public void preUnassign(ObserverContext<MasterCoprocessorEnvironment> c, HRegionInfo regionInfo, boolean force) throws IOException
MasterObserver
preUnassign
in interface MasterObserver
c
- the environment to interact with the framework and masterforce
- whether to force unassignment or notIOException
public void preRegionOffline(ObserverContext<MasterCoprocessorEnvironment> c, HRegionInfo regionInfo) throws IOException
MasterObserver
ctx.bypass()
will not have any
impact on this hook.preRegionOffline
in interface MasterObserver
c
- the environment to interact with the framework and masterIOException
public boolean preSetSplitOrMergeEnabled(ObserverContext<MasterCoprocessorEnvironment> ctx, boolean newValue, MasterSwitchType switchType) throws IOException
MasterObserver
preSetSplitOrMergeEnabled
in interface MasterObserver
ctx
- the coprocessor instance's environmentnewValue
- the new value submitted in the callswitchType
- type of switchIOException
public void postSetSplitOrMergeEnabled(ObserverContext<MasterCoprocessorEnvironment> ctx, boolean newValue, MasterSwitchType switchType) throws IOException
MasterObserver
postSetSplitOrMergeEnabled
in interface MasterObserver
ctx
- the coprocessor instance's environmentnewValue
- the new value submitted in the callswitchType
- type of switchIOException
public void preBalance(ObserverContext<MasterCoprocessorEnvironment> c) throws IOException
MasterObserver
preBalance
in interface MasterObserver
c
- the environment to interact with the framework and masterIOException
public boolean preBalanceSwitch(ObserverContext<MasterCoprocessorEnvironment> c, boolean newValue) throws IOException
MasterObserver
preBalanceSwitch
in interface MasterObserver
c
- the coprocessor instance's environmentnewValue
- the new flag value submitted in the callIOException
public void preShutdown(ObserverContext<MasterCoprocessorEnvironment> c) throws IOException
MasterObserver
HMaster
process.preShutdown
in interface MasterObserver
IOException
public void preStopMaster(ObserverContext<MasterCoprocessorEnvironment> c) throws IOException
MasterObserver
HMaster
process.preStopMaster
in interface MasterObserver
IOException
public void postStartMaster(ObserverContext<MasterCoprocessorEnvironment> ctx) throws IOException
MasterObserver
postStartMaster
in interface MasterObserver
IOException
public void preSnapshot(ObserverContext<MasterCoprocessorEnvironment> ctx, org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescription snapshot, TableDescriptor hTableDescriptor) throws IOException
MasterObserver
preSnapshot
in interface MasterObserver
ctx
- the environment to interact with the framework and mastersnapshot
- the SnapshotDescriptor for the snapshothTableDescriptor
- the TableDescriptor of the table to snapshotIOException
public void preListSnapshot(ObserverContext<MasterCoprocessorEnvironment> ctx, org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescription snapshot) throws IOException
MasterObserver
preListSnapshot
in interface MasterObserver
ctx
- the environment to interact with the framework and mastersnapshot
- the SnapshotDescriptor of the snapshot to listIOException
public void preCloneSnapshot(ObserverContext<MasterCoprocessorEnvironment> ctx, org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescription snapshot, TableDescriptor hTableDescriptor) throws IOException
MasterObserver
preCloneSnapshot
in interface MasterObserver
ctx
- the environment to interact with the framework and mastersnapshot
- the SnapshotDescriptor for the snapshothTableDescriptor
- the TableDescriptor of the table to createIOException
public void preRestoreSnapshot(ObserverContext<MasterCoprocessorEnvironment> ctx, org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescription snapshot, TableDescriptor hTableDescriptor) throws IOException
MasterObserver
preRestoreSnapshot
in interface MasterObserver
ctx
- the environment to interact with the framework and mastersnapshot
- the SnapshotDescriptor for the snapshothTableDescriptor
- the TableDescriptor of the table to restoreIOException
public void preDeleteSnapshot(ObserverContext<MasterCoprocessorEnvironment> ctx, org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescription snapshot) throws IOException
MasterObserver
preDeleteSnapshot
in interface MasterObserver
ctx
- the environment to interact with the framework and mastersnapshot
- the SnapshotDescriptor of the snapshot to deleteIOException
public void preCreateNamespace(ObserverContext<MasterCoprocessorEnvironment> ctx, NamespaceDescriptor ns) throws IOException
MasterObserver
HMaster
.
It can't bypass the default action, e.g., ctx.bypass() won't have effect.preCreateNamespace
in interface MasterObserver
ctx
- the environment to interact with the framework and masterns
- the NamespaceDescriptor for the tableIOException
public void preDeleteNamespace(ObserverContext<MasterCoprocessorEnvironment> ctx, String namespace) throws IOException
MasterObserver
HMaster
deletes a
namespace
It can't bypass the default action, e.g., ctx.bypass() won't have effect.preDeleteNamespace
in interface MasterObserver
ctx
- the environment to interact with the framework and masternamespace
- the name of the namespaceIOException
public void postDeleteNamespace(ObserverContext<MasterCoprocessorEnvironment> ctx, String namespace) throws IOException
MasterObserver
postDeleteNamespace
in interface MasterObserver
ctx
- the environment to interact with the framework and masternamespace
- the name of the namespaceIOException
public void preModifyNamespace(ObserverContext<MasterCoprocessorEnvironment> ctx, NamespaceDescriptor ns) throws IOException
MasterObserver
preModifyNamespace
in interface MasterObserver
ctx
- the environment to interact with the framework and masterns
- the NamespaceDescriptorIOException
public void preGetNamespaceDescriptor(ObserverContext<MasterCoprocessorEnvironment> ctx, String namespace) throws IOException
MasterObserver
preGetNamespaceDescriptor
in interface MasterObserver
ctx
- the environment to interact with the framework and masternamespace
- the name of the namespaceIOException
public void postListNamespaceDescriptors(ObserverContext<MasterCoprocessorEnvironment> ctx, List<NamespaceDescriptor> descriptors) throws IOException
MasterObserver
postListNamespaceDescriptors
in interface MasterObserver
ctx
- the environment to interact with the framework and masterdescriptors
- the list of descriptors about to be returnedIOException
public void preTableFlush(ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName) throws IOException
MasterObserver
preTableFlush
in interface MasterObserver
ctx
- the environment to interact with the framework and mastertableName
- the name of the tableIOException
public void preSplitRegion(ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName, byte[] splitRow) throws IOException
MasterObserver
preSplitRegion
in interface MasterObserver
ctx
- the environment to interact with the framework and mastertableName
- the table where the region belongs tosplitRow
- split pointIOException
public void preClearDeadServers(ObserverContext<MasterCoprocessorEnvironment> ctx) throws IOException
MasterObserver
preClearDeadServers
in interface MasterObserver
IOException
public void preOpen(ObserverContext<RegionCoprocessorEnvironment> c) throws IOException
RegionObserver
preOpen
in interface RegionObserver
c
- the environment provided by the region serverIOException
public void postOpen(ObserverContext<RegionCoprocessorEnvironment> c)
RegionObserver
postOpen
in interface RegionObserver
c
- the environment provided by the region serverpublic void postLogReplay(ObserverContext<RegionCoprocessorEnvironment> c)
RegionObserver
postLogReplay
in interface RegionObserver
c
- the environment provided by the region serverpublic void preFlush(ObserverContext<RegionCoprocessorEnvironment> c) throws IOException
RegionObserver
preFlush
in interface RegionObserver
c
- the environment provided by the region serverIOException
public InternalScanner preCompact(ObserverContext<RegionCoprocessorEnvironment> c, Store store, InternalScanner scanner, ScanType scanType, CompactionLifeCycleTracker tracker) throws IOException
RegionObserver
StoreFile
s selected for compaction into a new
StoreFile
. To override or modify the compaction process, implementing classes have two
options:
InternalScanner
with a custom implementation that is returned
from this method. The custom scanner can then inspect
KeyValue
s from the wrapped scanner, applying its own
policy to what gets written.ObserverContext.bypass()
and provide a
custom implementation for writing of new StoreFile
s. Note: any implementations
bypassing core compaction using this approach must write out new store files themselves or the
existing data will no longer be available after compaction.preCompact
in interface RegionObserver
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 compactionnull
unless the
implementation is writing new store files on its own.IOException
public void preGetOp(ObserverContext<RegionCoprocessorEnvironment> c, Get get, List<Cell> result) throws IOException
RegionObserver
Call CoprocessorEnvironment#bypass to skip default actions
Call CoprocessorEnvironment#complete to skip any subsequent chained coprocessors
preGetOp
in interface RegionObserver
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.IOException
public boolean preExists(ObserverContext<RegionCoprocessorEnvironment> c, Get get, boolean exists) throws IOException
RegionObserver
Call CoprocessorEnvironment#bypass to skip default actions
Call CoprocessorEnvironment#complete to skip any subsequent chained coprocessors
preExists
in interface RegionObserver
c
- the environment provided by the region serverget
- the Get requestIOException
public void prePut(ObserverContext<RegionCoprocessorEnvironment> c, Put put, WALEdit edit, Durability durability) throws IOException
RegionObserver
Call CoprocessorEnvironment#bypass to skip default actions
Call CoprocessorEnvironment#complete to skip 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.
prePut
in interface RegionObserver
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 PutIOException
public void postPut(ObserverContext<RegionCoprocessorEnvironment> c, Put put, WALEdit edit, Durability durability)
RegionObserver
Call CoprocessorEnvironment#complete to skip 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.
postPut
in interface RegionObserver
c
- the environment provided by the region serverput
- The Put objectedit
- The WALEdit object for the waldurability
- Persistence guarantee for this Putpublic void preDelete(ObserverContext<RegionCoprocessorEnvironment> c, Delete delete, WALEdit edit, Durability durability) throws IOException
RegionObserver
Call CoprocessorEnvironment#bypass to skip default actions
Call CoprocessorEnvironment#complete to skip 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.
preDelete
in interface RegionObserver
c
- the environment provided by the region serverdelete
- The Delete objectedit
- The WALEdit object for the waldurability
- Persistence guarantee for this DeleteIOException
public void preBatchMutate(ObserverContext<RegionCoprocessorEnvironment> c, MiniBatchOperationInProgress<Mutation> miniBatchOp) throws IOException
RegionObserver
MiniBatchOperationInProgress.setOperationStatus(int, OperationStatus)
),
RegionObserver
can 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.
preBatchMutate
in interface RegionObserver
c
- the environment provided by the region serverminiBatchOp
- batch of Mutations getting applied to region.IOException
public void postDelete(ObserverContext<RegionCoprocessorEnvironment> c, Delete delete, WALEdit edit, Durability durability) throws IOException
RegionObserver
Call CoprocessorEnvironment#complete to skip 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.
postDelete
in interface RegionObserver
c
- the environment provided by the region serverdelete
- The Delete objectedit
- The WALEdit object for the waldurability
- Persistence guarantee for this DeleteIOException
public boolean preCheckAndPut(ObserverContext<RegionCoprocessorEnvironment> c, byte[] row, byte[] family, byte[] qualifier, CompareOperator op, ByteArrayComparable comparator, Put put, boolean result) throws IOException
RegionObserver
Call CoprocessorEnvironment#bypass to skip default actions
Call CoprocessorEnvironment#complete to skip 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.
preCheckAndPut
in interface RegionObserver
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 succeedsIOException
public boolean preCheckAndPutAfterRowLock(ObserverContext<RegionCoprocessorEnvironment> c, byte[] row, byte[] family, byte[] qualifier, CompareOperator opp, ByteArrayComparable comparator, Put put, boolean result) throws IOException
RegionObserver
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
Call CoprocessorEnvironment#complete to skip 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.
preCheckAndPutAfterRowLock
in interface RegionObserver
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 succeedsIOException
public boolean preCheckAndDelete(ObserverContext<RegionCoprocessorEnvironment> c, byte[] row, byte[] family, byte[] qualifier, CompareOperator op, ByteArrayComparable comparator, Delete delete, boolean result) throws IOException
RegionObserver
Call CoprocessorEnvironment#bypass to skip default actions
Call CoprocessorEnvironment#complete to skip 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.
preCheckAndDelete
in interface RegionObserver
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 succeedsIOException
public boolean preCheckAndDeleteAfterRowLock(ObserverContext<RegionCoprocessorEnvironment> c, byte[] row, byte[] family, byte[] qualifier, CompareOperator op, ByteArrayComparable comparator, Delete delete, boolean result) throws IOException
RegionObserver
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
Call CoprocessorEnvironment#complete to skip 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.
preCheckAndDeleteAfterRowLock
in interface RegionObserver
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 succeedsIOException
public Result preAppend(ObserverContext<RegionCoprocessorEnvironment> c, Append append) throws IOException
RegionObserver
Call CoprocessorEnvironment#bypass to skip default actions
Call CoprocessorEnvironment#complete to skip 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.
preAppend
in interface RegionObserver
c
- the environment provided by the region serverappend
- Append objectIOException
public Result preAppendAfterRowLock(ObserverContext<RegionCoprocessorEnvironment> c, Append append) throws IOException
RegionObserver
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
Call CoprocessorEnvironment#complete to skip 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.
preAppendAfterRowLock
in interface RegionObserver
c
- the environment provided by the region serverappend
- Append objectIOException
public Result preIncrement(ObserverContext<RegionCoprocessorEnvironment> c, Increment increment) throws IOException
RegionObserver
Call CoprocessorEnvironment#bypass to skip default actions
Call CoprocessorEnvironment#complete to skip 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.
preIncrement
in interface RegionObserver
c
- the environment provided by the region serverincrement
- increment objectIOException
public Result preIncrementAfterRowLock(ObserverContext<RegionCoprocessorEnvironment> c, Increment increment) throws IOException
RegionObserver
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
Call CoprocessorEnvironment#complete to skip 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.
preIncrementAfterRowLock
in interface RegionObserver
c
- the environment provided by the region serverincrement
- increment objectIOException
public Cell postMutationBeforeWAL(ObserverContext<RegionCoprocessorEnvironment> ctx, RegionObserver.MutationType opType, Mutation mutation, Cell oldCell, Cell newCell) throws IOException
RegionObserver
ObserverContext.bypass()
has no
effect in this hook.postMutationBeforeWAL
in interface RegionObserver
ctx
- the environment provided by the region serveropType
- the operation typemutation
- the current mutationoldCell
- old cell containing previous valuenewCell
- the new cell containing the computed valueIOException
public RegionScanner preScannerOpen(ObserverContext<RegionCoprocessorEnvironment> c, Scan scan, RegionScanner s) throws IOException
RegionObserver
Call CoprocessorEnvironment#bypass to skip default actions
Call CoprocessorEnvironment#complete to skip 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.
preScannerOpen
in interface RegionObserver
c
- the environment provided by the region serverscan
- the Scan specifications
- if not null, the base scannerIOException
public RegionScanner postScannerOpen(ObserverContext<RegionCoprocessorEnvironment> c, Scan scan, RegionScanner s) throws IOException
RegionObserver
Call CoprocessorEnvironment#complete to skip 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.
postScannerOpen
in interface RegionObserver
c
- the environment provided by the region serverscan
- the Scan specifications
- if not null, the base scannerIOException
public boolean preScannerNext(ObserverContext<RegionCoprocessorEnvironment> c, InternalScanner s, List<Result> result, int limit, boolean hasNext) throws IOException
RegionObserver
Call CoprocessorEnvironment#bypass to skip default actions
Call CoprocessorEnvironment#complete to skip 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.
preScannerNext
in interface RegionObserver
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' indicationIOException
public void preScannerClose(ObserverContext<RegionCoprocessorEnvironment> c, InternalScanner s) throws IOException
RegionObserver
Call CoprocessorEnvironment#bypass to skip default actions
Call CoprocessorEnvironment#complete to skip any subsequent chained coprocessors
preScannerClose
in interface RegionObserver
c
- the environment provided by the region servers
- the scannerIOException
public void postScannerClose(ObserverContext<RegionCoprocessorEnvironment> c, InternalScanner s) throws IOException
RegionObserver
Call CoprocessorEnvironment#complete to skip any subsequent chained coprocessors
postScannerClose
in interface RegionObserver
c
- the environment provided by the region servers
- the scannerIOException
public boolean postScannerFilterRow(ObserverContext<RegionCoprocessorEnvironment> e, InternalScanner s, Cell curRowCell, boolean hasMore) throws IOException
RegionObserver
boolean filterRowKey(byte [] buffer, int offset, int length)
returning trueboolean filterRow()
returning truedefault void filterRow(List<KeyValue> kvs)
removing all the kvs from
the passed ListNote: 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.
postScannerFilterRow
in interface RegionObserver
e
- the environment provided by the region servers
- the scannercurRowCell
- The cell in the current row which got filtered outhasMore
- the 'has more' indicationIOException
public void preBulkLoadHFile(ObserverContext<RegionCoprocessorEnvironment> ctx, List<Pair<byte[],String>> familyPaths) throws IOException
preBulkLoadHFile
in interface RegionObserver
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.IOException
public void prePrepareBulkLoad(ObserverContext<RegionCoprocessorEnvironment> ctx, org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.PrepareBulkLoadRequest request) throws IOException
prePrepareBulkLoad
in interface BulkLoadObserver
ctx
- the contextrequest
- the requestIOException
public void preCleanupBulkLoad(ObserverContext<RegionCoprocessorEnvironment> ctx, org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.CleanupBulkLoadRequest request) throws IOException
preCleanupBulkLoad
in interface BulkLoadObserver
ctx
- the contextrequest
- the requestIOException
public com.google.protobuf.Message preEndpointInvocation(ObserverContext<RegionCoprocessorEnvironment> ctx, com.google.protobuf.Service service, String methodName, com.google.protobuf.Message request) throws IOException
EndpointObserver
ObserverContext.bypass()
has no
effect in this hook.preEndpointInvocation
in interface EndpointObserver
ctx
- the environment provided by the region serverservice
- the endpoint servicemethodName
- the invoked service methodrequest
- Request message expected by given Service
's method (by the name
methodName
).IOException
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
EndpointObserver
postEndpointInvocation
in interface EndpointObserver
ctx
- the environment provided by the region serverservice
- the endpoint servicemethodName
- the invoked service methodrequest
- Request message expected by given Service
's method (by the name
methodName
).responseBuilder
- Builder for final response to the client, with original response from
Service's method merged into it.IOException
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)
grant
in interface org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.AccessControlService.Interface
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)
revoke
in interface org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.AccessControlService.Interface
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)
getUserPermissions
in interface org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.AccessControlService.Interface
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)
checkPermissions
in interface org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.AccessControlService.Interface
public com.google.protobuf.Service getService()
getService
in interface CoprocessorService
public void preClose(ObserverContext<RegionCoprocessorEnvironment> c, boolean abortRequested) throws IOException
RegionObserver
preClose
in interface RegionObserver
c
- the environment provided by the region serverabortRequested
- true if the region server is abortingIOException
public void preStopRegionServer(ObserverContext<RegionServerCoprocessorEnvironment> ctx) throws IOException
RegionServerObserver
preStopRegionServer
in interface RegionServerObserver
ctx
- the environment to interact with the framework and region server.IOException
public void preGetTableDescriptors(ObserverContext<MasterCoprocessorEnvironment> ctx, List<TableName> tableNamesList, List<TableDescriptor> descriptors, String regex) throws IOException
MasterObserver
preGetTableDescriptors
in interface MasterObserver
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 if bypassingregex
- regular expression used for filtering the table namesIOException
public void postGetTableDescriptors(ObserverContext<MasterCoprocessorEnvironment> ctx, List<TableName> tableNamesList, List<TableDescriptor> descriptors, String regex) throws IOException
MasterObserver
postGetTableDescriptors
in interface MasterObserver
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 namesIOException
public void postGetTableNames(ObserverContext<MasterCoprocessorEnvironment> ctx, List<TableDescriptor> descriptors, String regex) throws IOException
MasterObserver
postGetTableNames
in interface MasterObserver
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 namesIOException
public void preMergeRegions(ObserverContext<MasterCoprocessorEnvironment> ctx, HRegionInfo[] regionsToMerge) throws IOException
MasterObserver
preMergeRegions
in interface MasterObserver
ctx
- coprocessor environmentregionsToMerge
- regions to be mergedIOException
public void preMerge(ObserverContext<RegionServerCoprocessorEnvironment> ctx, Region regionA, Region regionB) throws IOException
RegionServerObserver
ObserverContext.bypass()
to skip the merge.preMerge
in interface RegionServerObserver
ctx
- the environment to interact with the framework and region server.regionA
- region being merged.regionB
- region being merged.IOException
public void postMerge(ObserverContext<RegionServerCoprocessorEnvironment> c, Region regionA, Region regionB, Region mergedRegion) throws IOException
RegionServerObserver
postMerge
in interface RegionServerObserver
c
- the environment to interact with the framework and region server.regionA
- region being merged.regionB
- region being merged.IOException
public void preMergeCommit(ObserverContext<RegionServerCoprocessorEnvironment> ctx, Region regionA, Region regionB, List<Mutation> metaEntries) throws IOException
RegionServerObserver
ObserverContext.bypass()
rollback the mergepreMergeCommit
in interface RegionServerObserver
ctx
- the environment to interact with the framework and region server.regionA
- region being merged.regionB
- region being merged.metaEntries
- mutations to execute on hbase:meta atomically with regions merge updates.
Any puts or deletes to execute on hbase:meta can be added to the mutations.IOException
public void postMergeCommit(ObserverContext<RegionServerCoprocessorEnvironment> ctx, Region regionA, Region regionB, Region mergedRegion) throws IOException
RegionServerObserver
postMergeCommit
in interface RegionServerObserver
ctx
- the environment to interact with the framework and region server.regionA
- region being merged.regionB
- region being merged.IOException
public void preRollBackMerge(ObserverContext<RegionServerCoprocessorEnvironment> ctx, Region regionA, Region regionB) throws IOException
RegionServerObserver
preRollBackMerge
in interface RegionServerObserver
ctx
- the environment to interact with the framework and region server.regionA
- region being merged.regionB
- region being merged.IOException
public void postRollBackMerge(ObserverContext<RegionServerCoprocessorEnvironment> ctx, Region regionA, Region regionB) throws IOException
RegionServerObserver
postRollBackMerge
in interface RegionServerObserver
ctx
- the environment to interact with the framework and region server.regionA
- region being merged.regionB
- region being merged.IOException
public void preRollWALWriterRequest(ObserverContext<RegionServerCoprocessorEnvironment> ctx) throws IOException
RegionServerObserver
preRollWALWriterRequest
in interface RegionServerObserver
ctx
- the environment to interact with the framework and region server.IOException
public void postRollWALWriterRequest(ObserverContext<RegionServerCoprocessorEnvironment> ctx) throws IOException
RegionServerObserver
postRollWALWriterRequest
in interface RegionServerObserver
ctx
- the environment to interact with the framework and region server.IOException
public void preSetUserQuota(ObserverContext<MasterCoprocessorEnvironment> ctx, String userName, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.Quotas quotas) throws IOException
MasterObserver
preSetUserQuota
in interface MasterObserver
ctx
- the environment to interact with the framework and masteruserName
- the name of userquotas
- the quota settingsIOException
public void preSetUserQuota(ObserverContext<MasterCoprocessorEnvironment> ctx, String userName, TableName tableName, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.Quotas quotas) throws IOException
MasterObserver
preSetUserQuota
in interface MasterObserver
ctx
- the environment to interact with the framework and masteruserName
- the name of usertableName
- the name of the tablequotas
- the quota settingsIOException
public void preSetUserQuota(ObserverContext<MasterCoprocessorEnvironment> ctx, String userName, String namespace, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.Quotas quotas) throws IOException
MasterObserver
preSetUserQuota
in interface MasterObserver
ctx
- the environment to interact with the framework and masteruserName
- the name of usernamespace
- the name of the namespacequotas
- the quota settingsIOException
public void preSetTableQuota(ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.Quotas quotas) throws IOException
MasterObserver
preSetTableQuota
in interface MasterObserver
ctx
- the environment to interact with the framework and mastertableName
- the name of the tablequotas
- the quota settingsIOException
public void preSetNamespaceQuota(ObserverContext<MasterCoprocessorEnvironment> ctx, String namespace, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.Quotas quotas) throws IOException
MasterObserver
preSetNamespaceQuota
in interface MasterObserver
ctx
- the environment to interact with the framework and masternamespace
- the name of the namespacequotas
- the quota settingsIOException
public ReplicationEndpoint postCreateReplicationEndPoint(ObserverContext<RegionServerCoprocessorEnvironment> ctx, ReplicationEndpoint endpoint)
RegionServerObserver
postCreateReplicationEndPoint
in interface RegionServerObserver
ctx
- the environment to interact with the framework and region server.endpoint
- - the base endpoint for replicationpublic void preReplicateLogEntries(ObserverContext<RegionServerCoprocessorEnvironment> ctx, List<org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.WALEntry> entries, CellScanner cells) throws IOException
RegionServerObserver
preReplicateLogEntries
in interface RegionServerObserver
ctx
- the environment to interact with the framework and region server.entries
- list of WALEntries to replicatecells
- Cells that the WALEntries refer to (if cells is non-null)IOException
public void postReplicateLogEntries(ObserverContext<RegionServerCoprocessorEnvironment> ctx, List<org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.WALEntry> entries, CellScanner cells) throws IOException
RegionServerObserver
postReplicateLogEntries
in interface RegionServerObserver
ctx
- the environment to interact with the framework and region server.entries
- list of WALEntries to replicatecells
- Cells that the WALEntries refer to (if cells is non-null)IOException
public void preClearCompactionQueues(ObserverContext<RegionServerCoprocessorEnvironment> ctx) throws IOException
RegionServerObserver
preClearCompactionQueues
in interface RegionServerObserver
ctx
- the environment to interact with the framework and region server.IOException
public void preMoveServersAndTables(ObserverContext<MasterCoprocessorEnvironment> ctx, Set<Address> servers, Set<TableName> tables, String targetGroup) throws IOException
MasterObserver
preMoveServersAndTables
in interface MasterObserver
ctx
- the environment to interact with the framework and masterservers
- set of servers to movetargetGroup
- destination groupIOException
public void preMoveServers(ObserverContext<MasterCoprocessorEnvironment> ctx, Set<Address> servers, String targetGroup) throws IOException
MasterObserver
preMoveServers
in interface MasterObserver
ctx
- the environment to interact with the framework and masterservers
- set of servers to movetargetGroup
- destination groupIOException
public void preMoveTables(ObserverContext<MasterCoprocessorEnvironment> ctx, Set<TableName> tables, String targetGroup) throws IOException
MasterObserver
preMoveTables
in interface MasterObserver
ctx
- the environment to interact with the framework and mastertables
- set of tables to movetargetGroup
- name of groupIOException
public void preAddRSGroup(ObserverContext<MasterCoprocessorEnvironment> ctx, String name) throws IOException
MasterObserver
preAddRSGroup
in interface MasterObserver
ctx
- the environment to interact with the framework and mastername
- group nameIOException
public void preRemoveRSGroup(ObserverContext<MasterCoprocessorEnvironment> ctx, String name) throws IOException
MasterObserver
preRemoveRSGroup
in interface MasterObserver
ctx
- the environment to interact with the framework and mastername
- group nameIOException
public void preBalanceRSGroup(ObserverContext<MasterCoprocessorEnvironment> ctx, String groupName) throws IOException
MasterObserver
preBalanceRSGroup
in interface MasterObserver
ctx
- the environment to interact with the framework and mastergroupName
- group nameIOException
public void preAddReplicationPeer(ObserverContext<MasterCoprocessorEnvironment> ctx, String peerId, ReplicationPeerConfig peerConfig) throws IOException
MasterObserver
preAddReplicationPeer
in interface MasterObserver
ctx
- the environment to interact with the framework and masterpeerId
- a short name that identifies the peerpeerConfig
- configuration for the replication peerIOException
public void preRemoveReplicationPeer(ObserverContext<MasterCoprocessorEnvironment> ctx, String peerId) throws IOException
MasterObserver
preRemoveReplicationPeer
in interface MasterObserver
peerId
- a short name that identifies the peerIOException
public void preEnableReplicationPeer(ObserverContext<MasterCoprocessorEnvironment> ctx, String peerId) throws IOException
MasterObserver
preEnableReplicationPeer
in interface MasterObserver
peerId
- a short name that identifies the peerIOException
public void preDisableReplicationPeer(ObserverContext<MasterCoprocessorEnvironment> ctx, String peerId) throws IOException
MasterObserver
preDisableReplicationPeer
in interface MasterObserver
peerId
- a short name that identifies the peerIOException
public void preGetReplicationPeerConfig(ObserverContext<MasterCoprocessorEnvironment> ctx, String peerId) throws IOException
MasterObserver
preGetReplicationPeerConfig
in interface MasterObserver
peerId
- a short name that identifies the peerIOException
public void preUpdateReplicationPeerConfig(ObserverContext<MasterCoprocessorEnvironment> ctx, String peerId, ReplicationPeerConfig peerConfig) throws IOException
MasterObserver
preUpdateReplicationPeerConfig
in interface MasterObserver
peerId
- a short name that identifies the peerIOException
public void preListReplicationPeers(ObserverContext<MasterCoprocessorEnvironment> ctx, String regex) throws IOException
MasterObserver
preListReplicationPeers
in interface MasterObserver
ctx
- the environment to interact with the framework and masterregex
- The regular expression to match peer idIOException
public void preRequestLock(ObserverContext<MasterCoprocessorEnvironment> ctx, String namespace, TableName tableName, HRegionInfo[] regionInfos, LockType type, String description) throws IOException
MasterObserver
preRequestLock
in interface MasterObserver
ctx
- the environment to interact with the framework and masterIOException
public void preLockHeartbeat(ObserverContext<MasterCoprocessorEnvironment> ctx, LockProcedure proc, boolean keepAlive) throws IOException
MasterObserver
preLockHeartbeat
in interface MasterObserver
ctx
- the environment to interact with the framework and masterkeepAlive
- if lock should be kept alive; lock will be released if set to false.IOException
Copyright © 2007–2017 The Apache Software Foundation. All rights reserved.