View Javadoc

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