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.security.access.AccessController
All Implemented Interfaces:
Coprocessor, CoprocessorService, MasterObserver, RegionObserver, RegionServerObserver, AccessControlProtos.AccessControlService.Interface

public class AccessController
extends BaseRegionObserver
implements MasterObserver, RegionServerObserver, AccessControlProtos.AccessControlService.Interface, CoprocessorService

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 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
 
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)
           
 com.google.protobuf.Service getService()
           
 void getUserPermissions(com.google.protobuf.RpcController controller, AccessControlProtos.UserPermissionsRequest request, com.google.protobuf.RpcCallback<AccessControlProtos.UserPermissionsResponse> done)
           
 void grant(com.google.protobuf.RpcController controller, AccessControlProtos.GrantRequest request, com.google.protobuf.RpcCallback<AccessControlProtos.GrantResponse> done)
           
 void postAddColumn(ObserverContext<MasterCoprocessorEnvironment> c, byte[] tableName, HColumnDescriptor column)
          Called after the new column family has been created.
 void postAddColumnHandler(ObserverContext<MasterCoprocessorEnvironment> c, byte[] tableName, HColumnDescriptor column)
          Called after the new column family has been created.
 void postAssign(ObserverContext<MasterCoprocessorEnvironment> c, HRegionInfo regionInfo)
          Called after the region assignment has been requested.
 void postBalance(ObserverContext<MasterCoprocessorEnvironment> c, List<RegionPlan> plans)
          Called after the balancing plan has been submitted.
 void postBalanceSwitch(ObserverContext<MasterCoprocessorEnvironment> c, boolean oldValue, boolean newValue)
          Called after the flag to enable/disable balancing has changed.
 void postCloneSnapshot(ObserverContext<MasterCoprocessorEnvironment> ctx, HBaseProtos.SnapshotDescription snapshot, HTableDescriptor hTableDescriptor)
          Called after a snapshot clone operation has been requested.
 void postCreateTable(ObserverContext<MasterCoprocessorEnvironment> c, HTableDescriptor desc, HRegionInfo[] regions)
          Called after the createTable operation has been requested.
 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, boolean writeToWAL)
          Called after the client deletes a value.
 void postDeleteColumn(ObserverContext<MasterCoprocessorEnvironment> c, byte[] tableName, byte[] col)
          Called after the column family has been deleted.
 void postDeleteColumnHandler(ObserverContext<MasterCoprocessorEnvironment> c, byte[] tableName, byte[] col)
          Called after the column family has been deleted.
 void postDeleteSnapshot(ObserverContext<MasterCoprocessorEnvironment> ctx, HBaseProtos.SnapshotDescription snapshot)
          Called after the delete snapshot operation has been requested.
 void postDeleteTable(ObserverContext<MasterCoprocessorEnvironment> c, byte[] tableName)
          Called after the deleteTable operation has been requested.
 void postDeleteTableHandler(ObserverContext<MasterCoprocessorEnvironment> c, byte[] tableName)
          Called after HMaster deletes a table.
 void postDisableTable(ObserverContext<MasterCoprocessorEnvironment> c, byte[] tableName)
          Called after the disableTable operation has been requested.
 void postDisableTableHandler(ObserverContext<MasterCoprocessorEnvironment> c, byte[] tableName)
          Called after the disableTable operation has been requested.
 void postEnableTable(ObserverContext<MasterCoprocessorEnvironment> c, byte[] tableName)
          Called after the enableTable operation has been requested.
 void postEnableTableHandler(ObserverContext<MasterCoprocessorEnvironment> c, byte[] tableName)
          Called after the enableTable operation has been requested.
 void postModifyColumn(ObserverContext<MasterCoprocessorEnvironment> c, byte[] tableName, HColumnDescriptor descriptor)
          Called after the column family has been updated.
 void postModifyColumnHandler(ObserverContext<MasterCoprocessorEnvironment> c, byte[] tableName, HColumnDescriptor descriptor)
          Called after the column family has been updated.
 void postModifyTable(ObserverContext<MasterCoprocessorEnvironment> c, byte[] tableName, HTableDescriptor htd)
          Called after the modifyTable operation has been requested.
 void postModifyTableHandler(ObserverContext<MasterCoprocessorEnvironment> c, byte[] tableName, HTableDescriptor htd)
          Called after to modifying a table's properties.
 void postMove(ObserverContext<MasterCoprocessorEnvironment> c, HRegionInfo region, ServerName srcServer, ServerName destServer)
          Called after the region move has been requested.
 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, boolean writeToWAL)
          Called after the client stores a value.
 void postRegionOffline(ObserverContext<MasterCoprocessorEnvironment> c, HRegionInfo regionInfo)
          Called after the region has been marked offline.
 void postRestoreSnapshot(ObserverContext<MasterCoprocessorEnvironment> ctx, HBaseProtos.SnapshotDescription snapshot, HTableDescriptor hTableDescriptor)
          Called after a snapshot restore operation has been requested.
 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 postSnapshot(ObserverContext<MasterCoprocessorEnvironment> ctx, HBaseProtos.SnapshotDescription snapshot, HTableDescriptor hTableDescriptor)
          Called after the snapshot operation has been requested.
 void postStartMaster(ObserverContext<MasterCoprocessorEnvironment> ctx)
          Called immediately after an active master instance has completed initialization.
 void postUnassign(ObserverContext<MasterCoprocessorEnvironment> c, HRegionInfo regionInfo, boolean force)
          Called after the region unassignment has been requested.
 void preAddColumn(ObserverContext<MasterCoprocessorEnvironment> c, byte[] tableName, HColumnDescriptor column)
          Called prior to adding a new column family to the table.
 void preAddColumnHandler(ObserverContext<MasterCoprocessorEnvironment> c, byte[] tableName, HColumnDescriptor column)
          Called prior to adding a new column family to the table.
 Result preAppend(ObserverContext<RegionCoprocessorEnvironment> c, Append append)
          Called before Append
 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 preBulkLoadHFile(ObserverContext<RegionCoprocessorEnvironment> ctx, List<Pair<byte[],String>> familyPaths)
          Verifies user has WRITE 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 preCheckAndPut(ObserverContext<RegionCoprocessorEnvironment> c, byte[] row, byte[] family, byte[] qualifier, CompareFilter.CompareOp compareOp, ByteArrayComparable comparator, Put put, boolean result)
          Called before checkAndPut
 void preCleanupBulkLoad(RegionCoprocessorEnvironment e)
          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 preCompactSelection(ObserverContext<RegionCoprocessorEnvironment> e, Store store, List<StoreFile> candidates)
          Called prior to selecting the StoreFiles to compact from the list of available candidates.
 void preCreateTable(ObserverContext<MasterCoprocessorEnvironment> c, HTableDescriptor desc, HRegionInfo[] regions)
          Called before a new table is created by HMaster.
 void preCreateTableHandler(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, boolean writeToWAL)
          Called before the client deletes a value.
 void preDeleteColumn(ObserverContext<MasterCoprocessorEnvironment> c, byte[] tableName, byte[] col)
          Called prior to deleting the entire column family.
 void preDeleteColumnHandler(ObserverContext<MasterCoprocessorEnvironment> c, byte[] tableName, byte[] col)
          Called prior to deleting the entire column family.
 void preDeleteSnapshot(ObserverContext<MasterCoprocessorEnvironment> ctx, HBaseProtos.SnapshotDescription snapshot)
          Called before a snapshot is deleted.
 void preDeleteTable(ObserverContext<MasterCoprocessorEnvironment> c, byte[] tableName)
          Called before HMaster deletes a table.
 void preDeleteTableHandler(ObserverContext<MasterCoprocessorEnvironment> c, byte[] tableName)
          Called before HMaster deletes a table.
 void preDisableTable(ObserverContext<MasterCoprocessorEnvironment> c, byte[] tableName)
          Called prior to disabling a table.
 void preDisableTableHandler(ObserverContext<MasterCoprocessorEnvironment> c, byte[] tableName)
          Called prior to disabling a table.
 void preEnableTable(ObserverContext<MasterCoprocessorEnvironment> c, byte[] tableName)
          Called prior to enabling a table.
 void preEnableTableHandler(ObserverContext<MasterCoprocessorEnvironment> c, byte[] tableName)
          Called prior to enabling a table.
 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 preGet(ObserverContext<RegionCoprocessorEnvironment> c, Get get, List<KeyValue> result)
          Called before the client performs a Get
 void preGetClosestRowBefore(ObserverContext<RegionCoprocessorEnvironment> c, byte[] row, byte[] family, Result result)
          Called before a client makes a GetClosestRowBefore request.
 Result preIncrement(ObserverContext<RegionCoprocessorEnvironment> c, Increment increment)
          Called before Increment
 long preIncrementColumnValue(ObserverContext<RegionCoprocessorEnvironment> c, byte[] row, byte[] family, byte[] qualifier, long amount, boolean writeToWAL)
          Called before incrementColumnValue
 void preModifyColumn(ObserverContext<MasterCoprocessorEnvironment> c, byte[] tableName, HColumnDescriptor descriptor)
          Called prior to modifying a column family's attributes.
 void preModifyColumnHandler(ObserverContext<MasterCoprocessorEnvironment> c, byte[] tableName, HColumnDescriptor descriptor)
          Called prior to modifying a column family's attributes.
 void preModifyTable(ObserverContext<MasterCoprocessorEnvironment> c, byte[] tableName, HTableDescriptor htd)
          Called prior to modifying a table's properties.
 void preModifyTableHandler(ObserverContext<MasterCoprocessorEnvironment> c, byte[] 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(RegionCoprocessorEnvironment e)
          Authorization check for SecureBulkLoadProtocol.prepareBulkLoad()
 void prePut(ObserverContext<RegionCoprocessorEnvironment> c, Put put, WALEdit edit, boolean writeToWAL)
          Called before the client stores a value.
 void preRegionOffline(ObserverContext<MasterCoprocessorEnvironment> c, HRegionInfo regionInfo)
          Called prior to marking a given region as offline.
 void preRestoreSnapshot(ObserverContext<MasterCoprocessorEnvironment> ctx, HBaseProtos.SnapshotDescription snapshot, HTableDescriptor hTableDescriptor)
          Called before a snapshot is restored.
 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 preUnassign(ObserverContext<MasterCoprocessorEnvironment> c, HRegionInfo regionInfo, boolean force)
          Called prior to unassigning a given region.
 void revoke(com.google.protobuf.RpcController controller, AccessControlProtos.RevokeRequest request, com.google.protobuf.RpcCallback<AccessControlProtos.RevokeResponse> done)
           
 void start(CoprocessorEnvironment env)
           
 void stop(CoprocessorEnvironment env)
           
 
Methods inherited from class org.apache.hadoop.hbase.coprocessor.BaseRegionObserver
postAppend, postBatchMutate, postBulkLoadHFile, postCheckAndDelete, postCheckAndPut, postClose, postCompact, postCompact, postCompactSelection, postCompactSelection, postCompleteSplit, postExists, postFlush, postFlush, postGet, postGetClosestRowBefore, postIncrement, postIncrementColumnValue, postRollBackSplit, postScannerFilterRow, postScannerNext, postSplit, postWALRestore, preBatchMutate, preCompact, preCompactScannerOpen, preCompactScannerOpen, preCompactSelection, preFlush, preFlushScannerOpen, preRollBackSplit, 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

start

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

stop

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

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
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

preCreateTableHandler

public void preCreateTableHandler(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 handler and it is async to the create RPC call. It can't bypass the default action, e.g., ctx.bypass() won't have effect.

Specified by:
preCreateTableHandler in interface MasterObserver
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

postCreateTable

public void postCreateTable(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.

Specified by:
postCreateTable in interface MasterObserver
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
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,
                           byte[] 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
Parameters:
c - the environment to interact with the framework and master
tableName - the name of the table
Throws:
IOException

preDeleteTableHandler

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

Specified by:
preDeleteTableHandler in interface MasterObserver
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,
                            byte[] 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
Parameters:
c - the environment to interact with the framework and master
tableName - the name of the table
Throws:
IOException

postDeleteTableHandler

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

Specified by:
postDeleteTableHandler in interface MasterObserver
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,
                           byte[] 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
Parameters:
c - the environment to interact with the framework and master
tableName - the name of the table
htd - the HTableDescriptor
Throws:
IOException

preModifyTableHandler

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

Specified by:
preModifyTableHandler in interface MasterObserver
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,
                            byte[] 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
Parameters:
c - the environment to interact with the framework and master
tableName - the name of the table
htd - the HTableDescriptor
Throws:
IOException

postModifyTableHandler

public void postModifyTableHandler(ObserverContext<MasterCoprocessorEnvironment> c,
                                   byte[] tableName,
                                   HTableDescriptor htd)
                            throws IOException
Description copied from interface: MasterObserver
Called after to modifying a table's properties. Called as part of modify table handler and it is async to the modify table RPC call. It can't bypass the default action, e.g., ctx.bypass() won't have effect.

Specified by:
postModifyTableHandler in interface MasterObserver
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,
                         byte[] 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
Parameters:
c - the environment to interact with the framework and master
tableName - the name of the table
column - the HColumnDescriptor
Throws:
IOException

preAddColumnHandler

public void preAddColumnHandler(ObserverContext<MasterCoprocessorEnvironment> c,
                                byte[] 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 handler.

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

postAddColumn

public void postAddColumn(ObserverContext<MasterCoprocessorEnvironment> c,
                          byte[] tableName,
                          HColumnDescriptor column)
                   throws IOException
Description copied from interface: MasterObserver
Called after the new column family has been created. Called as part of add column RPC call.

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

postAddColumnHandler

public void postAddColumnHandler(ObserverContext<MasterCoprocessorEnvironment> c,
                                 byte[] tableName,
                                 HColumnDescriptor column)
                          throws IOException
Description copied from interface: MasterObserver
Called after the new column family has been created. Called as part of add column handler.

Specified by:
postAddColumnHandler in interface MasterObserver
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,
                            byte[] 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
Parameters:
c - the environment to interact with the framework and master
tableName - the name of the table
descriptor - the HColumnDescriptor
Throws:
IOException

preModifyColumnHandler

public void preModifyColumnHandler(ObserverContext<MasterCoprocessorEnvironment> c,
                                   byte[] 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 handler.

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

postModifyColumn

public void postModifyColumn(ObserverContext<MasterCoprocessorEnvironment> c,
                             byte[] tableName,
                             HColumnDescriptor descriptor)
                      throws IOException
Description copied from interface: MasterObserver
Called after the column family has been updated. Called as part of modify column RPC call.

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

postModifyColumnHandler

public void postModifyColumnHandler(ObserverContext<MasterCoprocessorEnvironment> c,
                                    byte[] tableName,
                                    HColumnDescriptor descriptor)
                             throws IOException
Description copied from interface: MasterObserver
Called after the column family has been updated. Called as part of modify column handler.

Specified by:
postModifyColumnHandler in interface MasterObserver
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,
                            byte[] 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
Parameters:
c - the environment to interact with the framework and master
tableName - the name of the table
col - the column
Throws:
IOException

preDeleteColumnHandler

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

Specified by:
preDeleteColumnHandler in interface MasterObserver
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,
                             byte[] 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
Parameters:
c - the environment to interact with the framework and master
tableName - the name of the table
col - the column
Throws:
IOException

postDeleteColumnHandler

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

Specified by:
postDeleteColumnHandler in interface MasterObserver
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,
                           byte[] 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
Parameters:
c - the environment to interact with the framework and master
tableName - the name of the table
Throws:
IOException

preEnableTableHandler

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

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

postEnableTable

public void postEnableTable(ObserverContext<MasterCoprocessorEnvironment> c,
                            byte[] tableName)
                     throws IOException
Description copied from interface: MasterObserver
Called after the enableTable operation has been requested. Called as part of enable table RPC call.

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

postEnableTableHandler

public void postEnableTableHandler(ObserverContext<MasterCoprocessorEnvironment> c,
                                   byte[] tableName)
                            throws IOException
Description copied from interface: MasterObserver
Called after the enableTable operation has been requested. Called as part of enable table handler and it is async to the enable table RPC call.

Specified by:
postEnableTableHandler in interface MasterObserver
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,
                            byte[] 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
Parameters:
c - the environment to interact with the framework and master
tableName - the name of the table
Throws:
IOException

preDisableTableHandler

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

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

postDisableTable

public void postDisableTable(ObserverContext<MasterCoprocessorEnvironment> c,
                             byte[] tableName)
                      throws IOException
Description copied from interface: MasterObserver
Called after the disableTable operation has been requested. Called as part of disable table RPC call.

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

postDisableTableHandler

public void postDisableTableHandler(ObserverContext<MasterCoprocessorEnvironment> c,
                                    byte[] tableName)
                             throws IOException
Description copied from interface: MasterObserver
Called after the disableTable operation has been requested. Called as part of disable table handler and it is asyn to the disable table RPC call.

Specified by:
postDisableTableHandler in interface MasterObserver
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
Parameters:
c - the environment to interact with the framework and master
region - the HRegionInfo
srcServer - the source ServerName
destServer - the destination ServerName
Throws:
IOException

postMove

public void postMove(ObserverContext<MasterCoprocessorEnvironment> c,
                     HRegionInfo region,
                     ServerName srcServer,
                     ServerName destServer)
              throws IOException
Description copied from interface: MasterObserver
Called after the region move has been requested.

Specified by:
postMove in interface MasterObserver
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
Parameters:
c - the environment to interact with the framework and master
regionInfo - the regionInfo of the region
Throws:
IOException

postAssign

public void postAssign(ObserverContext<MasterCoprocessorEnvironment> c,
                       HRegionInfo regionInfo)
                throws IOException
Description copied from interface: MasterObserver
Called after the region assignment has been requested.

Specified by:
postAssign in interface MasterObserver
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
Parameters:
c - the environment to interact with the framework and master
force - whether to force unassignment or not
Throws:
IOException

postUnassign

public void postUnassign(ObserverContext<MasterCoprocessorEnvironment> c,
                         HRegionInfo regionInfo,
                         boolean force)
                  throws IOException
Description copied from interface: MasterObserver
Called after the region unassignment has been requested.

Specified by:
postUnassign in interface MasterObserver
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
Parameters:
c - the environment to interact with the framework and master
Throws:
IOException

postRegionOffline

public void postRegionOffline(ObserverContext<MasterCoprocessorEnvironment> c,
                              HRegionInfo regionInfo)
                       throws IOException
Description copied from interface: MasterObserver
Called after the region has been marked offline.

Specified by:
postRegionOffline in interface MasterObserver
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
Parameters:
c - the environment to interact with the framework and master
Throws:
IOException

postBalance

public void postBalance(ObserverContext<MasterCoprocessorEnvironment> c,
                        List<RegionPlan> plans)
                 throws IOException
Description copied from interface: MasterObserver
Called after the balancing plan has been submitted.

Specified by:
postBalance in interface MasterObserver
Parameters:
c - the environment to interact with the framework and master
plans - the RegionPlans which master has executed. RegionPlan serves as hint as for the final destination for the underlying region but may not represent the final state of assignment
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
Parameters:
c - the coprocessor instance's environment
newValue - the new flag value submitted in the call
Throws:
IOException

postBalanceSwitch

public void postBalanceSwitch(ObserverContext<MasterCoprocessorEnvironment> c,
                              boolean oldValue,
                              boolean newValue)
                       throws IOException
Description copied from interface: MasterObserver
Called after the flag to enable/disable balancing has changed.

Specified by:
postBalanceSwitch in interface MasterObserver
Parameters:
c - the coprocessor instance's environment
oldValue - the previously set balanceSwitch value
newValue - the newly set balanceSwitch value
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
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
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
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
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

postSnapshot

public void postSnapshot(ObserverContext<MasterCoprocessorEnvironment> ctx,
                         HBaseProtos.SnapshotDescription snapshot,
                         HTableDescriptor hTableDescriptor)
                  throws IOException
Description copied from interface: MasterObserver
Called after the snapshot operation has been requested. Called as part of snapshot RPC call.

Specified by:
postSnapshot in interface MasterObserver
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
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

postCloneSnapshot

public void postCloneSnapshot(ObserverContext<MasterCoprocessorEnvironment> ctx,
                              HBaseProtos.SnapshotDescription snapshot,
                              HTableDescriptor hTableDescriptor)
                       throws IOException
Description copied from interface: MasterObserver
Called after a snapshot clone operation has been requested. Called as part of restoreSnapshot RPC call.

Specified by:
postCloneSnapshot in interface MasterObserver
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
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

postRestoreSnapshot

public void postRestoreSnapshot(ObserverContext<MasterCoprocessorEnvironment> ctx,
                                HBaseProtos.SnapshotDescription snapshot,
                                HTableDescriptor hTableDescriptor)
                         throws IOException
Description copied from interface: MasterObserver
Called after a snapshot restore operation has been requested. Called as part of restoreSnapshot RPC call.

Specified by:
postRestoreSnapshot in interface MasterObserver
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
Parameters:
ctx - the environment to interact with the framework and master
snapshot - the SnapshotDescriptor of the snapshot to delete
Throws:
IOException

postDeleteSnapshot

public void postDeleteSnapshot(ObserverContext<MasterCoprocessorEnvironment> ctx,
                               HBaseProtos.SnapshotDescription snapshot)
                        throws IOException
Description copied from interface: MasterObserver
Called after the delete snapshot operation has been requested. Called as part of deleteSnapshot RPC call.

Specified by:
postDeleteSnapshot in interface MasterObserver
Parameters:
ctx - the environment to interact with the framework and master
snapshot - the SnapshotDescriptor of the snapshot to delete
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

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

preCompactSelection

public void preCompactSelection(ObserverContext<RegionCoprocessorEnvironment> e,
                                Store store,
                                List<StoreFile> candidates)
                         throws IOException
Description copied from interface: RegionObserver
Called prior to selecting the StoreFiles to compact from the list of available candidates. To alter the files used for compaction, you may mutate the passed in list of candidates.

Specified by:
preCompactSelection in interface RegionObserver
Overrides:
preCompactSelection in class BaseRegionObserver
Parameters:
e - the environment provided by the region server
store - the store where compaction is being requested
candidates - the store files currently available for compaction
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

preGet

public void preGet(ObserverContext<RegionCoprocessorEnvironment> c,
                   Get get,
                   List<KeyValue> 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:
preGet in interface RegionObserver
Overrides:
preGet 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,
                   boolean writeToWAL)
            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
writeToWAL - true if the change should be written to the WAL
Throws:
IOException - if an error occurred on the coprocessor

postPut

public void postPut(ObserverContext<RegionCoprocessorEnvironment> c,
                    Put put,
                    WALEdit edit,
                    boolean writeToWAL)
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
writeToWAL - true if the change should be written to the WAL

preDelete

public void preDelete(ObserverContext<RegionCoprocessorEnvironment> c,
                      Delete delete,
                      WALEdit edit,
                      boolean writeToWAL)
               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
writeToWAL - true if the change should be written to the WAL
Throws:
IOException - if an error occurred on the coprocessor

postDelete

public void postDelete(ObserverContext<RegionCoprocessorEnvironment> c,
                       Delete delete,
                       WALEdit edit,
                       boolean writeToWAL)
                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
writeToWAL - true if the change should be written to the WAL
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

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

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

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

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 WRITE 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(RegionCoprocessorEnvironment e)
                        throws IOException
Authorization check for SecureBulkLoadProtocol.prepareBulkLoad()

Parameters:
e -
Throws:
IOException

preCleanupBulkLoad

public void preCleanupBulkLoad(RegionCoprocessorEnvironment e)
                        throws IOException
Authorization security check for SecureBulkLoadProtocol.cleanupBulkLoad()

Parameters:
e -
Throws:
IOException

grant

public void grant(com.google.protobuf.RpcController controller,
                  AccessControlProtos.GrantRequest request,
                  com.google.protobuf.RpcCallback<AccessControlProtos.GrantResponse> done)
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)
Specified by:
revoke in interface AccessControlProtos.AccessControlService.Interface

getUserPermissions

public void getUserPermissions(com.google.protobuf.RpcController controller,
                               AccessControlProtos.UserPermissionsRequest request,
                               com.google.protobuf.RpcCallback<AccessControlProtos.UserPermissionsResponse> done)
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)
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.


Copyright © 2013 The Apache Software Foundation. All Rights Reserved.