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.CellScanner;
24  import org.apache.hadoop.hbase.CoprocessorEnvironment;
25  import org.apache.hadoop.hbase.HBaseInterfaceAudience;
26  import org.apache.hadoop.hbase.client.Mutation;
27  import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.WALEntry;
28  import org.apache.hadoop.hbase.regionserver.HRegion;
29  import org.apache.hadoop.hbase.replication.ReplicationEndpoint;
30  
31  /**
32   * An abstract class that implements RegionServerObserver.
33   * By extending it, you can create your own region server observer without
34   * overriding all abstract methods of RegionServerObserver.
35   */
36  @InterfaceAudience.LimitedPrivate(HBaseInterfaceAudience.COPROC)
37  @InterfaceStability.Evolving
38  public class BaseRegionServerObserver implements RegionServerObserver {
39  
40    @Override
41    public void preStopRegionServer(ObserverContext<RegionServerCoprocessorEnvironment> env)
42        throws IOException { }
43  
44    @Override
45    public void start(CoprocessorEnvironment env) throws IOException { }
46  
47    @Override
48    public void stop(CoprocessorEnvironment env) throws IOException { }
49  
50    @Override
51    public void preMerge(ObserverContext<RegionServerCoprocessorEnvironment> ctx, HRegion regionA,
52        HRegion regionB) throws IOException { }
53  
54    @Override
55    public void postMerge(ObserverContext<RegionServerCoprocessorEnvironment> c, HRegion regionA,
56        HRegion regionB, HRegion mergedRegion) throws IOException { }
57  
58    @Override
59    public void preMergeCommit(ObserverContext<RegionServerCoprocessorEnvironment> ctx,
60        HRegion regionA, HRegion regionB, List<Mutation> metaEntries) throws IOException { }
61  
62    @Override
63    public void postMergeCommit(ObserverContext<RegionServerCoprocessorEnvironment> ctx,
64        HRegion regionA, HRegion regionB, HRegion mergedRegion) throws IOException { }
65  
66    @Override
67    public void preRollBackMerge(ObserverContext<RegionServerCoprocessorEnvironment> ctx,
68        HRegion regionA, HRegion regionB) throws IOException { }
69  
70    @Override
71    public void postRollBackMerge(ObserverContext<RegionServerCoprocessorEnvironment> ctx,
72        HRegion regionA, HRegion regionB) throws IOException { }
73  
74    @Override
75    public void preRollWALWriterRequest(ObserverContext<RegionServerCoprocessorEnvironment> ctx)
76        throws IOException { }
77  
78    @Override
79    public void postRollWALWriterRequest(ObserverContext<RegionServerCoprocessorEnvironment> ctx)
80        throws IOException { }
81  
82    @Override
83    public ReplicationEndpoint postCreateReplicationEndPoint(
84        ObserverContext<RegionServerCoprocessorEnvironment> ctx, ReplicationEndpoint endpoint) {
85      return endpoint;
86    }
87  
88    @Override
89    public void preReplicateLogEntries(ObserverContext<RegionServerCoprocessorEnvironment> ctx,
90        List<WALEntry> entries, CellScanner cells) throws IOException { }
91  
92    @Override
93    public void postReplicateLogEntries(ObserverContext<RegionServerCoprocessorEnvironment> ctx,
94        List<WALEntry> entries, CellScanner cells) throws IOException { }
95  }