org.apache.hadoop.hbase.security.access
Class AccessController

java.lang.Object
  extended by org.apache.hadoop.hbase.coprocessor.BaseRegionObserver
      extended by org.apache.hadoop.hbase.coprocessor.BaseMasterAndRegionObserver
          extended by org.apache.hadoop.hbase.security.access.AccessController
All Implemented Interfaces:
Coprocessor, BulkLoadObserver, CoprocessorService, EndpointObserver, MasterObserver, RegionObserver, RegionServerObserver, AccessControlProtos.AccessControlService.Interface

@InterfaceAudience.LimitedPrivate(value="Configuration")
public class AccessController
extends BaseMasterAndRegionObserver
implements RegionServerObserver, AccessControlProtos.AccessControlService.Interface, CoprocessorService, EndpointObserver, BulkLoadObserver

Provides basic authorization checks for data access and administrative operations.

AccessController performs authorization checks for HBase operations based on:

If the authorization check fails, an AccessDeniedException will be thrown for the operation.

To perform authorization checks, AccessController relies on the org.apache.hadoop.hbase.ipc.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 classes/interfaces inherited from interface org.apache.hadoop.hbase.Coprocessor
Coprocessor.State
 
Nested classes/interfaces inherited from interface org.apache.hadoop.hbase.coprocessor.RegionObserver
RegionObserver.MutationType
 
Field Summary
static org.apache.commons.logging.Log LOG
           
 
Fields inherited from interface org.apache.hadoop.hbase.Coprocessor
PRIORITY_HIGHEST, PRIORITY_LOWEST, PRIORITY_SYSTEM, PRIORITY_USER, VERSION
 
Constructor Summary
AccessController()
           
 
Method Summary
 void checkPermissions(com.google.protobuf.RpcController controller, AccessControlProtos.CheckPermissionsRequest request, com.google.protobuf.RpcCallback<AccessControlProtos.CheckPermissionsResponse> done)
          rpc CheckPermissions(.CheckPermissionsRequest) returns (.CheckPermissionsResponse);
 TableAuthManager getAuthManager()
           
 HRegion getRegion()
           
 com.google.protobuf.Service getService()
           
 void getUserPermissions(com.google.protobuf.RpcController controller, AccessControlProtos.GetUserPermissionsRequest request, com.google.protobuf.RpcCallback<AccessControlProtos.GetUserPermissionsResponse> done)
          rpc GetUserPermissions(.GetUserPermissionsRequest) returns (.GetUserPermissionsResponse);
 void grant(com.google.protobuf.RpcController controller, AccessControlProtos.GrantRequest request, com.google.protobuf.RpcCallback<AccessControlProtos.GrantResponse> done)
          rpc Grant(.GrantRequest) returns (.GrantResponse);
static boolean isAuthorizationSupported(org.apache.hadoop.conf.Configuration conf)
           
static boolean isCellAuthorizationSupported(org.apache.hadoop.conf.Configuration conf)
           
 ReplicationEndpoint postCreateReplicationEndPoint(ObserverContext<RegionServerCoprocessorEnvironment> ctx, ReplicationEndpoint endpoint)
          This will be called after the replication endpoint is instantiated.
 void postCreateTableHandler(ObserverContext<MasterCoprocessorEnvironment> c, HTableDescriptor desc, HRegionInfo[] regions)
          Called after the createTable operation has been requested.
 void postDelete(ObserverContext<RegionCoprocessorEnvironment> c, Delete delete, WALEdit edit, Durability durability)
          Called after the client deletes a value.
 void postDeleteColumn(ObserverContext<MasterCoprocessorEnvironment> c, TableName tableName, byte[] col)
          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 postLogReplay(ObserverContext<RegionCoprocessorEnvironment> c)
          Called after the log replay on the region is over.
 void postMerge(ObserverContext<RegionServerCoprocessorEnvironment> c, HRegion regionA, HRegion regionB, HRegion mergedRegion)
          called after the regions merge.
 void postMergeCommit(ObserverContext<RegionServerCoprocessorEnvironment> ctx, HRegion regionA, HRegion regionB, HRegion mergedRegion)
          This will be called after PONR step as part of regions merge transaction.
 void postModifyTable(ObserverContext<MasterCoprocessorEnvironment> c, TableName tableName, HTableDescriptor 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<AdminProtos.WALEntry> entries, CellScanner cells)
          This will be called after executing replication request to shipping log entries.
 void postRollBackMerge(ObserverContext<RegionServerCoprocessorEnvironment> ctx, HRegion regionA, HRegion 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.
 RegionScanner postScannerOpen(ObserverContext<RegionCoprocessorEnvironment> c, Scan scan, RegionScanner s)
          Called after the client opens a new scanner.
 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 postTruncateTableHandler(ObserverContext<MasterCoprocessorEnvironment> c, TableName tableName)
          Called after HMaster truncates a table.
 void preAddColumn(ObserverContext<MasterCoprocessorEnvironment> c, TableName tableName, HColumnDescriptor column)
          Called prior to adding a new column family to the table.
 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.
 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, CompareFilter.CompareOp compareOp, ByteArrayComparable comparator, Delete delete, boolean result)
          Called before checkAndDelete.
 boolean preCheckAndDeleteAfterRowLock(ObserverContext<RegionCoprocessorEnvironment> c, byte[] row, byte[] family, byte[] qualifier, CompareFilter.CompareOp compareOp, ByteArrayComparable comparator, Delete delete, boolean result)
          Called before checkAndDelete but after acquiring rowock.
 boolean preCheckAndPut(ObserverContext<RegionCoprocessorEnvironment> c, byte[] row, byte[] family, byte[] qualifier, CompareFilter.CompareOp compareOp, ByteArrayComparable comparator, Put put, boolean result)
          Called before checkAndPut.
 boolean preCheckAndPutAfterRowLock(ObserverContext<RegionCoprocessorEnvironment> c, byte[] row, byte[] family, byte[] qualifier, CompareFilter.CompareOp compareOp, ByteArrayComparable comparator, Put put, boolean result)
          Called before checkAndPut but after acquiring rowlock.
 void preCleanupBulkLoad(ObserverContext<RegionCoprocessorEnvironment> ctx, SecureBulkLoadProtos.CleanupBulkLoadRequest request)
          Authorization security check for SecureBulkLoadProtocol.cleanupBulkLoad()
 void preCloneSnapshot(ObserverContext<MasterCoprocessorEnvironment> ctx, HBaseProtos.SnapshotDescription snapshot, HTableDescriptor hTableDescriptor)
          Called before a snapshot is cloned.
 void preClose(ObserverContext<RegionCoprocessorEnvironment> e, boolean abortRequested)
          Called before the region is reported as closed to the master.
 InternalScanner preCompact(ObserverContext<RegionCoprocessorEnvironment> e, Store store, InternalScanner scanner, ScanType scanType)
          Called prior to writing the StoreFiles 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, HTableDescriptor 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 preDeleteColumn(ObserverContext<MasterCoprocessorEnvironment> c, TableName tableName, byte[] col)
          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, HBaseProtos.SnapshotDescription snapshot)
          Called before a snapshot is deleted.
 void preDeleteTable(ObserverContext<MasterCoprocessorEnvironment> c, TableName tableName)
          Called before HMaster deletes a table.
 void preDisableTable(ObserverContext<MasterCoprocessorEnvironment> c, TableName tableName)
          Called prior to disabling a table.
 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> e)
          Called before the memstore is flushed to disk.
 void preGetClosestRowBefore(ObserverContext<RegionCoprocessorEnvironment> c, byte[] row, byte[] family, Result result)
          Called before a client makes a GetClosestRowBefore request.
 void preGetOp(ObserverContext<RegionCoprocessorEnvironment> c, Get get, List<Cell> result)
          Called before the client performs a Get
 void preGetTableDescriptors(ObserverContext<MasterCoprocessorEnvironment> ctx, List<TableName> tableNamesList, List<HTableDescriptor> descriptors)
          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.
 long preIncrementColumnValue(ObserverContext<RegionCoprocessorEnvironment> c, byte[] row, byte[] family, byte[] qualifier, long amount, boolean writeToWAL)
          Called before incrementColumnValue
 void preMerge(ObserverContext<RegionServerCoprocessorEnvironment> ctx, HRegion regionA, HRegion regionB)
          Called before the regions merge.
 void preMergeCommit(ObserverContext<RegionServerCoprocessorEnvironment> ctx, HRegion regionA, HRegion regionB, List<Mutation> metaEntries)
          This will be called before PONR step as part of regions merge transaction.
 void preModifyColumn(ObserverContext<MasterCoprocessorEnvironment> c, TableName tableName, HColumnDescriptor descriptor)
          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, HTableDescriptor 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 preOpen(ObserverContext<RegionCoprocessorEnvironment> e)
          Called before the region is reported as open to the master.
 void prePrepareBulkLoad(ObserverContext<RegionCoprocessorEnvironment> ctx, SecureBulkLoadProtos.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 preReplicateLogEntries(ObserverContext<RegionServerCoprocessorEnvironment> ctx, List<AdminProtos.WALEntry> entries, CellScanner cells)
          This will be called before executing replication request to shipping log entries.
 void preRestoreSnapshot(ObserverContext<MasterCoprocessorEnvironment> ctx, HBaseProtos.SnapshotDescription snapshot, HTableDescriptor hTableDescriptor)
          Called before a snapshot is restored.
 void preRollBackMerge(ObserverContext<RegionServerCoprocessorEnvironment> ctx, HRegion regionA, HRegion 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 preShutdown(ObserverContext<MasterCoprocessorEnvironment> c)
          Called prior to shutting down the full HBase cluster, including this HMaster process.
 void preSnapshot(ObserverContext<MasterCoprocessorEnvironment> ctx, HBaseProtos.SnapshotDescription snapshot, HTableDescriptor hTableDescriptor)
          Called before a new snapshot is taken.
 void preSplit(ObserverContext<RegionCoprocessorEnvironment> e)
          Called before the region is split.
 void preSplit(ObserverContext<RegionCoprocessorEnvironment> e, byte[] splitRow)
          Called before the region is split.
 void preStopMaster(ObserverContext<MasterCoprocessorEnvironment> c)
          Called immediately prior to stopping this HMaster process.
 void preStopRegionServer(ObserverContext<RegionServerCoprocessorEnvironment> env)
          Called before stopping region server.
 void preTruncateTable(ObserverContext<MasterCoprocessorEnvironment> c, TableName tableName)
          Called before HMaster truncates a table.
 void preTruncateTableHandler(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 requireNamespacePermission(String request, String namespace, Permission.Action... permissions)
          Checks that the user has the given global or namespace permission.
 void requireNamespacePermission(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, AccessControlProtos.RevokeRequest request, com.google.protobuf.RpcCallback<AccessControlProtos.RevokeResponse> done)
          rpc Revoke(.RevokeRequest) returns (.RevokeResponse);
 void start(CoprocessorEnvironment env)
           
 void stop(CoprocessorEnvironment env)
           
 
Methods inherited from class org.apache.hadoop.hbase.coprocessor.BaseMasterAndRegionObserver
postAddColumn, postAddColumnHandler, postAssign, postBalance, postBalanceSwitch, postCloneSnapshot, postCreateNamespace, postCreateTable, postDeleteColumnHandler, postDeleteSnapshot, postDeleteTableHandler, postDisableTable, postDisableTableHandler, postEnableTable, postEnableTableHandler, postGetTableDescriptors, postModifyColumn, postModifyColumnHandler, postModifyNamespace, postModifyTableHandler, postMove, postRegionOffline, postRestoreSnapshot, postSnapshot, postUnassign, preAddColumnHandler, preCreateTableHandler, preDeleteColumnHandler, preDeleteTableHandler, preDisableTableHandler, preEnableTableHandler, preMasterInitialization, preModifyColumnHandler, preModifyTableHandler
 
Methods inherited from class org.apache.hadoop.hbase.coprocessor.BaseRegionObserver
postAppend, postBatchMutate, postBatchMutateIndispensably, postBulkLoadHFile, postCheckAndDelete, postCheckAndPut, postClose, postCloseRegionOperation, postCompact, postCompact, postCompactSelection, postCompactSelection, postCompleteSplit, postExists, postFlush, postFlush, postGet, postGetClosestRowBefore, postGetOp, postIncrement, postIncrementColumnValue, postInstantiateDeleteTracker, postRollBackSplit, postScannerFilterRow, postScannerNext, postSplit, postStartRegionOperation, postStoreFileReaderOpen, postWALRestore, preCompact, preCompactScannerOpen, preCompactScannerOpen, preCompactSelection, preCompactSelection, preFlush, preFlushScannerOpen, preGet, prePrepareTimeStampForDeleteVersion, preRollBackSplit, preSplitAfterPONR, preSplitBeforePONR, preStoreFileReaderOpen, preStoreScannerOpen, preWALRestore
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

public static final org.apache.commons.logging.Log LOG
Constructor Detail

AccessController

public AccessController()
Method Detail

isAuthorizationSupported

public static boolean isAuthorizationSupported(org.apache.hadoop.conf.Configuration conf)

isCellAuthorizationSupported

public static boolean isCellAuthorizationSupported(org.apache.hadoop.conf.Configuration conf)

getRegion

public HRegion getRegion()

getAuthManager

public TableAuthManager getAuthManager()

requireNamespacePermission

public void requireNamespacePermission(String request,
                                       String namespace,
                                       Permission.Action... permissions)
                                throws IOException
Checks that the user has the given global or namespace permission.

Parameters:
namespace -
permissions - Actions being requested
Throws:
IOException

requireNamespacePermission

public void requireNamespacePermission(String request,
                                       String namespace,
                                       TableName tableName,
                                       Map<byte[],? extends Collection<byte[]>> familyMap,
                                       Permission.Action... permissions)
                                throws IOException
Checks that the user has the given global or namespace permission.

Parameters:
namespace -
permissions - Actions being requested
Throws:
IOException

start

public void start(CoprocessorEnvironment env)
           throws IOException
Specified by:
start in interface Coprocessor
Overrides:
start in class BaseMasterAndRegionObserver
Throws:
IOException

stop

public void stop(CoprocessorEnvironment env)
Specified by:
stop in interface Coprocessor
Overrides:
stop in class BaseMasterAndRegionObserver

preTruncateTable

public void preTruncateTable(ObserverContext<MasterCoprocessorEnvironment> c,
                             TableName tableName)
                      throws IOException
Description copied from interface: MasterObserver
Called before 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.

Specified by:
preTruncateTable in interface MasterObserver
Parameters:
c - the environment to interact with the framework and master
tableName - the name of the table
Throws:
IOException

postTruncateTable

public void postTruncateTable(ObserverContext<MasterCoprocessorEnvironment> ctx,
                              TableName tableName)
                       throws IOException
Description copied from interface: MasterObserver
Called 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:
postTruncateTable in interface MasterObserver
Parameters:
ctx - the environment to interact with the framework and master
tableName - the name of the table
Throws:
IOException

preTruncateTableHandler

public void preTruncateTableHandler(ObserverContext<MasterCoprocessorEnvironment> c,
                                    TableName tableName)
                             throws IOException
Description copied from interface: MasterObserver
Called before HMaster truncates a table. Called as part of truncate table handler and it is sync to the truncate RPC call. It can't bypass the default action, e.g., ctx.bypass() won't have effect.

Specified by:
preTruncateTableHandler in interface MasterObserver
Parameters:
c - the environment to interact with the framework and master
tableName - the name of the table
Throws:
IOException

postTruncateTableHandler

public void postTruncateTableHandler(ObserverContext<MasterCoprocessorEnvironment> c,
                                     TableName tableName)
                              throws IOException
Description copied from interface: MasterObserver
Called after HMaster truncates a table. Called as part of truncate table handler and it is sync to the truncate RPC call. It can't bypass the default action, e.g., ctx.bypass() won't have effect.

Specified by:
postTruncateTableHandler in interface MasterObserver
Parameters:
c - the environment to interact with the framework and master
tableName - the name of the table
Throws:
IOException

preCreateTable

public void preCreateTable(ObserverContext<MasterCoprocessorEnvironment> c,
                           HTableDescriptor desc,
                           HRegionInfo[] regions)
                    throws IOException
Description copied from interface: MasterObserver
Called before a new table is created by HMaster. Called as part of create table RPC call. It can't bypass the default action, e.g., ctx.bypass() won't have effect.

Specified by:
preCreateTable in interface MasterObserver
Overrides:
preCreateTable in class BaseMasterAndRegionObserver
Parameters:
c - the environment to interact with the framework and master
desc - the HTableDescriptor for the table
regions - the initial regions created for the table
Throws:
IOException

postCreateTableHandler

public void postCreateTableHandler(ObserverContext<MasterCoprocessorEnvironment> c,
                                   HTableDescriptor desc,
                                   HRegionInfo[] regions)
                            throws IOException
Description copied from interface: MasterObserver
Called after the createTable operation has been requested. Called as part of create table RPC call. Called as part of create table handler and it is async to the create RPC call.

Specified by:
postCreateTableHandler in interface MasterObserver
Overrides:
postCreateTableHandler in class BaseMasterAndRegionObserver
Parameters:
c - the environment to interact with the framework and master
desc - the HTableDescriptor for the table
regions - the initial regions created for the table
Throws:
IOException

preDeleteTable

public void preDeleteTable(ObserverContext<MasterCoprocessorEnvironment> c,
                           TableName tableName)
                    throws IOException
Description copied from interface: MasterObserver
Called before 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.

Specified by:
preDeleteTable in interface MasterObserver
Overrides:
preDeleteTable in class BaseMasterAndRegionObserver
Parameters:
c - the environment to interact with the framework and master
tableName - the name of the table
Throws:
IOException

postDeleteTable

public void postDeleteTable(ObserverContext<MasterCoprocessorEnvironment> c,
                            TableName tableName)
                     throws IOException
Description copied from interface: MasterObserver
Called after the deleteTable operation has been requested. Called as part of delete table RPC call.

Specified by:
postDeleteTable in interface MasterObserver
Overrides:
postDeleteTable in class BaseMasterAndRegionObserver
Parameters:
c - the environment to interact with the framework and master
tableName - the name of the table
Throws:
IOException

preModifyTable

public void preModifyTable(ObserverContext<MasterCoprocessorEnvironment> c,
                           TableName tableName,
                           HTableDescriptor htd)
                    throws IOException
Description copied from interface: MasterObserver
Called prior to modifying a table's properties. Called as part of modify table RPC call. It can't bypass the default action, e.g., ctx.bypass() won't have effect.

Specified by:
preModifyTable in interface MasterObserver
Overrides:
preModifyTable in class BaseMasterAndRegionObserver
Parameters:
c - the environment to interact with the framework and master
tableName - the name of the table
htd - the HTableDescriptor
Throws:
IOException

postModifyTable

public void postModifyTable(ObserverContext<MasterCoprocessorEnvironment> c,
                            TableName tableName,
                            HTableDescriptor htd)
                     throws IOException
Description copied from interface: MasterObserver
Called after the modifyTable operation has been requested. Called as part of modify table RPC call.

Specified by:
postModifyTable in interface MasterObserver
Overrides:
postModifyTable in class BaseMasterAndRegionObserver
Parameters:
c - the environment to interact with the framework and master
tableName - the name of the table
htd - the HTableDescriptor
Throws:
IOException

preAddColumn

public void preAddColumn(ObserverContext<MasterCoprocessorEnvironment> c,
                         TableName tableName,
                         HColumnDescriptor column)
                  throws IOException
Description copied from interface: MasterObserver
Called prior to adding a new column family to the table. Called as part of add column RPC call.

Specified by:
preAddColumn in interface MasterObserver
Overrides:
preAddColumn in class BaseMasterAndRegionObserver
Parameters:
c - the environment to interact with the framework and master
tableName - the name of the table
column - the HColumnDescriptor
Throws:
IOException

preModifyColumn

public void preModifyColumn(ObserverContext<MasterCoprocessorEnvironment> c,
                            TableName tableName,
                            HColumnDescriptor descriptor)
                     throws IOException
Description copied from interface: MasterObserver
Called prior to modifying a column family's attributes. Called as part of modify column RPC call.

Specified by:
preModifyColumn in interface MasterObserver
Overrides:
preModifyColumn in class BaseMasterAndRegionObserver
Parameters:
c - the environment to interact with the framework and master
tableName - the name of the table
descriptor - the HColumnDescriptor
Throws:
IOException

preDeleteColumn

public void preDeleteColumn(ObserverContext<MasterCoprocessorEnvironment> c,
                            TableName tableName,
                            byte[] col)
                     throws IOException
Description copied from interface: MasterObserver
Called prior to deleting the entire column family. Called as part of delete column RPC call.

Specified by:
preDeleteColumn in interface MasterObserver
Overrides:
preDeleteColumn in class BaseMasterAndRegionObserver
Parameters:
c - the environment to interact with the framework and master
tableName - the name of the table
col - the column
Throws:
IOException

postDeleteColumn

public void postDeleteColumn(ObserverContext<MasterCoprocessorEnvironment> c,
                             TableName tableName,
                             byte[] col)
                      throws IOException
Description copied from interface: MasterObserver
Called after the column family has been deleted. Called as part of delete column RPC call.

Specified by:
postDeleteColumn in interface MasterObserver
Overrides:
postDeleteColumn in class BaseMasterAndRegionObserver
Parameters:
c - the environment to interact with the framework and master
tableName - the name of the table
col - the column
Throws:
IOException

preEnableTable

public void preEnableTable(ObserverContext<MasterCoprocessorEnvironment> c,
                           TableName tableName)
                    throws IOException
Description copied from interface: MasterObserver
Called prior to enabling a table. Called as part of enable table RPC call. It can't bypass the default action, e.g., ctx.bypass() won't have effect.

Specified by:
preEnableTable in interface MasterObserver
Overrides:
preEnableTable in class BaseMasterAndRegionObserver
Parameters:
c - the environment to interact with the framework and master
tableName - the name of the table
Throws:
IOException

preDisableTable

public void preDisableTable(ObserverContext<MasterCoprocessorEnvironment> c,
                            TableName tableName)
                     throws IOException
Description copied from interface: MasterObserver
Called prior to disabling a table. Called as part of disable table RPC call. It can't bypass the default action, e.g., ctx.bypass() won't have effect.

Specified by:
preDisableTable in interface MasterObserver
Overrides:
preDisableTable in class BaseMasterAndRegionObserver
Parameters:
c - the environment to interact with the framework and master
tableName - the name of the table
Throws:
IOException

preMove

public void preMove(ObserverContext<MasterCoprocessorEnvironment> c,
                    HRegionInfo region,
                    ServerName srcServer,
                    ServerName destServer)
             throws IOException
Description copied from interface: MasterObserver
Called prior to moving a given region from one region server to another.

Specified by:
preMove in interface MasterObserver
Overrides:
preMove in class BaseMasterAndRegionObserver
Parameters:
c - the environment to interact with the framework and master
region - the HRegionInfo
srcServer - the source ServerName
destServer - the destination ServerName
Throws:
IOException

preAssign

public void preAssign(ObserverContext<MasterCoprocessorEnvironment> c,
                      HRegionInfo regionInfo)
               throws IOException
Description copied from interface: MasterObserver
Called prior to assigning a specific region.

Specified by:
preAssign in interface MasterObserver
Overrides:
preAssign in class BaseMasterAndRegionObserver
Parameters:
c - the environment to interact with the framework and master
regionInfo - the regionInfo of the region
Throws:
IOException

preUnassign

public void preUnassign(ObserverContext<MasterCoprocessorEnvironment> c,
                        HRegionInfo regionInfo,
                        boolean force)
                 throws IOException
Description copied from interface: MasterObserver
Called prior to unassigning a given region.

Specified by:
preUnassign in interface MasterObserver
Overrides:
preUnassign in class BaseMasterAndRegionObserver
Parameters:
c - the environment to interact with the framework and master
force - whether to force unassignment or not
Throws:
IOException

preRegionOffline

public void preRegionOffline(ObserverContext<MasterCoprocessorEnvironment> c,
                             HRegionInfo regionInfo)
                      throws IOException
Description copied from interface: MasterObserver
Called prior to marking a given region as offline. ctx.bypass() will not have any impact on this hook.

Specified by:
preRegionOffline in interface MasterObserver
Overrides:
preRegionOffline in class BaseMasterAndRegionObserver
Parameters:
c - the environment to interact with the framework and master
Throws:
IOException

preBalance

public void preBalance(ObserverContext<MasterCoprocessorEnvironment> c)
                throws IOException
Description copied from interface: MasterObserver
Called prior to requesting rebalancing of the cluster regions, though after the initial checks for regions in transition and the balance switch flag.

Specified by:
preBalance in interface MasterObserver
Overrides:
preBalance in class BaseMasterAndRegionObserver
Parameters:
c - the environment to interact with the framework and master
Throws:
IOException

preBalanceSwitch

public boolean preBalanceSwitch(ObserverContext<MasterCoprocessorEnvironment> c,
                                boolean newValue)
                         throws IOException
Description copied from interface: MasterObserver
Called prior to modifying the flag used to enable/disable region balancing.

Specified by:
preBalanceSwitch in interface MasterObserver
Overrides:
preBalanceSwitch in class BaseMasterAndRegionObserver
Parameters:
c - the coprocessor instance's environment
newValue - the new flag value submitted in the call
Throws:
IOException

preShutdown

public void preShutdown(ObserverContext<MasterCoprocessorEnvironment> c)
                 throws IOException
Description copied from interface: MasterObserver
Called prior to shutting down the full HBase cluster, including this HMaster process.

Specified by:
preShutdown in interface MasterObserver
Overrides:
preShutdown in class BaseMasterAndRegionObserver
Throws:
IOException

preStopMaster

public void preStopMaster(ObserverContext<MasterCoprocessorEnvironment> c)
                   throws IOException
Description copied from interface: MasterObserver
Called immediately prior to stopping this HMaster process.

Specified by:
preStopMaster in interface MasterObserver
Overrides:
preStopMaster in class BaseMasterAndRegionObserver
Throws:
IOException

postStartMaster

public void postStartMaster(ObserverContext<MasterCoprocessorEnvironment> ctx)
                     throws IOException
Description copied from interface: MasterObserver
Called 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:
postStartMaster in interface MasterObserver
Overrides:
postStartMaster in class BaseMasterAndRegionObserver
Throws:
IOException

preSnapshot

public void preSnapshot(ObserverContext<MasterCoprocessorEnvironment> ctx,
                        HBaseProtos.SnapshotDescription snapshot,
                        HTableDescriptor hTableDescriptor)
                 throws IOException
Description copied from interface: MasterObserver
Called before a new snapshot is taken. Called as part of snapshot RPC call. It can't bypass the default action, e.g., ctx.bypass() won't have effect.

Specified by:
preSnapshot in interface MasterObserver
Overrides:
preSnapshot in class BaseMasterAndRegionObserver
Parameters:
ctx - the environment to interact with the framework and master
snapshot - the SnapshotDescriptor for the snapshot
hTableDescriptor - the hTableDescriptor of the table to snapshot
Throws:
IOException

preCloneSnapshot

public void preCloneSnapshot(ObserverContext<MasterCoprocessorEnvironment> ctx,
                             HBaseProtos.SnapshotDescription snapshot,
                             HTableDescriptor hTableDescriptor)
                      throws IOException
Description copied from interface: MasterObserver
Called before a snapshot is cloned. Called as part of restoreSnapshot RPC call. It can't bypass the default action, e.g., ctx.bypass() won't have effect.

Specified by:
preCloneSnapshot in interface MasterObserver
Overrides:
preCloneSnapshot in class BaseMasterAndRegionObserver
Parameters:
ctx - the environment to interact with the framework and master
snapshot - the SnapshotDescriptor for the snapshot
hTableDescriptor - the hTableDescriptor of the table to create
Throws:
IOException

preRestoreSnapshot

public void preRestoreSnapshot(ObserverContext<MasterCoprocessorEnvironment> ctx,
                               HBaseProtos.SnapshotDescription snapshot,
                               HTableDescriptor hTableDescriptor)
                        throws IOException
Description copied from interface: MasterObserver
Called before a snapshot is restored. Called as part of restoreSnapshot RPC call. It can't bypass the default action, e.g., ctx.bypass() won't have effect.

Specified by:
preRestoreSnapshot in interface MasterObserver
Overrides:
preRestoreSnapshot in class BaseMasterAndRegionObserver
Parameters:
ctx - the environment to interact with the framework and master
snapshot - the SnapshotDescriptor for the snapshot
hTableDescriptor - the hTableDescriptor of the table to restore
Throws:
IOException

preDeleteSnapshot

public void preDeleteSnapshot(ObserverContext<MasterCoprocessorEnvironment> ctx,
                              HBaseProtos.SnapshotDescription snapshot)
                       throws IOException
Description copied from interface: MasterObserver
Called before a snapshot is deleted. Called as part of deleteSnapshot RPC call. It can't bypass the default action, e.g., ctx.bypass() won't have effect.

Specified by:
preDeleteSnapshot in interface MasterObserver
Overrides:
preDeleteSnapshot in class BaseMasterAndRegionObserver
Parameters:
ctx - the environment to interact with the framework and master
snapshot - the SnapshotDescriptor of the snapshot to delete
Throws:
IOException

preCreateNamespace

public void preCreateNamespace(ObserverContext<MasterCoprocessorEnvironment> ctx,
                               NamespaceDescriptor ns)
                        throws IOException
Description copied from interface: MasterObserver
Called before a new namespace is created by HMaster. It can't bypass the default action, e.g., ctx.bypass() won't have effect.

Specified by:
preCreateNamespace in interface MasterObserver
Overrides:
preCreateNamespace in class BaseMasterAndRegionObserver
Parameters:
ctx - the environment to interact with the framework and master
ns - the NamespaceDescriptor for the table
Throws:
IOException

preDeleteNamespace

public void preDeleteNamespace(ObserverContext<MasterCoprocessorEnvironment> ctx,
                               String namespace)
                        throws IOException
Description copied from interface: MasterObserver
Called before HMaster deletes a namespace It can't bypass the default action, e.g., ctx.bypass() won't have effect.

Specified by:
preDeleteNamespace in interface MasterObserver
Overrides:
preDeleteNamespace in class BaseMasterAndRegionObserver
Parameters:
ctx - the environment to interact with the framework and master
namespace - the name of the namespace
Throws:
IOException

postDeleteNamespace

public void postDeleteNamespace(ObserverContext<MasterCoprocessorEnvironment> ctx,
                                String namespace)
                         throws IOException
Description copied from interface: MasterObserver
Called after the deleteNamespace operation has been requested.

Specified by:
postDeleteNamespace in interface MasterObserver
Overrides:
postDeleteNamespace in class BaseMasterAndRegionObserver
Parameters:
ctx - the environment to interact with the framework and master
namespace - the name of the namespace
Throws:
IOException

preModifyNamespace

public void preModifyNamespace(ObserverContext<MasterCoprocessorEnvironment> ctx,
                               NamespaceDescriptor ns)
                        throws IOException
Description copied from interface: MasterObserver
Called prior to modifying a namespace's properties. It can't bypass the default action, e.g., ctx.bypass() won't have effect.

Specified by:
preModifyNamespace in interface MasterObserver
Overrides:
preModifyNamespace in class BaseMasterAndRegionObserver
Parameters:
ctx - the environment to interact with the framework and master
ns - the NamespaceDescriptor
Throws:
IOException

preOpen

public void preOpen(ObserverContext<RegionCoprocessorEnvironment> e)
             throws IOException
Description copied from interface: RegionObserver
Called before the region is reported as open to the master.

Specified by:
preOpen in interface RegionObserver
Overrides:
preOpen in class BaseRegionObserver
Parameters:
e - the environment provided by the region server
Throws:
IOException - if an error occurred on the coprocessor

postOpen

public void postOpen(ObserverContext<RegionCoprocessorEnvironment> c)
Description copied from interface: RegionObserver
Called after the region is reported as open to the master.

Specified by:
postOpen in interface RegionObserver
Overrides:
postOpen in class BaseRegionObserver
Parameters:
c - the environment provided by the region server

postLogReplay

public void postLogReplay(ObserverContext<RegionCoprocessorEnvironment> c)
Description copied from interface: RegionObserver
Called after the log replay on the region is over.

Specified by:
postLogReplay in interface RegionObserver
Overrides:
postLogReplay in class BaseRegionObserver
Parameters:
c - the environment provided by the region server

preFlush

public void preFlush(ObserverContext<RegionCoprocessorEnvironment> e)
              throws IOException
Description copied from interface: RegionObserver
Called before the memstore is flushed to disk.

Specified by:
preFlush in interface RegionObserver
Overrides:
preFlush in class BaseRegionObserver
Parameters:
e - the environment provided by the region server
Throws:
IOException - if an error occurred on the coprocessor

preSplit

public void preSplit(ObserverContext<RegionCoprocessorEnvironment> e)
              throws IOException
Description copied from interface: RegionObserver
Called before the region is split.

Specified by:
preSplit in interface RegionObserver
Overrides:
preSplit in class BaseRegionObserver
Parameters:
e - the environment provided by the region server (e.getRegion() returns the parent region)
Throws:
IOException - if an error occurred on the coprocessor

preSplit

public void preSplit(ObserverContext<RegionCoprocessorEnvironment> e,
                     byte[] splitRow)
              throws IOException
Description copied from interface: RegionObserver
Called before the region is split.

Specified by:
preSplit in interface RegionObserver
Overrides:
preSplit in class BaseRegionObserver
Parameters:
e - the environment provided by the region server (e.getRegion() returns the parent region)
Throws:
IOException - if an error occurred on the coprocessor

preCompact

public InternalScanner preCompact(ObserverContext<RegionCoprocessorEnvironment> e,
                                  Store store,
                                  InternalScanner scanner,
                                  ScanType scanType)
                           throws IOException
Description copied from interface: RegionObserver
Called prior to writing the StoreFiles selected for compaction into a new StoreFile. To override or modify the compaction process, implementing classes have two options:

Specified by:
preCompact in interface RegionObserver
Overrides:
preCompact in class BaseRegionObserver
Parameters:
e - the environment provided by the region server
store - the store being compacted
scanner - the scanner over existing data used in the store file rewriting
scanType - type of Scan
Returns:
the scanner to use during compaction. Should not be null unless the implementation is writing new store files on its own.
Throws:
IOException - if an error occurred on the coprocessor

preGetClosestRowBefore

public void preGetClosestRowBefore(ObserverContext<RegionCoprocessorEnvironment> c,
                                   byte[] row,
                                   byte[] family,
                                   Result result)
                            throws IOException
Description copied from interface: RegionObserver
Called before a client makes a GetClosestRowBefore request.

Call CoprocessorEnvironment#bypass to skip default actions

Call CoprocessorEnvironment#complete to skip any subsequent chained coprocessors

Specified by:
preGetClosestRowBefore in interface RegionObserver
Overrides:
preGetClosestRowBefore in class BaseRegionObserver
Parameters:
c - the environment provided by the region server
row - the row
family - the family
result - 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 - if an error occurred on the coprocessor

preGetOp

public void preGetOp(ObserverContext<RegionCoprocessorEnvironment> c,
                     Get get,
                     List<Cell> result)
              throws IOException
Description copied from interface: RegionObserver
Called before the client performs a Get

Call CoprocessorEnvironment#bypass to skip default actions

Call CoprocessorEnvironment#complete to skip any subsequent chained coprocessors

Specified by:
preGetOp in interface RegionObserver
Overrides:
preGetOp in class BaseRegionObserver
Parameters:
c - the environment provided by the region server
get - the Get request
result - 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 - if an error occurred on the coprocessor

preExists

public boolean preExists(ObserverContext<RegionCoprocessorEnvironment> c,
                         Get get,
                         boolean exists)
                  throws IOException
Description copied from interface: RegionObserver
Called before the client tests for existence using a Get.

Call CoprocessorEnvironment#bypass to skip default actions

Call CoprocessorEnvironment#complete to skip any subsequent chained coprocessors

Specified by:
preExists in interface RegionObserver
Overrides:
preExists in class BaseRegionObserver
Parameters:
c - the environment provided by the region server
get - the Get request
Returns:
the value to return to the client if bypassing default processing
Throws:
IOException - if an error occurred on the coprocessor

prePut

public void prePut(ObserverContext<RegionCoprocessorEnvironment> c,
                   Put put,
                   WALEdit edit,
                   Durability durability)
            throws IOException
Description copied from interface: RegionObserver
Called before the client stores a value.

Call CoprocessorEnvironment#bypass to skip default actions

Call CoprocessorEnvironment#complete to skip any subsequent chained coprocessors

Specified by:
prePut in interface RegionObserver
Overrides:
prePut in class BaseRegionObserver
Parameters:
c - the environment provided by the region server
put - The Put object
edit - The WALEdit object that will be written to the wal
durability - Persistence guarantee for this Put
Throws:
IOException - if an error occurred on the coprocessor

postPut

public void postPut(ObserverContext<RegionCoprocessorEnvironment> c,
                    Put put,
                    WALEdit edit,
                    Durability durability)
Description copied from interface: RegionObserver
Called after the client stores a value.

Call CoprocessorEnvironment#complete to skip any subsequent chained coprocessors

Specified by:
postPut in interface RegionObserver
Overrides:
postPut in class BaseRegionObserver
Parameters:
c - the environment provided by the region server
put - The Put object
edit - The WALEdit object for the wal
durability - Persistence guarantee for this Put

preDelete

public void preDelete(ObserverContext<RegionCoprocessorEnvironment> c,
                      Delete delete,
                      WALEdit edit,
                      Durability durability)
               throws IOException
Description copied from interface: RegionObserver
Called before the client deletes a value.

Call CoprocessorEnvironment#bypass to skip default actions

Call CoprocessorEnvironment#complete to skip any subsequent chained coprocessors

Specified by:
preDelete in interface RegionObserver
Overrides:
preDelete in class BaseRegionObserver
Parameters:
c - the environment provided by the region server
delete - The Delete object
edit - The WALEdit object for the wal
durability - Persistence guarantee for this Delete
Throws:
IOException - if an error occurred on the coprocessor

preBatchMutate

public void preBatchMutate(ObserverContext<RegionCoprocessorEnvironment> c,
                           MiniBatchOperationInProgress<Mutation> miniBatchOp)
                    throws IOException
Description copied from interface: RegionObserver
This 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. By setting OperationStatus of Mutations (MiniBatchOperationInProgress.setOperationStatus(int, OperationStatus)), RegionObserver can make HRegion to skip these Mutations.

Specified by:
preBatchMutate in interface RegionObserver
Overrides:
preBatchMutate in class BaseRegionObserver
Parameters:
c - the environment provided by the region server
miniBatchOp - batch of Mutations getting applied to region.
Throws:
IOException - if an error occurred on the coprocessor

postDelete

public void postDelete(ObserverContext<RegionCoprocessorEnvironment> c,
                       Delete delete,
                       WALEdit edit,
                       Durability durability)
                throws IOException
Description copied from interface: RegionObserver
Called after the client deletes a value.

Call CoprocessorEnvironment#complete to skip any subsequent chained coprocessors

Specified by:
postDelete in interface RegionObserver
Overrides:
postDelete in class BaseRegionObserver
Parameters:
c - the environment provided by the region server
delete - The Delete object
edit - The WALEdit object for the wal
durability - Persistence guarantee for this Delete
Throws:
IOException - if an error occurred on the coprocessor

preCheckAndPut

public boolean preCheckAndPut(ObserverContext<RegionCoprocessorEnvironment> c,
                              byte[] row,
                              byte[] family,
                              byte[] qualifier,
                              CompareFilter.CompareOp compareOp,
                              ByteArrayComparable comparator,
                              Put put,
                              boolean result)
                       throws IOException
Description copied from interface: RegionObserver
Called before checkAndPut.

Call CoprocessorEnvironment#bypass to skip default actions

Call CoprocessorEnvironment#complete to skip any subsequent chained coprocessors

Specified by:
preCheckAndPut in interface RegionObserver
Overrides:
preCheckAndPut in class BaseRegionObserver
Parameters:
c - the environment provided by the region server
row - row to check
family - column family
qualifier - column qualifier
compareOp - the comparison operation
comparator - the comparator
put - data to put if check succeeds
Returns:
the return value to return to client if bypassing default processing
Throws:
IOException - if an error occurred on the coprocessor

preCheckAndPutAfterRowLock

public boolean preCheckAndPutAfterRowLock(ObserverContext<RegionCoprocessorEnvironment> c,
                                          byte[] row,
                                          byte[] family,
                                          byte[] qualifier,
                                          CompareFilter.CompareOp compareOp,
                                          ByteArrayComparable comparator,
                                          Put put,
                                          boolean result)
                                   throws IOException
Description copied from interface: RegionObserver
Called 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

Call CoprocessorEnvironment#complete to skip any subsequent chained coprocessors

Specified by:
preCheckAndPutAfterRowLock in interface RegionObserver
Overrides:
preCheckAndPutAfterRowLock in class BaseRegionObserver
Parameters:
c - the environment provided by the region server
row - row to check
family - column family
qualifier - column qualifier
compareOp - the comparison operation
comparator - the comparator
put - data to put if check succeeds
Returns:
the return value to return to client if bypassing default processing
Throws:
IOException - if an error occurred on the coprocessor

preCheckAndDelete

public boolean preCheckAndDelete(ObserverContext<RegionCoprocessorEnvironment> c,
                                 byte[] row,
                                 byte[] family,
                                 byte[] qualifier,
                                 CompareFilter.CompareOp compareOp,
                                 ByteArrayComparable comparator,
                                 Delete delete,
                                 boolean result)
                          throws IOException
Description copied from interface: RegionObserver
Called before checkAndDelete.

Call CoprocessorEnvironment#bypass to skip default actions

Call CoprocessorEnvironment#complete to skip any subsequent chained coprocessors

Specified by:
preCheckAndDelete in interface RegionObserver
Overrides:
preCheckAndDelete in class BaseRegionObserver
Parameters:
c - the environment provided by the region server
row - row to check
family - column family
qualifier - column qualifier
compareOp - the comparison operation
comparator - the comparator
delete - delete to commit if check succeeds
Returns:
the value to return to client if bypassing default processing
Throws:
IOException - if an error occurred on the coprocessor

preCheckAndDeleteAfterRowLock

public boolean preCheckAndDeleteAfterRowLock(ObserverContext<RegionCoprocessorEnvironment> c,
                                             byte[] row,
                                             byte[] family,
                                             byte[] qualifier,
                                             CompareFilter.CompareOp compareOp,
                                             ByteArrayComparable comparator,
                                             Delete delete,
                                             boolean result)
                                      throws IOException
Description copied from interface: RegionObserver
Called 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

Call CoprocessorEnvironment#complete to skip any subsequent chained coprocessors

Specified by:
preCheckAndDeleteAfterRowLock in interface RegionObserver
Overrides:
preCheckAndDeleteAfterRowLock in class BaseRegionObserver
Parameters:
c - the environment provided by the region server
row - row to check
family - column family
qualifier - column qualifier
compareOp - the comparison operation
comparator - the comparator
delete - delete to commit if check succeeds
Returns:
the value to return to client if bypassing default processing
Throws:
IOException - if an error occurred on the coprocessor

preIncrementColumnValue

public long preIncrementColumnValue(ObserverContext<RegionCoprocessorEnvironment> c,
                                    byte[] row,
                                    byte[] family,
                                    byte[] qualifier,
                                    long amount,
                                    boolean writeToWAL)
                             throws IOException
Description copied from interface: RegionObserver
Called before incrementColumnValue

Call CoprocessorEnvironment#bypass to skip default actions

Call CoprocessorEnvironment#complete to skip any subsequent chained coprocessors

Specified by:
preIncrementColumnValue in interface RegionObserver
Overrides:
preIncrementColumnValue in class BaseRegionObserver
Parameters:
c - the environment provided by the region server
row - row to check
family - column family
qualifier - column qualifier
amount - long amount to increment
writeToWAL - true if the change should be written to the WAL
Returns:
value to return to the client if bypassing default processing
Throws:
IOException - if an error occurred on the coprocessor

preAppend

public Result preAppend(ObserverContext<RegionCoprocessorEnvironment> c,
                        Append append)
                 throws IOException
Description copied from interface: RegionObserver
Called before Append.

Call CoprocessorEnvironment#bypass to skip default actions

Call CoprocessorEnvironment#complete to skip any subsequent chained coprocessors

Specified by:
preAppend in interface RegionObserver
Overrides:
preAppend in class BaseRegionObserver
Parameters:
c - the environment provided by the region server
append - Append object
Returns:
result to return to the client if bypassing default processing
Throws:
IOException - if an error occurred on the coprocessor

preAppendAfterRowLock

public Result preAppendAfterRowLock(ObserverContext<RegionCoprocessorEnvironment> c,
                                    Append append)
                             throws IOException
Description copied from interface: RegionObserver
Called before Append 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

Call CoprocessorEnvironment#complete to skip any subsequent chained coprocessors

Specified by:
preAppendAfterRowLock in interface RegionObserver
Overrides:
preAppendAfterRowLock in class BaseRegionObserver
Parameters:
c - the environment provided by the region server
append - Append object
Returns:
result to return to the client if bypassing default processing
Throws:
IOException - if an error occurred on the coprocessor

preIncrement

public Result preIncrement(ObserverContext<RegionCoprocessorEnvironment> c,
                           Increment increment)
                    throws IOException
Description copied from interface: RegionObserver
Called before Increment.

Call CoprocessorEnvironment#bypass to skip default actions

Call CoprocessorEnvironment#complete to skip any subsequent chained coprocessors

Specified by:
preIncrement in interface RegionObserver
Overrides:
preIncrement in class BaseRegionObserver
Parameters:
c - the environment provided by the region server
increment - increment object
Returns:
result to return to the client if bypassing default processing
Throws:
IOException - if an error occurred on the coprocessor

preIncrementAfterRowLock

public Result preIncrementAfterRowLock(ObserverContext<RegionCoprocessorEnvironment> c,
                                       Increment increment)
                                throws IOException
Description copied from interface: RegionObserver
Called before Increment 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

Call CoprocessorEnvironment#complete to skip any subsequent chained coprocessors

Specified by:
preIncrementAfterRowLock in interface RegionObserver
Overrides:
preIncrementAfterRowLock in class BaseRegionObserver
Parameters:
c - the environment provided by the region server
increment - increment object
Returns:
result to return to the client if bypassing default processing
Throws:
IOException - if an error occurred on the coprocessor

postMutationBeforeWAL

public Cell postMutationBeforeWAL(ObserverContext<RegionCoprocessorEnvironment> ctx,
                                  RegionObserver.MutationType opType,
                                  Mutation mutation,
                                  Cell oldCell,
                                  Cell newCell)
                           throws IOException
Description copied from interface: RegionObserver
Called after a new cell has been created during an increment operation, but before it is committed to the WAL or memstore. Calling ObserverContext.bypass() has no effect in this hook.

Specified by:
postMutationBeforeWAL in interface RegionObserver
Overrides:
postMutationBeforeWAL in class BaseRegionObserver
Parameters:
ctx - the environment provided by the region server
opType - the operation type
mutation - the current mutation
oldCell - old cell containing previous value
newCell - the new cell containing the computed value
Returns:
the new cell, possibly changed
Throws:
IOException

preScannerOpen

public RegionScanner preScannerOpen(ObserverContext<RegionCoprocessorEnvironment> c,
                                    Scan scan,
                                    RegionScanner s)
                             throws IOException
Description copied from interface: RegionObserver
Called before the client opens a new scanner.

Call CoprocessorEnvironment#bypass to skip default actions

Call CoprocessorEnvironment#complete to skip any subsequent chained coprocessors

Specified by:
preScannerOpen in interface RegionObserver
Overrides:
preScannerOpen in class BaseRegionObserver
Parameters:
c - the environment provided by the region server
scan - the Scan specification
s - if not null, the base scanner
Returns:
an RegionScanner instance to use instead of the base scanner if overriding default behavior, null otherwise
Throws:
IOException - if an error occurred on the coprocessor

postScannerOpen

public RegionScanner postScannerOpen(ObserverContext<RegionCoprocessorEnvironment> c,
                                     Scan scan,
                                     RegionScanner s)
                              throws IOException
Description copied from interface: RegionObserver
Called after the client opens a new scanner.

Call CoprocessorEnvironment#complete to skip any subsequent chained coprocessors

Specified by:
postScannerOpen in interface RegionObserver
Overrides:
postScannerOpen in class BaseRegionObserver
Parameters:
c - the environment provided by the region server
scan - the Scan specification
s - if not null, the base scanner
Returns:
the scanner instance to use
Throws:
IOException - if an error occurred on the coprocessor

preScannerNext

public boolean preScannerNext(ObserverContext<RegionCoprocessorEnvironment> c,
                              InternalScanner s,
                              List<Result> result,
                              int limit,
                              boolean hasNext)
                       throws IOException
Description copied from interface: RegionObserver
Called before the client asks for the next row on a scanner.

Call CoprocessorEnvironment#bypass to skip default actions

Call CoprocessorEnvironment#complete to skip any subsequent chained coprocessors

Specified by:
preScannerNext in interface RegionObserver
Overrides:
preScannerNext in class BaseRegionObserver
Parameters:
c - the environment provided by the region server
s - the scanner
result - 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 return
hasNext - the 'has more' indication
Returns:
'has more' indication that should be sent to client
Throws:
IOException - if an error occurred on the coprocessor

preScannerClose

public void preScannerClose(ObserverContext<RegionCoprocessorEnvironment> c,
                            InternalScanner s)
                     throws IOException
Description copied from interface: RegionObserver
Called before the client closes a scanner.

Call CoprocessorEnvironment#bypass to skip default actions

Call CoprocessorEnvironment#complete to skip any subsequent chained coprocessors

Specified by:
preScannerClose in interface RegionObserver
Overrides:
preScannerClose in class BaseRegionObserver
Parameters:
c - the environment provided by the region server
s - the scanner
Throws:
IOException - if an error occurred on the coprocessor

postScannerClose

public void postScannerClose(ObserverContext<RegionCoprocessorEnvironment> c,
                             InternalScanner s)
                      throws IOException
Description copied from interface: RegionObserver
Called after the client closes a scanner.

Call CoprocessorEnvironment#complete to skip any subsequent chained coprocessors

Specified by:
postScannerClose in interface RegionObserver
Overrides:
postScannerClose in class BaseRegionObserver
Parameters:
c - the environment provided by the region server
s - the scanner
Throws:
IOException - if an error occurred on the coprocessor

preBulkLoadHFile

public void preBulkLoadHFile(ObserverContext<RegionCoprocessorEnvironment> ctx,
                             List<Pair<byte[],String>> familyPaths)
                      throws IOException
Verifies user has CREATE privileges on the Column Families involved in the bulkLoadHFile request. Specific Column Write privileges are presently ignored.

Specified by:
preBulkLoadHFile in interface RegionObserver
Overrides:
preBulkLoadHFile in class BaseRegionObserver
familyPaths - 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,
                               SecureBulkLoadProtos.PrepareBulkLoadRequest request)
                        throws IOException
Authorization check for SecureBulkLoadProtocol.prepareBulkLoad()

Specified by:
prePrepareBulkLoad in interface BulkLoadObserver
Parameters:
ctx - the context
request - the request
Throws:
IOException

preCleanupBulkLoad

public void preCleanupBulkLoad(ObserverContext<RegionCoprocessorEnvironment> ctx,
                               SecureBulkLoadProtos.CleanupBulkLoadRequest request)
                        throws IOException
Authorization security check for SecureBulkLoadProtocol.cleanupBulkLoad()

Specified by:
preCleanupBulkLoad in interface BulkLoadObserver
Parameters:
ctx - the context
request - the request
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: EndpointObserver
Called 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. Calling ObserverContext.bypass() has no effect in this hook.

Specified by:
preEndpointInvocation in interface EndpointObserver
Parameters:
ctx - the environment provided by the region server
service - the endpoint service
methodName - the invoked service method
request - the request message
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: EndpointObserver
Called after an Endpoint service method is invoked. The response message can be altered using the builder.

Specified by:
postEndpointInvocation in interface EndpointObserver
Parameters:
ctx - the environment provided by the region server
service - the endpoint service
methodName - the invoked service method
request - the request message
responseBuilder - the response message builder
Throws:
IOException

grant

public void grant(com.google.protobuf.RpcController controller,
                  AccessControlProtos.GrantRequest request,
                  com.google.protobuf.RpcCallback<AccessControlProtos.GrantResponse> done)
Description copied from interface: AccessControlProtos.AccessControlService.Interface
rpc Grant(.GrantRequest) returns (.GrantResponse);

Specified by:
grant in interface AccessControlProtos.AccessControlService.Interface

revoke

public void revoke(com.google.protobuf.RpcController controller,
                   AccessControlProtos.RevokeRequest request,
                   com.google.protobuf.RpcCallback<AccessControlProtos.RevokeResponse> done)
Description copied from interface: AccessControlProtos.AccessControlService.Interface
rpc Revoke(.RevokeRequest) returns (.RevokeResponse);

Specified by:
revoke in interface AccessControlProtos.AccessControlService.Interface

getUserPermissions

public void getUserPermissions(com.google.protobuf.RpcController controller,
                               AccessControlProtos.GetUserPermissionsRequest request,
                               com.google.protobuf.RpcCallback<AccessControlProtos.GetUserPermissionsResponse> done)
Description copied from interface: AccessControlProtos.AccessControlService.Interface
rpc GetUserPermissions(.GetUserPermissionsRequest) returns (.GetUserPermissionsResponse);

Specified by:
getUserPermissions in interface AccessControlProtos.AccessControlService.Interface

checkPermissions

public void checkPermissions(com.google.protobuf.RpcController controller,
                             AccessControlProtos.CheckPermissionsRequest request,
                             com.google.protobuf.RpcCallback<AccessControlProtos.CheckPermissionsResponse> done)
Description copied from interface: AccessControlProtos.AccessControlService.Interface
rpc CheckPermissions(.CheckPermissionsRequest) returns (.CheckPermissionsResponse);

Specified by:
checkPermissions in interface AccessControlProtos.AccessControlService.Interface

getService

public com.google.protobuf.Service getService()
Specified by:
getService in interface CoprocessorService

preClose

public void preClose(ObserverContext<RegionCoprocessorEnvironment> e,
                     boolean abortRequested)
              throws IOException
Description copied from interface: RegionObserver
Called before the region is reported as closed to the master.

Specified by:
preClose in interface RegionObserver
Overrides:
preClose in class BaseRegionObserver
Parameters:
e - the environment provided by the region server
abortRequested - true if the region server is aborting
Throws:
IOException

preStopRegionServer

public void preStopRegionServer(ObserverContext<RegionServerCoprocessorEnvironment> env)
                         throws IOException
Description copied from interface: RegionServerObserver
Called before stopping region server.

Specified by:
preStopRegionServer in interface RegionServerObserver
Parameters:
env - An instance of RegionServerCoprocessorEnvironment
Throws:
IOException - Signals that an I/O exception has occurred.

preGetTableDescriptors

public void preGetTableDescriptors(ObserverContext<MasterCoprocessorEnvironment> ctx,
                                   List<TableName> tableNamesList,
                                   List<HTableDescriptor> descriptors)
                            throws IOException
Description copied from interface: MasterObserver
Called before a getTableDescriptors request has been processed.

Specified by:
preGetTableDescriptors in interface MasterObserver
Overrides:
preGetTableDescriptors in class BaseMasterAndRegionObserver
Parameters:
ctx - the environment to interact with the framework and master
tableNamesList - the list of table names, or null if querying for all
descriptors - an empty list, can be filled with what to return if bypassing
Throws:
IOException

preMerge

public void preMerge(ObserverContext<RegionServerCoprocessorEnvironment> ctx,
                     HRegion regionA,
                     HRegion regionB)
              throws IOException
Description copied from interface: RegionServerObserver
Called before the regions merge. Call ObserverContext.bypass() to skip the merge.

Specified by:
preMerge in interface RegionServerObserver
Throws:
IOException - if an error occurred on the coprocessor

postMerge

public void postMerge(ObserverContext<RegionServerCoprocessorEnvironment> c,
                      HRegion regionA,
                      HRegion regionB,
                      HRegion mergedRegion)
               throws IOException
Description copied from interface: RegionServerObserver
called after the regions merge.

Specified by:
postMerge in interface RegionServerObserver
Throws:
IOException

preMergeCommit

public void preMergeCommit(ObserverContext<RegionServerCoprocessorEnvironment> ctx,
                           HRegion regionA,
                           HRegion regionB,
                           List<Mutation> metaEntries)
                    throws IOException
Description copied from interface: RegionServerObserver
This will be called before PONR step as part of regions merge transaction. Calling ObserverContext.bypass() rollback the merge

Specified by:
preMergeCommit in interface RegionServerObserver
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.
Throws:
IOException

postMergeCommit

public void postMergeCommit(ObserverContext<RegionServerCoprocessorEnvironment> ctx,
                            HRegion regionA,
                            HRegion regionB,
                            HRegion mergedRegion)
                     throws IOException
Description copied from interface: RegionServerObserver
This will be called after PONR step as part of regions merge transaction.

Specified by:
postMergeCommit in interface RegionServerObserver
Throws:
IOException

preRollBackMerge

public void preRollBackMerge(ObserverContext<RegionServerCoprocessorEnvironment> ctx,
                             HRegion regionA,
                             HRegion regionB)
                      throws IOException
Description copied from interface: RegionServerObserver
This will be called before the roll back of the regions merge.

Specified by:
preRollBackMerge in interface RegionServerObserver
Throws:
IOException

postRollBackMerge

public void postRollBackMerge(ObserverContext<RegionServerCoprocessorEnvironment> ctx,
                              HRegion regionA,
                              HRegion regionB)
                       throws IOException
Description copied from interface: RegionServerObserver
This will be called after the roll back of the regions merge.

Specified by:
postRollBackMerge in interface RegionServerObserver
Throws:
IOException

preRollWALWriterRequest

public void preRollWALWriterRequest(ObserverContext<RegionServerCoprocessorEnvironment> ctx)
                             throws IOException
Description copied from interface: RegionServerObserver
This will be called before executing user request to roll a region server WAL.

Specified by:
preRollWALWriterRequest in interface RegionServerObserver
Parameters:
ctx - An instance of ObserverContext
Throws:
IOException - Signals that an I/O exception has occurred.

postRollWALWriterRequest

public void postRollWALWriterRequest(ObserverContext<RegionServerCoprocessorEnvironment> ctx)
                              throws IOException
Description copied from interface: RegionServerObserver
This will be called after executing user request to roll a region server WAL.

Specified by:
postRollWALWriterRequest in interface RegionServerObserver
Parameters:
ctx - An instance of ObserverContext
Throws:
IOException - Signals that an I/O exception has occurred.

postCreateReplicationEndPoint

public ReplicationEndpoint postCreateReplicationEndPoint(ObserverContext<RegionServerCoprocessorEnvironment> ctx,
                                                         ReplicationEndpoint endpoint)
Description copied from interface: RegionServerObserver
This will be called after the replication endpoint is instantiated.

Specified by:
postCreateReplicationEndPoint in interface RegionServerObserver
endpoint - - the base endpoint for replication
Returns:
the endpoint to use during replication.

preReplicateLogEntries

public void preReplicateLogEntries(ObserverContext<RegionServerCoprocessorEnvironment> ctx,
                                   List<AdminProtos.WALEntry> entries,
                                   CellScanner cells)
                            throws IOException
Description copied from interface: RegionServerObserver
This will be called before executing replication request to shipping log entries.

Specified by:
preReplicateLogEntries in interface RegionServerObserver
Parameters:
ctx - An instance of ObserverContext
entries - list of WALEntries to replicate
cells - Cells that the WALEntries refer to (if cells is non-null)
Throws:
IOException - Signals that an I/O exception has occurred.

postReplicateLogEntries

public void postReplicateLogEntries(ObserverContext<RegionServerCoprocessorEnvironment> ctx,
                                    List<AdminProtos.WALEntry> entries,
                                    CellScanner cells)
                             throws IOException
Description copied from interface: RegionServerObserver
This will be called after executing replication request to shipping log entries.

Specified by:
postReplicateLogEntries in interface RegionServerObserver
Parameters:
ctx - An instance of ObserverContext
entries - list of WALEntries to replicate
cells - Cells that the WALEntries refer to (if cells is non-null)
Throws:
IOException - Signals that an I/O exception has occurred.


Copyright © 2007–2016 The Apache Software Foundation. All rights reserved.