org.apache.hadoop.hbase.coprocessor
Class BaseRegionServerObserver

java.lang.Object
  extended by org.apache.hadoop.hbase.coprocessor.BaseRegionServerObserver
All Implemented Interfaces:
Coprocessor, RegionServerObserver
Direct Known Subclasses:
VisibilityController.VisibilityReplication

@InterfaceAudience.LimitedPrivate(value="Coprocesssor")
@InterfaceStability.Evolving
public class BaseRegionServerObserver
extends Object
implements RegionServerObserver

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


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
BaseRegionServerObserver()
           
 
Method Summary
 ReplicationEndpoint postCreateReplicationEndPoint(ObserverContext<RegionServerCoprocessorEnvironment> ctx, ReplicationEndpoint endpoint)
          This will be called after the replication endpoint is instantiated.
 void postMerge(ObserverContext<RegionServerCoprocessorEnvironment> c, HRegion regionA, HRegion regionB, HRegion mergedRegion)
          called after the regions merge.
 void postMergeCommit(ObserverContext<RegionServerCoprocessorEnvironment> ctx, HRegion regionA, HRegion regionB, HRegion mergedRegion)
          This will be called after PONR step as part of regions merge transaction.
 void postReplicateLogEntries(ObserverContext<RegionServerCoprocessorEnvironment> ctx, List<org.apache.hadoop.hbase.protobuf.generated.AdminProtos.WALEntry> entries, CellScanner cells)
          This will be called after executing replication request to shipping log entries.
 void postRollBackMerge(ObserverContext<RegionServerCoprocessorEnvironment> ctx, HRegion regionA, HRegion regionB)
          This will be called after the roll back of the regions merge.
 void postRollWALWriterRequest(ObserverContext<RegionServerCoprocessorEnvironment> ctx)
          This will be called after executing user request to roll a region server WAL.
 void preMerge(ObserverContext<RegionServerCoprocessorEnvironment> ctx, HRegion regionA, HRegion regionB)
          Called before the regions merge.
 void preMergeCommit(ObserverContext<RegionServerCoprocessorEnvironment> ctx, HRegion regionA, HRegion regionB, List<Mutation> metaEntries)
          This will be called before PONR step as part of regions merge transaction.
 void preReplicateLogEntries(ObserverContext<RegionServerCoprocessorEnvironment> ctx, List<org.apache.hadoop.hbase.protobuf.generated.AdminProtos.WALEntry> entries, CellScanner cells)
          This will be called before executing replication request to shipping log entries.
 void preRollBackMerge(ObserverContext<RegionServerCoprocessorEnvironment> ctx, HRegion regionA, HRegion regionB)
          This will be called before the roll back of the regions merge.
 void preRollWALWriterRequest(ObserverContext<RegionServerCoprocessorEnvironment> ctx)
          This will be called before executing user request to roll a region server WAL.
 void preStopRegionServer(ObserverContext<RegionServerCoprocessorEnvironment> env)
          Called before stopping region server.
 void start(CoprocessorEnvironment env)
           
 void stop(CoprocessorEnvironment env)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseRegionServerObserver

public BaseRegionServerObserver()
Method Detail

preStopRegionServer

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

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

start

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

stop

public void stop(CoprocessorEnvironment env)
          throws IOException
Specified by:
stop in interface Coprocessor
Throws:
IOException

preMerge

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

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

postMerge

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

Specified by:
postMerge in interface RegionServerObserver
Throws:
IOException

preMergeCommit

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

Specified by:
preMergeCommit in interface RegionServerObserver
metaEntries - mutations to execute on hbase:meta atomically with regions merge updates. Any puts or deletes to execute on hbase:meta can be added to the mutations.
Throws:
IOException

postMergeCommit

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

Specified by:
postMergeCommit in interface RegionServerObserver
Throws:
IOException

preRollBackMerge

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

Specified by:
preRollBackMerge in interface RegionServerObserver
Throws:
IOException

postRollBackMerge

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

Specified by:
postRollBackMerge in interface RegionServerObserver
Throws:
IOException

preRollWALWriterRequest

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

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

postRollWALWriterRequest

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

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

postCreateReplicationEndPoint

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

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

preReplicateLogEntries

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

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

postReplicateLogEntries

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

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


Copyright © 2007-2016 The Apache Software Foundation. All Rights Reserved.