|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hbase.coprocessor.BaseRegionObserver
public abstract class BaseRegionObserver
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 StoreFile s 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 StoreFile s selected for compaction into
a new StoreFile . |
void |
preCompactSelection(ObserverContext<RegionCoprocessorEnvironment> c,
Store store,
List<StoreFile> candidates)
Called prior to selecting the StoreFile s 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 |
---|
public BaseRegionObserver()
Method Detail |
---|
public void start(CoprocessorEnvironment e) throws IOException
start
in interface Coprocessor
IOException
public void stop(CoprocessorEnvironment e) throws IOException
stop
in interface Coprocessor
IOException
public void preOpen(ObserverContext<RegionCoprocessorEnvironment> e)
RegionObserver
preOpen
in interface RegionObserver
e
- the environment provided by the region serverpublic void postOpen(ObserverContext<RegionCoprocessorEnvironment> e)
RegionObserver
postOpen
in interface RegionObserver
e
- the environment provided by the region serverpublic void preClose(ObserverContext<RegionCoprocessorEnvironment> e, boolean abortRequested)
RegionObserver
preClose
in interface RegionObserver
e
- the environment provided by the region serverabortRequested
- true if the region server is abortingpublic void postClose(ObserverContext<RegionCoprocessorEnvironment> e, boolean abortRequested)
RegionObserver
postClose
in interface RegionObserver
e
- the environment provided by the region serverabortRequested
- true if the region server is abortingpublic void preFlush(ObserverContext<RegionCoprocessorEnvironment> e)
RegionObserver
preFlush
in interface RegionObserver
e
- the environment provided by the region serverpublic void postFlush(ObserverContext<RegionCoprocessorEnvironment> e)
RegionObserver
postFlush
in interface RegionObserver
e
- the environment provided by the region serverpublic void preSplit(ObserverContext<RegionCoprocessorEnvironment> e)
RegionObserver
preSplit
in interface RegionObserver
e
- the environment provided by the region server
(e.getRegion() returns the parent region)public void postSplit(ObserverContext<RegionCoprocessorEnvironment> e, HRegion l, HRegion r)
RegionObserver
postSplit
in interface RegionObserver
e
- the environment provided by the region server
(e.getRegion() returns the parent region)l
- the left daughter regionr
- the right daughter regionpublic void preCompactSelection(ObserverContext<RegionCoprocessorEnvironment> c, Store store, List<StoreFile> candidates)
RegionObserver
StoreFile
s to compact from the list
of available candidates. To alter the files used for compaction, you may
mutate the passed in list of candidates.
preCompactSelection
in interface RegionObserver
c
- the environment provided by the region serverstore
- the store where compaction is being requestedcandidates
- the store files currently available for compactionpublic void postCompactSelection(ObserverContext<RegionCoprocessorEnvironment> c, Store store, com.google.common.collect.ImmutableList<StoreFile> selected)
RegionObserver
StoreFile
s to compact have been selected from the
available candidates.
postCompactSelection
in interface RegionObserver
c
- the environment provided by the region serverstore
- the store being compactedselected
- the store files selected to compactpublic InternalScanner preCompact(ObserverContext<RegionCoprocessorEnvironment> e, Store store, InternalScanner scanner)
RegionObserver
StoreFile
s selected for compaction into
a new StoreFile
. To override or modify the compaction process,
implementing classes have two options:
InternalScanner
with a custom
implementation that is returned from this method. The custom scanner
can then inspect KeyValue
s from the wrapped scanner, applying
its own policy to what gets written.ObserverContext.bypass()
and provide a custom implementation for writing of new
StoreFile
s. Note: any implementations bypassing
core compaction using this approach must write out new store files
themselves or the existing data will no longer be available after
compaction.
preCompact
in interface RegionObserver
e
- the environment provided by the region serverstore
- the store being compactedscanner
- the scanner over existing data used in the store file
rewriting
null
unless the implementation is writing new store files on its own.public void postCompact(ObserverContext<RegionCoprocessorEnvironment> e, Store store, StoreFile resultFile)
RegionObserver
postCompact
in interface RegionObserver
e
- the environment provided by the region serverstore
- the store being compactedresultFile
- the new store file written out during compactionpublic void preGetClosestRowBefore(ObserverContext<RegionCoprocessorEnvironment> e, byte[] row, byte[] family, Result result) throws IOException
RegionObserver
Call CoprocessorEnvironment#bypass to skip default actions
Call CoprocessorEnvironment#complete to skip any subsequent chained coprocessors
preGetClosestRowBefore
in interface RegionObserver
e
- the environment provided by the region serverrow
- the rowfamily
- the familyresult
- The result to return to the client if default processing
is bypassed. Can be modified. Will not be used if default processing
is not bypassed.
IOException
- if an error occurred on the coprocessorpublic void postGetClosestRowBefore(ObserverContext<RegionCoprocessorEnvironment> e, byte[] row, byte[] family, Result result) throws IOException
RegionObserver
Call CoprocessorEnvironment#complete to skip any subsequent chained coprocessors
postGetClosestRowBefore
in interface RegionObserver
e
- the environment provided by the region serverrow
- the rowfamily
- the desired familyresult
- the result to return to the client, modify as necessary
IOException
- if an error occurred on the coprocessorpublic void preGet(ObserverContext<RegionCoprocessorEnvironment> e, Get get, List<KeyValue> results) throws IOException
RegionObserver
Call CoprocessorEnvironment#bypass to skip default actions
Call CoprocessorEnvironment#complete to skip any subsequent chained coprocessors
preGet
in interface RegionObserver
e
- the environment provided by the region serverget
- the Get requestresults
- The result to return to the client if default processing
is bypassed. Can be modified. Will not be used if default processing
is not bypassed.
IOException
- if an error occurred on the coprocessorpublic void postGet(ObserverContext<RegionCoprocessorEnvironment> e, Get get, List<KeyValue> results) throws IOException
RegionObserver
Call CoprocessorEnvironment#complete to skip any subsequent chained coprocessors
postGet
in interface RegionObserver
e
- the environment provided by the region serverget
- the Get requestresults
- the result to return to the client, modify as necessary
IOException
- if an error occurred on the coprocessorpublic boolean preExists(ObserverContext<RegionCoprocessorEnvironment> e, Get get, boolean exists) throws IOException
RegionObserver
Call CoprocessorEnvironment#bypass to skip default actions
Call CoprocessorEnvironment#complete to skip any subsequent chained coprocessors
preExists
in interface RegionObserver
e
- the environment provided by the region serverget
- the Get request
IOException
- if an error occurred on the coprocessorpublic boolean postExists(ObserverContext<RegionCoprocessorEnvironment> e, Get get, boolean exists) throws IOException
RegionObserver
Call CoprocessorEnvironment#complete to skip any subsequent chained coprocessors
postExists
in interface RegionObserver
e
- the environment provided by the region serverget
- the Get requestexists
- the result returned by the region server
IOException
- if an error occurred on the coprocessorpublic void prePut(ObserverContext<RegionCoprocessorEnvironment> e, Put put, WALEdit edit, boolean writeToWAL) throws IOException
RegionObserver
Call CoprocessorEnvironment#bypass to skip default actions
Call CoprocessorEnvironment#complete to skip any subsequent chained coprocessors
prePut
in interface RegionObserver
e
- the environment provided by the region serverput
- The Put objectedit
- The WALEdit object that will be written to the walwriteToWAL
- true if the change should be written to the WAL
IOException
- if an error occurred on the coprocessorpublic void postPut(ObserverContext<RegionCoprocessorEnvironment> e, Put put, WALEdit edit, boolean writeToWAL) throws IOException
RegionObserver
Call CoprocessorEnvironment#complete to skip any subsequent chained coprocessors
postPut
in interface RegionObserver
e
- the environment provided by the region serverput
- The Put objectedit
- The WALEdit object for the walwriteToWAL
- true if the change should be written to the WAL
IOException
- if an error occurred on the coprocessorpublic void preDelete(ObserverContext<RegionCoprocessorEnvironment> e, Delete delete, WALEdit edit, boolean writeToWAL) throws IOException
RegionObserver
Call CoprocessorEnvironment#bypass to skip default actions
Call CoprocessorEnvironment#complete to skip any subsequent chained coprocessors
preDelete
in interface RegionObserver
e
- the environment provided by the region serverdelete
- The Delete objectedit
- The WALEdit object for the walwriteToWAL
- true if the change should be written to the WAL
IOException
- if an error occurred on the coprocessorpublic void postDelete(ObserverContext<RegionCoprocessorEnvironment> e, Delete delete, WALEdit edit, boolean writeToWAL) throws IOException
RegionObserver
Call CoprocessorEnvironment#complete to skip any subsequent chained coprocessors
postDelete
in interface RegionObserver
e
- the environment provided by the region serverdelete
- The Delete objectedit
- The WALEdit object for the walwriteToWAL
- true if the change should be written to the WAL
IOException
- if an error occurred on the coprocessorpublic boolean preCheckAndPut(ObserverContext<RegionCoprocessorEnvironment> e, byte[] row, byte[] family, byte[] qualifier, CompareFilter.CompareOp compareOp, WritableByteArrayComparable comparator, Put put, boolean result) throws IOException
RegionObserver
Call CoprocessorEnvironment#bypass to skip default actions
Call CoprocessorEnvironment#complete to skip any subsequent chained coprocessors
preCheckAndPut
in interface RegionObserver
e
- the environment provided by the region serverrow
- row to checkfamily
- column familyqualifier
- column qualifiercompareOp
- the comparison operationcomparator
- the comparatorput
- data to put if check succeeds
IOException
- if an error occurred on the coprocessorpublic boolean postCheckAndPut(ObserverContext<RegionCoprocessorEnvironment> e, byte[] row, byte[] family, byte[] qualifier, CompareFilter.CompareOp compareOp, WritableByteArrayComparable comparator, Put put, boolean result) throws IOException
RegionObserver
Call CoprocessorEnvironment#complete to skip any subsequent chained coprocessors
postCheckAndPut
in interface RegionObserver
e
- the environment provided by the region serverrow
- row to checkfamily
- column familyqualifier
- column qualifiercompareOp
- the comparison operationcomparator
- the comparatorput
- data to put if check succeedsresult
- from the checkAndPut
IOException
- if an error occurred on the coprocessorpublic boolean preCheckAndDelete(ObserverContext<RegionCoprocessorEnvironment> e, byte[] row, byte[] family, byte[] qualifier, CompareFilter.CompareOp compareOp, WritableByteArrayComparable comparator, Delete delete, boolean result) throws IOException
RegionObserver
Call CoprocessorEnvironment#bypass to skip default actions
Call CoprocessorEnvironment#complete to skip any subsequent chained coprocessors
preCheckAndDelete
in interface RegionObserver
e
- the environment provided by the region serverrow
- row to checkfamily
- column familyqualifier
- column qualifiercompareOp
- the comparison operationcomparator
- the comparatordelete
- delete to commit if check succeeds
IOException
- if an error occurred on the coprocessorpublic boolean postCheckAndDelete(ObserverContext<RegionCoprocessorEnvironment> e, byte[] row, byte[] family, byte[] qualifier, CompareFilter.CompareOp compareOp, WritableByteArrayComparable comparator, Delete delete, boolean result) throws IOException
RegionObserver
Call CoprocessorEnvironment#complete to skip any subsequent chained coprocessors
postCheckAndDelete
in interface RegionObserver
e
- the environment provided by the region serverrow
- row to checkfamily
- column familyqualifier
- column qualifiercompareOp
- the comparison operationcomparator
- the comparatordelete
- delete to commit if check succeedsresult
- from the CheckAndDelete
IOException
- if an error occurred on the coprocessorpublic long preIncrementColumnValue(ObserverContext<RegionCoprocessorEnvironment> e, byte[] row, byte[] family, byte[] qualifier, long amount, boolean writeToWAL) throws IOException
RegionObserver
Call CoprocessorEnvironment#bypass to skip default actions
Call CoprocessorEnvironment#complete to skip any subsequent chained coprocessors
preIncrementColumnValue
in interface RegionObserver
e
- the environment provided by the region serverrow
- row to checkfamily
- column familyqualifier
- column qualifieramount
- long amount to incrementwriteToWAL
- true if the change should be written to the WAL
IOException
- if an error occurred on the coprocessorpublic long postIncrementColumnValue(ObserverContext<RegionCoprocessorEnvironment> e, byte[] row, byte[] family, byte[] qualifier, long amount, boolean writeToWAL, long result) throws IOException
RegionObserver
Call CoprocessorEnvironment#complete to skip any subsequent chained coprocessors
postIncrementColumnValue
in interface RegionObserver
e
- the environment provided by the region serverrow
- row to checkfamily
- column familyqualifier
- column qualifieramount
- long amount to incrementwriteToWAL
- true if the change should be written to the WALresult
- the result returned by incrementColumnValue
IOException
- if an error occurred on the coprocessorpublic Result preIncrement(ObserverContext<RegionCoprocessorEnvironment> e, Increment increment) throws IOException
RegionObserver
Call CoprocessorEnvironment#bypass to skip default actions
Call CoprocessorEnvironment#complete to skip any subsequent chained coprocessors
preIncrement
in interface RegionObserver
e
- the environment provided by the region serverincrement
- increment object
IOException
- if an error occurred on the coprocessorpublic Result postIncrement(ObserverContext<RegionCoprocessorEnvironment> e, Increment increment, Result result) throws IOException
RegionObserver
Call CoprocessorEnvironment#complete to skip any subsequent chained coprocessors
postIncrement
in interface RegionObserver
e
- the environment provided by the region serverincrement
- increment objectresult
- the result returned by increment
IOException
- if an error occurred on the coprocessorpublic RegionScanner preScannerOpen(ObserverContext<RegionCoprocessorEnvironment> e, Scan scan, RegionScanner s) throws IOException
RegionObserver
Call CoprocessorEnvironment#bypass to skip default actions
Call CoprocessorEnvironment#complete to skip any subsequent chained coprocessors
preScannerOpen
in interface RegionObserver
e
- the environment provided by the region serverscan
- the Scan specifications
- if not null, the base scanner
IOException
- if an error occurred on the coprocessorpublic RegionScanner postScannerOpen(ObserverContext<RegionCoprocessorEnvironment> e, Scan scan, RegionScanner s) throws IOException
RegionObserver
Call CoprocessorEnvironment#complete to skip any subsequent chained coprocessors
postScannerOpen
in interface RegionObserver
e
- the environment provided by the region serverscan
- the Scan specifications
- if not null, the base scanner
IOException
- if an error occurred on the coprocessorpublic boolean preScannerNext(ObserverContext<RegionCoprocessorEnvironment> e, InternalScanner s, List<Result> results, int limit, boolean hasMore) throws IOException
RegionObserver
Call CoprocessorEnvironment#bypass to skip default actions
Call CoprocessorEnvironment#complete to skip any subsequent chained coprocessors
preScannerNext
in interface RegionObserver
e
- the environment provided by the region servers
- the scannerresults
- 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 returnhasMore
- the 'has more' indication
IOException
- if an error occurred on the coprocessorpublic boolean postScannerNext(ObserverContext<RegionCoprocessorEnvironment> e, InternalScanner s, List<Result> results, int limit, boolean hasMore) throws IOException
RegionObserver
Call CoprocessorEnvironment#complete to skip any subsequent chained coprocessors
postScannerNext
in interface RegionObserver
e
- the environment provided by the region servers
- the scannerresults
- the result to return to the client, can be modifiedlimit
- the maximum number of results to returnhasMore
- the 'has more' indication
IOException
- if an error occurred on the coprocessorpublic void preScannerClose(ObserverContext<RegionCoprocessorEnvironment> e, InternalScanner s) throws IOException
RegionObserver
Call CoprocessorEnvironment#bypass to skip default actions
Call CoprocessorEnvironment#complete to skip any subsequent chained coprocessors
preScannerClose
in interface RegionObserver
e
- the environment provided by the region servers
- the scanner
IOException
- if an error occurred on the coprocessorpublic void postScannerClose(ObserverContext<RegionCoprocessorEnvironment> e, InternalScanner s) throws IOException
RegionObserver
Call CoprocessorEnvironment#complete to skip any subsequent chained coprocessors
postScannerClose
in interface RegionObserver
e
- the environment provided by the region servers
- the scanner
IOException
- if an error occurred on the coprocessorpublic void preWALRestore(ObserverContext<RegionCoprocessorEnvironment> env, HRegionInfo info, HLogKey logKey, WALEdit logEdit) throws IOException
RegionObserver
WALEdit
replayed for this region.
preWALRestore
in interface RegionObserver
IOException
public void postWALRestore(ObserverContext<RegionCoprocessorEnvironment> env, HRegionInfo info, HLogKey logKey, WALEdit logEdit) throws IOException
RegionObserver
WALEdit
replayed for this region.
postWALRestore
in interface RegionObserver
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |