View Javadoc

1   /*
2    *
3    * Licensed under the Apache License, Version 2.0 (the "License");
4    * you may not use this file except in compliance with the License.
5    * You may obtain a copy of the License at
6    *
7    *     http://www.apache.org/licenses/LICENSE-2.0
8    *
9    * Unless required by applicable law or agreed to in writing, software
10   * distributed under the License is distributed on an "AS IS" BASIS,
11   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12   * See the License for the specific language governing permissions and
13   * limitations under the License.
14   */
15  
16  package org.apache.hadoop.hbase.coprocessor;
17  
18  import java.io.IOException;
19  import java.util.List;
20  
21  import org.apache.hadoop.hbase.classification.InterfaceAudience;
22  import org.apache.hadoop.hbase.classification.InterfaceStability;
23  import org.apache.hadoop.hbase.CoprocessorEnvironment;
24  import org.apache.hadoop.hbase.HBaseInterfaceAudience;
25  import org.apache.hadoop.hbase.client.Mutation;
26  import org.apache.hadoop.hbase.regionserver.HRegion;
27  import org.apache.hadoop.hbase.replication.ReplicationEndpoint;
28  
29  /**
30   * An abstract class that implements RegionServerObserver.
31   * By extending it, you can create your own region server observer without
32   * overriding all abstract methods of RegionServerObserver.
33   */
34  @InterfaceAudience.LimitedPrivate(HBaseInterfaceAudience.COPROC)
35  @InterfaceStability.Evolving
36  public class BaseRegionServerObserver implements RegionServerObserver {
37  
38    @Override
39    public void preStopRegionServer(ObserverContext<RegionServerCoprocessorEnvironment> env)
40        throws IOException { }
41  
42    @Override
43    public void start(CoprocessorEnvironment env) throws IOException { }
44  
45    @Override
46    public void stop(CoprocessorEnvironment env) throws IOException { }
47  
48    @Override
49    public void preMerge(ObserverContext<RegionServerCoprocessorEnvironment> ctx, HRegion regionA,
50        HRegion regionB) throws IOException { }
51  
52    @Override
53    public void postMerge(ObserverContext<RegionServerCoprocessorEnvironment> c, HRegion regionA,
54        HRegion regionB, HRegion mergedRegion) throws IOException { }
55  
56    @Override
57    public void preMergeCommit(ObserverContext<RegionServerCoprocessorEnvironment> ctx,
58        HRegion regionA, HRegion regionB, List<Mutation> metaEntries) throws IOException { }
59  
60    @Override
61    public void postMergeCommit(ObserverContext<RegionServerCoprocessorEnvironment> ctx,
62        HRegion regionA, HRegion regionB, HRegion mergedRegion) throws IOException { }
63  
64    @Override
65    public void preRollBackMerge(ObserverContext<RegionServerCoprocessorEnvironment> ctx,
66        HRegion regionA, HRegion regionB) throws IOException { }
67  
68    @Override
69    public void postRollBackMerge(ObserverContext<RegionServerCoprocessorEnvironment> ctx,
70        HRegion regionA, HRegion regionB) throws IOException { }
71  
72    @Override
73    public void preRollWALWriterRequest(ObserverContext<RegionServerCoprocessorEnvironment> ctx)
74        throws IOException { }
75  
76    @Override
77    public void postRollWALWriterRequest(ObserverContext<RegionServerCoprocessorEnvironment> ctx)
78        throws IOException { }
79  
80    @Override
81    public ReplicationEndpoint postCreateReplicationEndPoint(
82        ObserverContext<RegionServerCoprocessorEnvironment> ctx, ReplicationEndpoint endpoint) {
83      return endpoint;
84    }
85  
86  }