org.apache.hadoop.hbase.coprocessor
Class BaseRegionObserver

java.lang.Object
  extended by org.apache.hadoop.hbase.coprocessor.BaseRegionObserver
All Implemented Interfaces:
Coprocessor, RegionObserver
Direct Known Subclasses:
BaseMasterAndRegionObserver, ConstraintProcessor, WriteSinkCoprocessor, ZooKeeperScanPolicyObserver

@InterfaceAudience.LimitedPrivate(value="Coprocesssor")
@InterfaceStability.Evolving
public abstract class BaseRegionObserver
extends Object
implements RegionObserver

An abstract class that implements RegionObserver. By extending it, you can create your own region observer without overriding all abstract methods of RegionObserver.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.hadoop.hbase.coprocessor.RegionObserver
RegionObserver.MutationType
 
Nested classes/interfaces inherited from interface org.apache.hadoop.hbase.Coprocessor
Coprocessor.State
 
Field Summary
 
Fields inherited from interface org.apache.hadoop.hbase.Coprocessor
PRIORITY_HIGHEST, PRIORITY_LOWEST, PRIORITY_SYSTEM, PRIORITY_USER, VERSION
 
Constructor Summary
BaseRegionObserver()
           
 
Method Summary
 Result postAppend(ObserverContext<RegionCoprocessorEnvironment> e, Append append, Result result)
          Called after Append
 void postBatchMutate(ObserverContext<RegionCoprocessorEnvironment> c, MiniBatchOperationInProgress<Mutation> miniBatchOp)
          This will be called after applying a batch of Mutations on a region.
 void postBatchMutateIndispensably(ObserverContext<RegionCoprocessorEnvironment> ctx, MiniBatchOperationInProgress<Mutation> miniBatchOp, boolean success)
          Called after the completion of batch put/delete and will be called even if the batch operation fails
 boolean postBulkLoadHFile(ObserverContext<RegionCoprocessorEnvironment> ctx, List<Pair<byte[],String>> familyPaths, boolean hasLoaded)
          Called after bulkLoadHFile.
 boolean postCheckAndDelete(ObserverContext<RegionCoprocessorEnvironment> e, byte[] row, byte[] family, byte[] qualifier, CompareFilter.CompareOp compareOp, ByteArrayComparable comparator, Delete delete, boolean result)
          Called after checkAndDelete
 boolean postCheckAndPut(ObserverContext<RegionCoprocessorEnvironment> e, byte[] row, byte[] family, byte[] qualifier, CompareFilter.CompareOp compareOp, ByteArrayComparable comparator, Put put, boolean result)
          Called after checkAndPut
 void postClose(ObserverContext<RegionCoprocessorEnvironment> e, boolean abortRequested)
          Called after the region is reported as closed to the master.
 void postCloseRegionOperation(ObserverContext<RegionCoprocessorEnvironment> ctx, HRegion.Operation op)
          Called after releasing read lock in HRegion.closeRegionOperation(Operation).
 void postCompact(ObserverContext<RegionCoprocessorEnvironment> e, Store store, StoreFile resultFile)
          Called after compaction has completed and the new store file has been moved in to place.
 void postCompact(ObserverContext<RegionCoprocessorEnvironment> e, Store store, StoreFile resultFile, CompactionRequest request)
          Called after compaction has completed and the new store file has been moved in to place.
 void postCompactSelection(ObserverContext<RegionCoprocessorEnvironment> c, Store store, com.google.common.collect.ImmutableList<StoreFile> selected)
          Called after the StoreFiles to compact have been selected from the available candidates.
 void postCompactSelection(ObserverContext<RegionCoprocessorEnvironment> c, Store store, com.google.common.collect.ImmutableList<StoreFile> selected, CompactionRequest request)
          Called after the StoreFiles to compact have been selected from the available candidates.
 void postCompleteSplit(ObserverContext<RegionCoprocessorEnvironment> ctx)
          Called after any split request is processed.
 void postDelete(ObserverContext<RegionCoprocessorEnvironment> e, Delete delete, WALEdit edit, Durability durability)
          Called after the client deletes a value.
 boolean postExists(ObserverContext<RegionCoprocessorEnvironment> e, Get get, boolean exists)
          Called after the client tests for existence using a Get.
 void postFlush(ObserverContext<RegionCoprocessorEnvironment> e)
          Called after the memstore is flushed to disk.
 void postFlush(ObserverContext<RegionCoprocessorEnvironment> e, Store store, StoreFile resultFile)
          Called after a Store's memstore is flushed to disk.
 void postGet(ObserverContext<RegionCoprocessorEnvironment> c, Get get, List<KeyValue> result)
          Deprecated. 
 void postGetClosestRowBefore(ObserverContext<RegionCoprocessorEnvironment> e, byte[] row, byte[] family, Result result)
          Called after a client makes a GetClosestRowBefore request.
 void postGetOp(ObserverContext<RegionCoprocessorEnvironment> e, Get get, List<Cell> results)
          Called after the client performs a Get
 Result postIncrement(ObserverContext<RegionCoprocessorEnvironment> e, Increment increment, Result result)
          Called after increment
 long postIncrementColumnValue(ObserverContext<RegionCoprocessorEnvironment> e, byte[] row, byte[] family, byte[] qualifier, long amount, boolean writeToWAL, long result)
          Called after incrementColumnValue
 DeleteTracker postInstantiateDeleteTracker(ObserverContext<RegionCoprocessorEnvironment> ctx, DeleteTracker delTracker)
          Called after the ScanQueryMatcher creates ScanDeleteTracker.
 void postLogReplay(ObserverContext<RegionCoprocessorEnvironment> e)
          Called after the log replay on the region is over.
 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> e)
          Called after the region is reported as open to the master.
 void postPut(ObserverContext<RegionCoprocessorEnvironment> e, Put put, WALEdit edit, Durability durability)
          Called after the client stores a value.
 void postRollBackSplit(ObserverContext<RegionCoprocessorEnvironment> ctx)
          This will be called after the roll back of the split region is completed
 void postScannerClose(ObserverContext<RegionCoprocessorEnvironment> e, InternalScanner s)
          Called after the client closes a scanner.
 boolean postScannerFilterRow(ObserverContext<RegionCoprocessorEnvironment> e, InternalScanner s, byte[] currentRow, int offset, short length, boolean hasMore)
          This will be called by the scan flow when the current scanned row is being filtered out by the filter.
 boolean postScannerNext(ObserverContext<RegionCoprocessorEnvironment> e, InternalScanner s, List<Result> results, int limit, boolean hasMore)
          Called after the client asks for the next row on a scanner.
 RegionScanner postScannerOpen(ObserverContext<RegionCoprocessorEnvironment> e, Scan scan, RegionScanner s)
          Called after the client opens a new scanner.
 void postSplit(ObserverContext<RegionCoprocessorEnvironment> e, HRegion l, HRegion r)
          Called after the region is split.
 void postStartRegionOperation(ObserverContext<RegionCoprocessorEnvironment> ctx, HRegion.Operation op)
          This will be called for region operations where read lock is acquired in HRegion.startRegionOperation().
 StoreFile.Reader postStoreFileReaderOpen(ObserverContext<RegionCoprocessorEnvironment> ctx, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path p, FSDataInputStreamWrapper in, long size, CacheConfig cacheConf, Reference r, StoreFile.Reader reader)
          Called after the creation of Reader for a store file.
 void postWALRestore(ObserverContext<RegionCoprocessorEnvironment> env, HRegionInfo info, HLogKey logKey, WALEdit logEdit)
          Called after a WALEdit replayed for this region.
 Result preAppend(ObserverContext<RegionCoprocessorEnvironment> e, Append append)
          Called before Append.
 Result preAppendAfterRowLock(ObserverContext<RegionCoprocessorEnvironment> e, Append append)
          Called before Append but after acquiring rowlock.
 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)
          Called before bulkLoadHFile.
 boolean preCheckAndDelete(ObserverContext<RegionCoprocessorEnvironment> e, byte[] row, byte[] family, byte[] qualifier, CompareFilter.CompareOp compareOp, ByteArrayComparable comparator, Delete delete, boolean result)
          Called before checkAndDelete.
 boolean preCheckAndDeleteAfterRowLock(ObserverContext<RegionCoprocessorEnvironment> e, 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> e, byte[] row, byte[] family, byte[] qualifier, CompareFilter.CompareOp compareOp, ByteArrayComparable comparator, Put put, boolean result)
          Called before checkAndPut.
 boolean preCheckAndPutAfterRowLock(ObserverContext<RegionCoprocessorEnvironment> e, byte[] row, byte[] family, byte[] qualifier, CompareFilter.CompareOp compareOp, ByteArrayComparable comparator, Put put, boolean result)
          Called before checkAndPut but after acquiring rowlock.
 void preClose(ObserverContext<RegionCoprocessorEnvironment> c, 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.
 InternalScanner preCompact(ObserverContext<RegionCoprocessorEnvironment> e, Store store, InternalScanner scanner, ScanType scanType, CompactionRequest request)
          Called prior to writing the StoreFiles selected for compaction into a new StoreFile.
 InternalScanner preCompactScannerOpen(ObserverContext<RegionCoprocessorEnvironment> c, Store store, List<? extends KeyValueScanner> scanners, ScanType scanType, long earliestPutTs, InternalScanner s)
          Called prior to writing the StoreFiles selected for compaction into a new StoreFile and prior to creating the scanner used to read the input files.
 InternalScanner preCompactScannerOpen(ObserverContext<RegionCoprocessorEnvironment> c, Store store, List<? extends KeyValueScanner> scanners, ScanType scanType, long earliestPutTs, InternalScanner s, CompactionRequest request)
          Called prior to writing the StoreFiles selected for compaction into a new StoreFile and prior to creating the scanner used to read the input files.
 void preCompactSelection(ObserverContext<RegionCoprocessorEnvironment> c, Store store, List<StoreFile> candidates)
          Called prior to selecting the StoreFiles to compact from the list of available candidates.
 void preCompactSelection(ObserverContext<RegionCoprocessorEnvironment> c, Store store, List<StoreFile> candidates, CompactionRequest request)
          Called prior to selecting the StoreFiles to compact from the list of available candidates.
 void preDelete(ObserverContext<RegionCoprocessorEnvironment> e, Delete delete, WALEdit edit, Durability durability)
          Called before the client deletes a value.
 boolean preExists(ObserverContext<RegionCoprocessorEnvironment> e, 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.
 InternalScanner preFlush(ObserverContext<RegionCoprocessorEnvironment> e, Store store, InternalScanner scanner)
          Called before a Store's memstore is flushed to disk.
 InternalScanner preFlushScannerOpen(ObserverContext<RegionCoprocessorEnvironment> c, Store store, KeyValueScanner memstoreScanner, InternalScanner s)
          Called before a memstore is flushed to disk and prior to creating the scanner to read from the memstore.
 void preGet(ObserverContext<RegionCoprocessorEnvironment> c, Get get, List<KeyValue> result)
          Deprecated. 
 void preGetClosestRowBefore(ObserverContext<RegionCoprocessorEnvironment> e, byte[] row, byte[] family, Result result)
          Called before a client makes a GetClosestRowBefore request.
 void preGetOp(ObserverContext<RegionCoprocessorEnvironment> e, Get get, List<Cell> results)
          Called before the client performs a Get
 Result preIncrement(ObserverContext<RegionCoprocessorEnvironment> e, Increment increment)
          Called before Increment.
 Result preIncrementAfterRowLock(ObserverContext<RegionCoprocessorEnvironment> e, Increment increment)
          Called before Increment but after acquiring rowlock.
 long preIncrementColumnValue(ObserverContext<RegionCoprocessorEnvironment> e, byte[] row, byte[] family, byte[] qualifier, long amount, boolean writeToWAL)
          Called before incrementColumnValue
 void preOpen(ObserverContext<RegionCoprocessorEnvironment> e)
          Called before the region is reported as open to the master.
 void prePrepareTimeStampForDeleteVersion(ObserverContext<RegionCoprocessorEnvironment> e, Mutation delete, Cell cell, byte[] byteNow, Get get)
          Called before the server updates the timestamp for version delete with latest timestamp.
 void prePut(ObserverContext<RegionCoprocessorEnvironment> e, Put put, WALEdit edit, Durability durability)
          Called before the client stores a value.
 void preRollBackSplit(ObserverContext<RegionCoprocessorEnvironment> ctx)
          This will be called before the roll back of the split region is completed
 void preScannerClose(ObserverContext<RegionCoprocessorEnvironment> e, InternalScanner s)
          Called before the client closes a scanner.
 boolean preScannerNext(ObserverContext<RegionCoprocessorEnvironment> e, InternalScanner s, List<Result> results, int limit, boolean hasMore)
          Called before the client asks for the next row on a scanner.
 RegionScanner preScannerOpen(ObserverContext<RegionCoprocessorEnvironment> e, Scan scan, RegionScanner s)
          Called before the client opens a new scanner.
 void preSplit(ObserverContext<RegionCoprocessorEnvironment> e)
          Called before the region is split.
 void preSplit(ObserverContext<RegionCoprocessorEnvironment> c, byte[] splitRow)
          Called before the region is split.
 void preSplitAfterPONR(ObserverContext<RegionCoprocessorEnvironment> ctx)
          This will be called after PONR step as part of split transaction Calling ObserverContext.bypass() has no effect in this hook.
 void preSplitBeforePONR(ObserverContext<RegionCoprocessorEnvironment> ctx, byte[] splitKey, List<Mutation> metaEntries)
          This will be called before PONR step as part of split transaction.
 StoreFile.Reader preStoreFileReaderOpen(ObserverContext<RegionCoprocessorEnvironment> ctx, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path p, FSDataInputStreamWrapper in, long size, CacheConfig cacheConf, Reference r, StoreFile.Reader reader)
          Called before creation of Reader for a store file.
 KeyValueScanner preStoreScannerOpen(ObserverContext<RegionCoprocessorEnvironment> c, Store store, Scan scan, NavigableSet<byte[]> targetCols, KeyValueScanner s)
          Called before a store opens a new scanner.
 void preWALRestore(ObserverContext<RegionCoprocessorEnvironment> env, HRegionInfo info, HLogKey logKey, WALEdit logEdit)
          Called before a WALEdit replayed for this region.
 void start(CoprocessorEnvironment e)
           
 void stop(CoprocessorEnvironment e)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseRegionObserver

public BaseRegionObserver()
Method Detail

start

public void start(CoprocessorEnvironment e)
           throws IOException
Specified by:
start in interface Coprocessor
Throws:
IOException

stop

public void stop(CoprocessorEnvironment e)
          throws IOException
Specified by:
stop in interface Coprocessor
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
Parameters:
e - the environment provided by the region server
Throws:
IOException - if an error occurred on the coprocessor

postOpen

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

Specified by:
postOpen in interface RegionObserver
Parameters:
e - the environment provided by the region server

postLogReplay

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

Specified by:
postLogReplay in interface RegionObserver
Parameters:
e - the environment provided by the region server

preClose

public void preClose(ObserverContext<RegionCoprocessorEnvironment> c,
                     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
Parameters:
c - the environment provided by the region server
abortRequested - true if the region server is aborting
Throws:
IOException

postClose

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

Specified by:
postClose in interface RegionObserver
Parameters:
e - the environment provided by the region server
abortRequested - true if the region server is aborting

preFlushScannerOpen

public InternalScanner preFlushScannerOpen(ObserverContext<RegionCoprocessorEnvironment> c,
                                           Store store,
                                           KeyValueScanner memstoreScanner,
                                           InternalScanner s)
                                    throws IOException
Description copied from interface: RegionObserver
Called before a memstore is flushed to disk and prior to creating the scanner to read from the memstore. To override or modify how a memstore is flushed, implementing classes can return a new scanner to provide the KeyValues to be stored into the new StoreFile or null to perform the default processing. Calling ObserverContext.bypass() has no effect in this hook.

Specified by:
preFlushScannerOpen in interface RegionObserver
Parameters:
c - the environment provided by the region server
store - the store being flushed
memstoreScanner - the scanner for the memstore that is flushed
s - the base scanner, if not null, from previous RegionObserver in the chain
Returns:
the scanner to use during the flush. null if the default implementation is to be used.
Throws:
IOException - if an error occurred on the coprocessor

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
Parameters:
e - the environment provided by the region server
Throws:
IOException - if an error occurred on the coprocessor

postFlush

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

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

preFlush

public InternalScanner preFlush(ObserverContext<RegionCoprocessorEnvironment> e,
                                Store store,
                                InternalScanner scanner)
                         throws IOException
Description copied from interface: RegionObserver
Called before a Store's memstore is flushed to disk.

Specified by:
preFlush in interface RegionObserver
Parameters:
e - the environment provided by the region server
store - the store where compaction is being requested
scanner - the scanner over existing data used in the store file
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

postFlush

public void postFlush(ObserverContext<RegionCoprocessorEnvironment> e,
                      Store store,
                      StoreFile resultFile)
               throws IOException
Description copied from interface: RegionObserver
Called after a Store's memstore is flushed to disk.

Specified by:
postFlush in interface RegionObserver
Parameters:
e - the environment provided by the region server
store - the store being flushed
resultFile - the new store file written out during compaction
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
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> c,
                     byte[] splitRow)
              throws IOException
Description copied from interface: RegionObserver
Called before the region is split.

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

preSplitBeforePONR

public void preSplitBeforePONR(ObserverContext<RegionCoprocessorEnvironment> ctx,
                               byte[] splitKey,
                               List<Mutation> metaEntries)
                        throws IOException
Description copied from interface: RegionObserver
This will be called before PONR step as part of split transaction. Calling ObserverContext.bypass() rollback the split

Specified by:
preSplitBeforePONR in interface RegionObserver
Throws:
IOException

preSplitAfterPONR

public void preSplitAfterPONR(ObserverContext<RegionCoprocessorEnvironment> ctx)
                       throws IOException
Description copied from interface: RegionObserver
This will be called after PONR step as part of split transaction Calling ObserverContext.bypass() has no effect in this hook.

Specified by:
preSplitAfterPONR in interface RegionObserver
Throws:
IOException

preRollBackSplit

public void preRollBackSplit(ObserverContext<RegionCoprocessorEnvironment> ctx)
                      throws IOException
Description copied from interface: RegionObserver
This will be called before the roll back of the split region is completed

Specified by:
preRollBackSplit in interface RegionObserver
Throws:
IOException

postRollBackSplit

public void postRollBackSplit(ObserverContext<RegionCoprocessorEnvironment> ctx)
                       throws IOException
Description copied from interface: RegionObserver
This will be called after the roll back of the split region is completed

Specified by:
postRollBackSplit in interface RegionObserver
Throws:
IOException

postCompleteSplit

public void postCompleteSplit(ObserverContext<RegionCoprocessorEnvironment> ctx)
                       throws IOException
Description copied from interface: RegionObserver
Called after any split request is processed. This will be called irrespective of success or failure of the split.

Specified by:
postCompleteSplit in interface RegionObserver
Throws:
IOException

postSplit

public void postSplit(ObserverContext<RegionCoprocessorEnvironment> e,
                      HRegion l,
                      HRegion r)
               throws IOException
Description copied from interface: RegionObserver
Called after the region is split.

Specified by:
postSplit in interface RegionObserver
Parameters:
e - the environment provided by the region server (e.getRegion() returns the parent region)
l - the left daughter region
r - the right daughter region
Throws:
IOException - if an error occurred on the coprocessor

preCompactSelection

public void preCompactSelection(ObserverContext<RegionCoprocessorEnvironment> c,
                                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
Parameters:
c - 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

preCompactSelection

public void preCompactSelection(ObserverContext<RegionCoprocessorEnvironment> c,
                                Store store,
                                List<StoreFile> candidates,
                                CompactionRequest request)
                         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
Parameters:
c - the environment provided by the region server
store - the store where compaction is being requested
candidates - the store files currently available for compaction
request - custom compaction request
Throws:
IOException - if an error occurred on the coprocessor

postCompactSelection

public void postCompactSelection(ObserverContext<RegionCoprocessorEnvironment> c,
                                 Store store,
                                 com.google.common.collect.ImmutableList<StoreFile> selected)
Description copied from interface: RegionObserver
Called after the StoreFiles to compact have been selected from the available candidates.

Specified by:
postCompactSelection in interface RegionObserver
Parameters:
c - the environment provided by the region server
store - the store being compacted
selected - the store files selected to compact

postCompactSelection

public void postCompactSelection(ObserverContext<RegionCoprocessorEnvironment> c,
                                 Store store,
                                 com.google.common.collect.ImmutableList<StoreFile> selected,
                                 CompactionRequest request)
Description copied from interface: RegionObserver
Called after the StoreFiles to compact have been selected from the available candidates.

Specified by:
postCompactSelection in interface RegionObserver
Parameters:
c - the environment provided by the region server
store - the store being compacted
selected - the store files selected to compact
request - custom compaction request

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

preCompact

public InternalScanner preCompact(ObserverContext<RegionCoprocessorEnvironment> e,
                                  Store store,
                                  InternalScanner scanner,
                                  ScanType scanType,
                                  CompactionRequest request)
                           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
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
request - the requested compaction
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

preCompactScannerOpen

public InternalScanner preCompactScannerOpen(ObserverContext<RegionCoprocessorEnvironment> c,
                                             Store store,
                                             List<? extends KeyValueScanner> scanners,
                                             ScanType scanType,
                                             long earliestPutTs,
                                             InternalScanner s)
                                      throws IOException
Description copied from interface: RegionObserver
Called prior to writing the StoreFiles selected for compaction into a new StoreFile and prior to creating the scanner used to read the input files. To override or modify the compaction process, implementing classes can return a new scanner to provide the KeyValues to be stored into the new StoreFile or null to perform the default processing. Calling ObserverContext.bypass() has no effect in this hook.

Specified by:
preCompactScannerOpen in interface RegionObserver
Parameters:
c - the environment provided by the region server
store - the store being compacted
scanners - the list StoreFileScanners to be read from
scanType - the ScanType indicating whether this is a major or minor compaction
earliestPutTs - timestamp of the earliest put that was found in any of the involved store files
s - the base scanner, if not null, from previous RegionObserver in the chain
Returns:
the scanner to use during compaction. null if the default implementation is to be used.
Throws:
IOException - if an error occurred on the coprocessor

preCompactScannerOpen

public InternalScanner preCompactScannerOpen(ObserverContext<RegionCoprocessorEnvironment> c,
                                             Store store,
                                             List<? extends KeyValueScanner> scanners,
                                             ScanType scanType,
                                             long earliestPutTs,
                                             InternalScanner s,
                                             CompactionRequest request)
                                      throws IOException
Description copied from interface: RegionObserver
Called prior to writing the StoreFiles selected for compaction into a new StoreFile and prior to creating the scanner used to read the input files. To override or modify the compaction process, implementing classes can return a new scanner to provide the KeyValues to be stored into the new StoreFile or null to perform the default processing. Calling ObserverContext.bypass() has no effect in this hook.

Specified by:
preCompactScannerOpen in interface RegionObserver
Parameters:
c - the environment provided by the region server
store - the store being compacted
scanners - the list StoreFileScanners to be read from
scanType - the ScanType indicating whether this is a major or minor compaction
earliestPutTs - timestamp of the earliest put that was found in any of the involved store files
s - the base scanner, if not null, from previous RegionObserver in the chain
request - the requested compaction
Returns:
the scanner to use during compaction. null if the default implementation is to be used.
Throws:
IOException - if an error occurred on the coprocessor

postCompact

public void postCompact(ObserverContext<RegionCoprocessorEnvironment> e,
                        Store store,
                        StoreFile resultFile)
                 throws IOException
Description copied from interface: RegionObserver
Called after compaction has completed and the new store file has been moved in to place.

Specified by:
postCompact in interface RegionObserver
Parameters:
e - the environment provided by the region server
store - the store being compacted
resultFile - the new store file written out during compaction
Throws:
IOException - if an error occurred on the coprocessor

postCompact

public void postCompact(ObserverContext<RegionCoprocessorEnvironment> e,
                        Store store,
                        StoreFile resultFile,
                        CompactionRequest request)
                 throws IOException
Description copied from interface: RegionObserver
Called after compaction has completed and the new store file has been moved in to place.

Specified by:
postCompact in interface RegionObserver
Parameters:
e - the environment provided by the region server
store - the store being compacted
resultFile - the new store file written out during compaction
request - the requested compaction
Throws:
IOException - if an error occurred on the coprocessor

preGetClosestRowBefore

public void preGetClosestRowBefore(ObserverContext<RegionCoprocessorEnvironment> e,
                                   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
Parameters:
e - 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

postGetClosestRowBefore

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

Call CoprocessorEnvironment#complete to skip any subsequent chained coprocessors

Specified by:
postGetClosestRowBefore in interface RegionObserver
Parameters:
e - the environment provided by the region server
row - the row
family - the desired family
result - the result to return to the client, modify as necessary
Throws:
IOException - if an error occurred on the coprocessor

preGetOp

public void preGetOp(ObserverContext<RegionCoprocessorEnvironment> e,
                     Get get,
                     List<Cell> results)
              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
Parameters:
e - the environment provided by the region server
get - the Get request
results - 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

@Deprecated
public void preGet(ObserverContext<RegionCoprocessorEnvironment> c,
                              Get get,
                              List<KeyValue> result)
            throws IOException
Deprecated. 

WARNING: please override preGetOp instead of this method. This is to maintain some compatibility and to ease the transition from 0.94 -> 0.96. It is super inefficient!

Specified by:
preGet in interface RegionObserver
Throws:
IOException

postGetOp

public void postGetOp(ObserverContext<RegionCoprocessorEnvironment> e,
                      Get get,
                      List<Cell> results)
               throws IOException
Description copied from interface: RegionObserver
Called after the client performs a Get

Call CoprocessorEnvironment#complete to skip any subsequent chained coprocessors

Specified by:
postGetOp in interface RegionObserver
Parameters:
e - the environment provided by the region server
get - the Get request
results - the result to return to the client, modify as necessary
Throws:
IOException - if an error occurred on the coprocessor

postGet

@Deprecated
public void postGet(ObserverContext<RegionCoprocessorEnvironment> c,
                               Get get,
                               List<KeyValue> result)
             throws IOException
Deprecated. 

WARNING: please override postGetOp instead of this method. This is to maintain some compatibility and to ease the transition from 0.94 -> 0.96. It is super inefficient!

Specified by:
postGet in interface RegionObserver
Throws:
IOException

preExists

public boolean preExists(ObserverContext<RegionCoprocessorEnvironment> e,
                         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
Parameters:
e - 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

postExists

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

Call CoprocessorEnvironment#complete to skip any subsequent chained coprocessors

Specified by:
postExists in interface RegionObserver
Parameters:
e - the environment provided by the region server
get - the Get request
exists - the result returned by the region server
Returns:
the result to return to the client
Throws:
IOException - if an error occurred on the coprocessor

prePut

public void prePut(ObserverContext<RegionCoprocessorEnvironment> e,
                   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
Parameters:
e - 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> e,
                    Put put,
                    WALEdit edit,
                    Durability durability)
             throws IOException
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
Parameters:
e - the environment provided by the region server
put - The Put object
edit - The WALEdit object for the wal
durability - Persistence guarantee for this Put
Throws:
IOException - if an error occurred on the coprocessor

preDelete

public void preDelete(ObserverContext<RegionCoprocessorEnvironment> e,
                      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
Parameters:
e - 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

prePrepareTimeStampForDeleteVersion

public void prePrepareTimeStampForDeleteVersion(ObserverContext<RegionCoprocessorEnvironment> e,
                                                Mutation delete,
                                                Cell cell,
                                                byte[] byteNow,
                                                Get get)
                                         throws IOException
Description copied from interface: RegionObserver
Called before the server updates the timestamp for version delete with latest timestamp.

Call CoprocessorEnvironment#bypass to skip default actions

Call CoprocessorEnvironment#complete to skip any subsequent chained coprocessors

Specified by:
prePrepareTimeStampForDeleteVersion in interface RegionObserver
Parameters:
e - the environment provided by the region server
delete - - the parent mutation associated with this delete cell
cell - - The deleteColumn with latest version cell
byteNow - - timestamp bytes
get - - the get formed using the current cell's row. Note that the get does not specify the family and qualifier
Throws:
IOException

postDelete

public void postDelete(ObserverContext<RegionCoprocessorEnvironment> e,
                       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
Parameters:
e - 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
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

postBatchMutate

public void postBatchMutate(ObserverContext<RegionCoprocessorEnvironment> c,
                            MiniBatchOperationInProgress<Mutation> miniBatchOp)
                     throws IOException
Description copied from interface: RegionObserver
This will be called after applying a batch of Mutations on a region. The Mutations are added to memstore and WAL.

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

postBatchMutateIndispensably

public void postBatchMutateIndispensably(ObserverContext<RegionCoprocessorEnvironment> ctx,
                                         MiniBatchOperationInProgress<Mutation> miniBatchOp,
                                         boolean success)
                                  throws IOException
Description copied from interface: RegionObserver
Called after the completion of batch put/delete and will be called even if the batch operation fails

Specified by:
postBatchMutateIndispensably in interface RegionObserver
success - true if batch operation is successful otherwise false.
Throws:
IOException

preCheckAndPut

public boolean preCheckAndPut(ObserverContext<RegionCoprocessorEnvironment> e,
                              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
Parameters:
e - 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> e,
                                          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
Parameters:
e - 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

postCheckAndPut

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

Call CoprocessorEnvironment#complete to skip any subsequent chained coprocessors

Specified by:
postCheckAndPut in interface RegionObserver
Parameters:
e - 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
result - from the checkAndPut
Returns:
the possibly transformed return value to return to client
Throws:
IOException - if an error occurred on the coprocessor

preCheckAndDelete

public boolean preCheckAndDelete(ObserverContext<RegionCoprocessorEnvironment> e,
                                 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
Parameters:
e - 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> e,
                                             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
Parameters:
e - 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

postCheckAndDelete

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

Call CoprocessorEnvironment#complete to skip any subsequent chained coprocessors

Specified by:
postCheckAndDelete in interface RegionObserver
Parameters:
e - 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
result - from the CheckAndDelete
Returns:
the possibly transformed returned value to return to client
Throws:
IOException - if an error occurred on the coprocessor

preAppend

public Result preAppend(ObserverContext<RegionCoprocessorEnvironment> e,
                        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
Parameters:
e - 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> e,
                                    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
Parameters:
e - 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

postAppend

public Result postAppend(ObserverContext<RegionCoprocessorEnvironment> e,
                         Append append,
                         Result result)
                  throws IOException
Description copied from interface: RegionObserver
Called after Append

Call CoprocessorEnvironment#complete to skip any subsequent chained coprocessors

Specified by:
postAppend in interface RegionObserver
Parameters:
e - the environment provided by the region server
append - Append object
result - the result returned by increment
Returns:
the result to return to the client
Throws:
IOException - if an error occurred on the coprocessor

preIncrementColumnValue

public long preIncrementColumnValue(ObserverContext<RegionCoprocessorEnvironment> e,
                                    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
Parameters:
e - 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

postIncrementColumnValue

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

Call CoprocessorEnvironment#complete to skip any subsequent chained coprocessors

Specified by:
postIncrementColumnValue in interface RegionObserver
Parameters:
e - 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
result - the result returned by incrementColumnValue
Returns:
the result to return to the client
Throws:
IOException - if an error occurred on the coprocessor

preIncrement

public Result preIncrement(ObserverContext<RegionCoprocessorEnvironment> e,
                           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
Parameters:
e - 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> e,
                                       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
Parameters:
e - 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

postIncrement

public Result postIncrement(ObserverContext<RegionCoprocessorEnvironment> e,
                            Increment increment,
                            Result result)
                     throws IOException
Description copied from interface: RegionObserver
Called after increment

Call CoprocessorEnvironment#complete to skip any subsequent chained coprocessors

Specified by:
postIncrement in interface RegionObserver
Parameters:
e - the environment provided by the region server
increment - increment object
result - the result returned by increment
Returns:
the result to return to the client
Throws:
IOException - if an error occurred on the coprocessor

preScannerOpen

public RegionScanner preScannerOpen(ObserverContext<RegionCoprocessorEnvironment> e,
                                    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
Parameters:
e - 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

preStoreScannerOpen

public KeyValueScanner preStoreScannerOpen(ObserverContext<RegionCoprocessorEnvironment> c,
                                           Store store,
                                           Scan scan,
                                           NavigableSet<byte[]> targetCols,
                                           KeyValueScanner s)
                                    throws IOException
Description copied from interface: RegionObserver
Called before a store opens a new scanner. This hook is called when a "user" scanner is opened.

See RegionObserver.preFlushScannerOpen(ObserverContext, Store, KeyValueScanner, InternalScanner) and RegionObserver.preCompactScannerOpen(ObserverContext, Store, List, ScanType, long, InternalScanner) to override scanners created for flushes or compactions, resp.

Call CoprocessorEnvironment#complete to skip any subsequent chained coprocessors. Calling ObserverContext.bypass() has no effect in this hook.

Specified by:
preStoreScannerOpen in interface RegionObserver
Parameters:
c - the environment provided by the region server
store - the store being scanned
scan - the Scan specification
targetCols - columns to be used in the scanner
s - the base scanner, if not null, from previous RegionObserver in the chain
Returns:
a KeyValueScanner instance to use or null to use the default implementation
Throws:
IOException - if an error occurred on the coprocessor

postScannerOpen

public RegionScanner postScannerOpen(ObserverContext<RegionCoprocessorEnvironment> e,
                                     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
Parameters:
e - 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> e,
                              InternalScanner s,
                              List<Result> results,
                              int limit,
                              boolean hasMore)
                       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
Parameters:
e - the environment provided by the region server
s - the scanner
results - 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
hasMore - the 'has more' indication
Returns:
'has more' indication that should be sent to client
Throws:
IOException - if an error occurred on the coprocessor

postScannerNext

public boolean postScannerNext(ObserverContext<RegionCoprocessorEnvironment> e,
                               InternalScanner s,
                               List<Result> results,
                               int limit,
                               boolean hasMore)
                        throws IOException
Description copied from interface: RegionObserver
Called after the client asks for the next row on a scanner.

Call CoprocessorEnvironment#complete to skip any subsequent chained coprocessors

Specified by:
postScannerNext in interface RegionObserver
Parameters:
e - the environment provided by the region server
s - the scanner
results - the result to return to the client, can be modified
limit - the maximum number of results to return
hasMore - the 'has more' indication
Returns:
'has more' indication that should be sent to client
Throws:
IOException - if an error occurred on the coprocessor

postScannerFilterRow

public boolean postScannerFilterRow(ObserverContext<RegionCoprocessorEnvironment> e,
                                    InternalScanner s,
                                    byte[] currentRow,
                                    int offset,
                                    short length,
                                    boolean hasMore)
                             throws IOException
Description copied from interface: RegionObserver
This will be called by the scan flow when the current scanned row is being filtered out by the filter. The filter may be filtering out the row via any of the below scenarios
  1. boolean filterRowKey(byte [] buffer, int offset, int length) returning true
  2. boolean filterRow() returning true
  3. void filterRow(List kvs) removing all the kvs from the passed List

Specified by:
postScannerFilterRow in interface RegionObserver
Parameters:
e - the environment provided by the region server
s - the scanner
currentRow - The current rowkey which got filtered out
offset - offset to rowkey
length - length of rowkey
hasMore - the 'has more' indication
Returns:
whether more rows are available for the scanner or not
Throws:
IOException

preScannerClose

public void preScannerClose(ObserverContext<RegionCoprocessorEnvironment> e,
                            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
Parameters:
e - 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> e,
                             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
Parameters:
e - the environment provided by the region server
s - the scanner
Throws:
IOException - if an error occurred on the coprocessor

preWALRestore

public void preWALRestore(ObserverContext<RegionCoprocessorEnvironment> env,
                          HRegionInfo info,
                          HLogKey logKey,
                          WALEdit logEdit)
                   throws IOException
Description copied from interface: RegionObserver
Called before a WALEdit replayed for this region.

Specified by:
preWALRestore in interface RegionObserver
Throws:
IOException

postWALRestore

public void postWALRestore(ObserverContext<RegionCoprocessorEnvironment> env,
                           HRegionInfo info,
                           HLogKey logKey,
                           WALEdit logEdit)
                    throws IOException
Description copied from interface: RegionObserver
Called after a WALEdit replayed for this region.

Specified by:
postWALRestore in interface RegionObserver
Throws:
IOException

preBulkLoadHFile

public void preBulkLoadHFile(ObserverContext<RegionCoprocessorEnvironment> ctx,
                             List<Pair<byte[],String>> familyPaths)
                      throws IOException
Description copied from interface: RegionObserver
Called before bulkLoadHFile. Users can create a StoreFile instance to access the contents of a HFile.

Specified by:
preBulkLoadHFile in interface RegionObserver
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

postBulkLoadHFile

public boolean postBulkLoadHFile(ObserverContext<RegionCoprocessorEnvironment> ctx,
                                 List<Pair<byte[],String>> familyPaths,
                                 boolean hasLoaded)
                          throws IOException
Description copied from interface: RegionObserver
Called after bulkLoadHFile.

Specified by:
postBulkLoadHFile in interface RegionObserver
familyPaths - pairs of { CF, HFile path } submitted for bulk load
hasLoaded - whether the bulkLoad was successful
Returns:
the new value of hasLoaded
Throws:
IOException

preStoreFileReaderOpen

public StoreFile.Reader preStoreFileReaderOpen(ObserverContext<RegionCoprocessorEnvironment> ctx,
                                               org.apache.hadoop.fs.FileSystem fs,
                                               org.apache.hadoop.fs.Path p,
                                               FSDataInputStreamWrapper in,
                                               long size,
                                               CacheConfig cacheConf,
                                               Reference r,
                                               StoreFile.Reader reader)
                                        throws IOException
Description copied from interface: RegionObserver
Called before creation of Reader for a store file. Calling ObserverContext.bypass() has no effect in this hook.

Specified by:
preStoreFileReaderOpen in interface RegionObserver
Parameters:
ctx - the environment provided by the region server
fs - fileystem to read from
p - path to the file
in - FSDataInputStreamWrapper
size - Full size of the file
r - original reference file. This will be not null only when reading a split file.
reader - the base reader, if not null, from previous RegionObserver in the chain
Returns:
a Reader instance to use instead of the base reader if overriding default behavior, null otherwise
Throws:
IOException

postStoreFileReaderOpen

public StoreFile.Reader postStoreFileReaderOpen(ObserverContext<RegionCoprocessorEnvironment> ctx,
                                                org.apache.hadoop.fs.FileSystem fs,
                                                org.apache.hadoop.fs.Path p,
                                                FSDataInputStreamWrapper in,
                                                long size,
                                                CacheConfig cacheConf,
                                                Reference r,
                                                StoreFile.Reader reader)
                                         throws IOException
Description copied from interface: RegionObserver
Called after the creation of Reader for a store file.

Specified by:
postStoreFileReaderOpen in interface RegionObserver
Parameters:
ctx - the environment provided by the region server
fs - fileystem to read from
p - path to the file
in - FSDataInputStreamWrapper
size - Full size of the file
r - original reference file. This will be not null only when reading a split file.
reader - the base reader instance
Returns:
The reader to use
Throws:
IOException

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

postStartRegionOperation

public void postStartRegionOperation(ObserverContext<RegionCoprocessorEnvironment> ctx,
                                     HRegion.Operation op)
                              throws IOException
Description copied from interface: RegionObserver
This will be called for region operations where read lock is acquired in HRegion.startRegionOperation().

Specified by:
postStartRegionOperation in interface RegionObserver
op - The operation is about to be taken on the region
Throws:
IOException

postCloseRegionOperation

public void postCloseRegionOperation(ObserverContext<RegionCoprocessorEnvironment> ctx,
                                     HRegion.Operation op)
                              throws IOException
Description copied from interface: RegionObserver
Called after releasing read lock in HRegion.closeRegionOperation(Operation).

Specified by:
postCloseRegionOperation in interface RegionObserver
Throws:
IOException

postInstantiateDeleteTracker

public DeleteTracker postInstantiateDeleteTracker(ObserverContext<RegionCoprocessorEnvironment> ctx,
                                                  DeleteTracker delTracker)
                                           throws IOException
Description copied from interface: RegionObserver
Called after the ScanQueryMatcher creates ScanDeleteTracker. Implementing this hook would help in creating customised DeleteTracker and returning the newly created DeleteTracker

Specified by:
postInstantiateDeleteTracker in interface RegionObserver
Parameters:
ctx - the environment provided by the region server
delTracker - the deleteTracker that is created by the QueryMatcher
Returns:
the Delete Tracker
Throws:
IOException


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