org.apache.hadoop.hbase.coprocessor
Class BaseRegionObserver

java.lang.Object
  extended by org.apache.hadoop.hbase.coprocessor.BaseRegionObserver
All Implemented Interfaces:
Coprocessor, RegionObserver

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
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
 boolean postCheckAndDelete(ObserverContext<RegionCoprocessorEnvironment> e, byte[] row, byte[] family, byte[] qualifier, CompareFilter.CompareOp compareOp, WritableByteArrayComparable comparator, Delete delete, boolean result)
          Called after checkAndDelete
 boolean postCheckAndPut(ObserverContext<RegionCoprocessorEnvironment> e, byte[] row, byte[] family, byte[] qualifier, CompareFilter.CompareOp compareOp, WritableByteArrayComparable 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 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 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 postDelete(ObserverContext<RegionCoprocessorEnvironment> e, Delete delete, WALEdit edit, boolean writeToWAL)
          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 postGet(ObserverContext<RegionCoprocessorEnvironment> e, Get get, List<KeyValue> results)
          Called after the client performs a Get
 void postGetClosestRowBefore(ObserverContext<RegionCoprocessorEnvironment> e, byte[] row, byte[] family, Result result)
          Called after a client makes a GetClosestRowBefore request.
 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
 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, boolean writeToWAL)
          Called after the client stores a value.
 void postScannerClose(ObserverContext<RegionCoprocessorEnvironment> e, InternalScanner s)
          Called after the client closes a scanner.
 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 postWALRestore(ObserverContext<RegionCoprocessorEnvironment> env, HRegionInfo info, HLogKey logKey, WALEdit logEdit)
          Called after a WALEdit replayed for this region.
 boolean preCheckAndDelete(ObserverContext<RegionCoprocessorEnvironment> e, byte[] row, byte[] family, byte[] qualifier, CompareFilter.CompareOp compareOp, WritableByteArrayComparable comparator, Delete delete, boolean result)
          Called before checkAndDelete
 boolean preCheckAndPut(ObserverContext<RegionCoprocessorEnvironment> e, byte[] row, byte[] family, byte[] qualifier, CompareFilter.CompareOp compareOp, WritableByteArrayComparable comparator, Put put, boolean result)
          Called before checkAndPut
 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)
          Called prior to writing the StoreFiles selected for compaction into a new StoreFile.
 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 preDelete(ObserverContext<RegionCoprocessorEnvironment> e, Delete delete, WALEdit edit, boolean writeToWAL)
          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.
 void preGet(ObserverContext<RegionCoprocessorEnvironment> e, Get get, List<KeyValue> results)
          Called before the client performs a Get
 void preGetClosestRowBefore(ObserverContext<RegionCoprocessorEnvironment> e, byte[] row, byte[] family, Result result)
          Called before a client makes a GetClosestRowBefore request.
 Result preIncrement(ObserverContext<RegionCoprocessorEnvironment> e, Increment increment)
          Called before Increment
 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 prePut(ObserverContext<RegionCoprocessorEnvironment> e, Put put, WALEdit edit, boolean writeToWAL)
          Called before the client stores a value.
 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 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)
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

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

preClose

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

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

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

preFlush

public void preFlush(ObserverContext<RegionCoprocessorEnvironment> e)
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

postFlush

public void postFlush(ObserverContext<RegionCoprocessorEnvironment> e)
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

preSplit

public void preSplit(ObserverContext<RegionCoprocessorEnvironment> e)
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)

postSplit

public void postSplit(ObserverContext<RegionCoprocessorEnvironment> e,
                      HRegion l,
                      HRegion r)
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

preCompactSelection

public void preCompactSelection(ObserverContext<RegionCoprocessorEnvironment> c,
                                Store store,
                                List<StoreFile> candidates)
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

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

preCompact

public InternalScanner preCompact(ObserverContext<RegionCoprocessorEnvironment> e,
                                  Store store,
                                  InternalScanner scanner)
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
Returns:
the scanner to use during compaction. Should not be null unless the implementation is writing new store files on its own.

postCompact

public void postCompact(ObserverContext<RegionCoprocessorEnvironment> e,
                        Store store,
                        StoreFile resultFile)
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

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

preGet

public void preGet(ObserverContext<RegionCoprocessorEnvironment> e,
                   Get get,
                   List<KeyValue> 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:
preGet 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

postGet

public void postGet(ObserverContext<RegionCoprocessorEnvironment> e,
                    Get get,
                    List<KeyValue> 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:
postGet 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

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,
                   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
Parameters:
e - 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> e,
                    Put put,
                    WALEdit edit,
                    boolean writeToWAL)
             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
writeToWAL - true if the change should be written to the WAL
Throws:
IOException - if an error occurred on the coprocessor

preDelete

public void preDelete(ObserverContext<RegionCoprocessorEnvironment> e,
                      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
Parameters:
e - 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> e,
                       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
Parameters:
e - 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> e,
                              byte[] row,
                              byte[] family,
                              byte[] qualifier,
                              CompareFilter.CompareOp compareOp,
                              WritableByteArrayComparable 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

postCheckAndPut

public boolean postCheckAndPut(ObserverContext<RegionCoprocessorEnvironment> e,
                               byte[] row,
                               byte[] family,
                               byte[] qualifier,
                               CompareFilter.CompareOp compareOp,
                               WritableByteArrayComparable 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,
                                 WritableByteArrayComparable 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

postCheckAndDelete

public boolean postCheckAndDelete(ObserverContext<RegionCoprocessorEnvironment> e,
                                  byte[] row,
                                  byte[] family,
                                  byte[] qualifier,
                                  CompareFilter.CompareOp compareOp,
                                  WritableByteArrayComparable 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

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

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

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

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


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