View Javadoc

1   /*
2    *
3    * Licensed to the Apache Software Foundation (ASF) under one
4    * or more contributor license agreements.  See the NOTICE file
5    * distributed with this work for additional information
6    * regarding copyright ownership.  The ASF licenses this file
7    * to you under the Apache License, Version 2.0 (the
8    * "License"); you may not use this file except in compliance
9    * with the License.  You may obtain a copy of the License at
10   *
11   * http://www.apache.org/licenses/LICENSE-2.0
12   *
13   * Unless required by applicable law or agreed to in writing, software
14   * distributed under the License is distributed on an "AS IS" BASIS,
15   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16   * See the License for the specific language governing permissions and
17   * limitations 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.CoprocessorEnvironment;
26  import org.apache.hadoop.hbase.HBaseInterfaceAudience;
27  import org.apache.hadoop.hbase.HColumnDescriptor;
28  import org.apache.hadoop.hbase.HRegionInfo;
29  import org.apache.hadoop.hbase.HTableDescriptor;
30  import org.apache.hadoop.hbase.NamespaceDescriptor;
31  import org.apache.hadoop.hbase.ServerName;
32  import org.apache.hadoop.hbase.TableName;
33  import org.apache.hadoop.hbase.classification.InterfaceAudience;
34  import org.apache.hadoop.hbase.classification.InterfaceStability;
35  import org.apache.hadoop.hbase.master.RegionPlan;
36  import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.SnapshotDescription;
37  import org.apache.hadoop.hbase.protobuf.generated.QuotaProtos.Quotas;
38  
39  @InterfaceAudience.LimitedPrivate({HBaseInterfaceAudience.COPROC, HBaseInterfaceAudience.CONFIG})
40  @InterfaceStability.Evolving
41  public class BaseMasterObserver implements MasterObserver {
42    @Override
43    public void preCreateTable(ObserverContext<MasterCoprocessorEnvironment> ctx,
44        HTableDescriptor desc, HRegionInfo[] regions) throws IOException {
45    }
46  
47    @Override
48    public void postCreateTable(ObserverContext<MasterCoprocessorEnvironment> ctx,
49        HTableDescriptor desc, HRegionInfo[] regions) throws IOException {
50    }
51  
52    @Override
53    public void preCreateTableHandler(
54        final ObserverContext<MasterCoprocessorEnvironment> ctx,
55        HTableDescriptor desc, HRegionInfo[] regions) throws IOException {
56    }
57  
58    @Override
59    public void postCreateTableHandler(
60        final ObserverContext<MasterCoprocessorEnvironment> ctx,
61        HTableDescriptor desc, HRegionInfo[] regions) throws IOException {
62    }
63  
64    @Override
65    public void preDeleteTable(ObserverContext<MasterCoprocessorEnvironment> ctx,
66        TableName tableName) throws IOException {
67    }
68  
69    @Override
70    public void postDeleteTable(ObserverContext<MasterCoprocessorEnvironment> ctx,
71        TableName tableName) throws IOException {
72    }
73  
74    @Override
75    public void preDeleteTableHandler(
76        final ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName)
77        throws IOException{
78    }
79  
80    @Override
81    public void postDeleteTableHandler(
82        final ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName)
83        throws IOException {
84    }
85  
86    @Override
87    public void preTruncateTable(ObserverContext<MasterCoprocessorEnvironment> ctx,
88        TableName tableName) throws IOException {
89    }
90  
91    @Override
92    public void postTruncateTable(ObserverContext<MasterCoprocessorEnvironment> ctx,
93        TableName tableName) throws IOException {
94    }
95  
96    @Override
97    public void preTruncateTableHandler(
98        final ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName)
99        throws IOException {
100   }
101 
102   @Override
103   public void postTruncateTableHandler(
104       final ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName)
105       throws IOException {
106   }
107 
108   @Override
109   public void preModifyTable(ObserverContext<MasterCoprocessorEnvironment> ctx,
110       TableName tableName, HTableDescriptor htd) throws IOException {
111   }
112 
113   @Override
114   public void postModifyTableHandler(
115       ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName,
116       HTableDescriptor htd) throws IOException {
117   }
118 
119   @Override
120   public void preModifyTableHandler(
121       ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName,
122       HTableDescriptor htd) throws IOException {
123   }
124 
125   @Override
126   public void postModifyTable(ObserverContext<MasterCoprocessorEnvironment> ctx,
127       TableName tableName, HTableDescriptor htd) throws IOException {
128   }
129 
130   @Override
131   public void preCreateNamespace(ObserverContext<MasterCoprocessorEnvironment> ctx, NamespaceDescriptor ns) throws IOException {
132   }
133 
134   @Override
135   public void postCreateNamespace(ObserverContext<MasterCoprocessorEnvironment> ctx, NamespaceDescriptor ns) throws IOException {
136   }
137 
138   @Override
139   public void preDeleteNamespace(ObserverContext<MasterCoprocessorEnvironment> ctx, String namespace) throws IOException {
140   }
141 
142   @Override
143   public void postDeleteNamespace(ObserverContext<MasterCoprocessorEnvironment> ctx, String namespace) throws IOException {
144   }
145 
146   @Override
147   public void preModifyNamespace(ObserverContext<MasterCoprocessorEnvironment> ctx, NamespaceDescriptor ns) throws IOException {
148   }
149 
150   @Override
151   public void postModifyNamespace(ObserverContext<MasterCoprocessorEnvironment> ctx, NamespaceDescriptor ns) throws IOException {
152   }
153 
154   @Override
155   public void preGetNamespaceDescriptor(ObserverContext<MasterCoprocessorEnvironment> ctx,
156       String namespace) throws IOException {
157   }
158 
159   @Override
160   public void postGetNamespaceDescriptor(ObserverContext<MasterCoprocessorEnvironment> ctx,
161       NamespaceDescriptor ns) throws IOException {
162   }
163 
164   @Override
165   public void preListNamespaceDescriptors(ObserverContext<MasterCoprocessorEnvironment> ctx,
166       List<NamespaceDescriptor> descriptors) throws IOException {
167   }
168 
169   @Override
170   public void postListNamespaceDescriptors(ObserverContext<MasterCoprocessorEnvironment> ctx,
171       List<NamespaceDescriptor> descriptors) throws IOException {
172   }
173 
174   @Deprecated
175   @Override
176   public void preAddColumn(ObserverContext<MasterCoprocessorEnvironment> ctx,
177       TableName tableName, HColumnDescriptor columnFamily) throws IOException {
178   }
179 
180   @Override
181   public void preAddColumnFamily(ObserverContext<MasterCoprocessorEnvironment> ctx,
182       TableName tableName, HColumnDescriptor columnFamily) throws IOException {
183   }
184 
185   @Deprecated
186   @Override
187   public void postAddColumn(ObserverContext<MasterCoprocessorEnvironment> ctx,
188       TableName tableName, HColumnDescriptor columnFamily) throws IOException {
189   }
190 
191   @Override
192   public void postAddColumnFamily(ObserverContext<MasterCoprocessorEnvironment> ctx,
193       TableName tableName, HColumnDescriptor columnFamily) throws IOException {
194   }
195 
196   @Deprecated
197   @Override
198   public void preAddColumnHandler(
199       ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName,
200       HColumnDescriptor columnFamily) throws IOException {
201   }
202 
203   @Override
204   public void preAddColumnFamilyHandler(
205       ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName,
206       HColumnDescriptor columnFamily) throws IOException {
207   }
208 
209   @Deprecated
210   @Override
211   public void postAddColumnHandler(
212       ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName,
213       HColumnDescriptor columnFamily) throws IOException {
214   }
215 
216   @Override
217   public void postAddColumnFamilyHandler(
218       ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName,
219       HColumnDescriptor columnFamily) throws IOException {
220   }
221 
222   @Deprecated
223   @Override
224   public void preModifyColumn(ObserverContext<MasterCoprocessorEnvironment> ctx,
225       TableName tableName, HColumnDescriptor columnFamily) throws IOException {
226   }
227 
228   @Override
229   public void preModifyColumnFamily(ObserverContext<MasterCoprocessorEnvironment> ctx,
230       TableName tableName, HColumnDescriptor columnFamily) throws IOException {
231   }
232 
233   @Deprecated
234   @Override
235   public void postModifyColumn(ObserverContext<MasterCoprocessorEnvironment> ctx,
236       TableName tableName, HColumnDescriptor columnFamily) throws IOException {
237   }
238 
239   @Override
240   public void postModifyColumnFamily(ObserverContext<MasterCoprocessorEnvironment> ctx,
241       TableName tableName, HColumnDescriptor columnFamily) throws IOException {
242   }
243 
244   @Deprecated
245   @Override
246   public void preModifyColumnHandler(
247       ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName,
248       HColumnDescriptor columnFamily) throws IOException {
249   }
250 
251   @Override
252   public void preModifyColumnFamilyHandler(
253       ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName,
254       HColumnDescriptor columnFamily) throws IOException {
255   }
256 
257   @Deprecated
258   @Override
259   public void postModifyColumnHandler(
260       ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName,
261       HColumnDescriptor columnFamily) throws IOException {
262   }
263 
264   @Override
265   public void postModifyColumnFamilyHandler(
266       ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName,
267       HColumnDescriptor columnFamily) throws IOException {
268   }
269 
270   @Deprecated
271   @Override
272   public void preDeleteColumn(ObserverContext<MasterCoprocessorEnvironment> ctx,
273       TableName tableName, byte[] columnFamily) throws IOException {
274   }
275 
276   @Override
277   public void preDeleteColumnFamily(ObserverContext<MasterCoprocessorEnvironment> ctx,
278       TableName tableName, byte[] columnFamily) throws IOException {
279   }
280 
281   @Deprecated
282   @Override
283   public void postDeleteColumn(ObserverContext<MasterCoprocessorEnvironment> ctx,
284       TableName tableName, byte[] columnFamily) throws IOException {
285   }
286 
287   @Override
288   public void postDeleteColumnFamily(ObserverContext<MasterCoprocessorEnvironment> ctx,
289       TableName tableName, byte[] columnFamily) throws IOException {
290   }
291 
292   @Deprecated
293   @Override
294   public void preDeleteColumnHandler(
295       ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName,
296       byte[] columnFamily) throws IOException {
297   }
298 
299   @Override
300   public void preDeleteColumnFamilyHandler(
301       ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName,
302       byte[] columnFamily) throws IOException {
303   }
304 
305   @Deprecated
306   @Override
307   public void postDeleteColumnHandler(
308       ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName,
309       byte[] columnFamily) throws IOException {
310   }
311 
312   @Override
313   public void postDeleteColumnFamilyHandler(
314       ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName,
315       byte[] columnFamily) throws IOException {
316   }
317 
318 
319   @Override
320   public void preEnableTable(ObserverContext<MasterCoprocessorEnvironment> ctx,
321       TableName tableName) throws IOException {
322   }
323 
324   @Override
325   public void postEnableTable(ObserverContext<MasterCoprocessorEnvironment> ctx,
326       TableName tableName) throws IOException {
327   }
328 
329   @Override
330   public void preEnableTableHandler(
331       ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName)
332       throws IOException {
333   }
334 
335   @Override
336   public void postEnableTableHandler(
337       ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName)
338       throws IOException {
339   }
340 
341   @Override
342   public void preDisableTable(ObserverContext<MasterCoprocessorEnvironment> ctx,
343       TableName tableName) throws IOException {
344   }
345 
346   @Override
347   public void postDisableTable(ObserverContext<MasterCoprocessorEnvironment> ctx,
348       TableName tableName) throws IOException {
349   }
350 
351   @Override
352   public void preDisableTableHandler(
353       ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName)
354       throws IOException {
355   }
356 
357   @Override
358   public void postDisableTableHandler(
359       ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName)
360       throws IOException {
361   }
362 
363   @Override
364   public void preAssign(ObserverContext<MasterCoprocessorEnvironment> ctx,
365       HRegionInfo regionInfo) throws IOException {
366   }
367 
368   @Override
369   public void postAssign(ObserverContext<MasterCoprocessorEnvironment> ctx,
370       HRegionInfo regionInfo) throws IOException {
371   }
372 
373   @Override
374   public void preUnassign(ObserverContext<MasterCoprocessorEnvironment> ctx,
375       HRegionInfo regionInfo, boolean force) throws IOException {
376   }
377 
378   @Override
379   public void postUnassign(ObserverContext<MasterCoprocessorEnvironment> ctx,
380       HRegionInfo regionInfo, boolean force) throws IOException {
381   }
382 
383   @Override
384   public void preRegionOffline(ObserverContext<MasterCoprocessorEnvironment> ctx,
385     HRegionInfo regionInfo) throws IOException {
386   }
387 
388   @Override
389   public void postRegionOffline(ObserverContext<MasterCoprocessorEnvironment> ctx,
390     HRegionInfo regionInfo) throws IOException {
391   }
392 
393   @Override
394   public void preBalance(ObserverContext<MasterCoprocessorEnvironment> ctx)
395       throws IOException {
396   }
397 
398   @Override
399   public void postBalance(ObserverContext<MasterCoprocessorEnvironment> ctx, List<RegionPlan> plans)
400       throws IOException {
401   }
402 
403   @Override
404   public boolean preBalanceSwitch(ObserverContext<MasterCoprocessorEnvironment> ctx,
405       boolean b) throws IOException {
406     return b;
407   }
408 
409   @Override
410   public void postBalanceSwitch(ObserverContext<MasterCoprocessorEnvironment> ctx,
411       boolean oldValue, boolean newValue) throws IOException {
412   }
413 
414   @Override
415   public void preShutdown(ObserverContext<MasterCoprocessorEnvironment> ctx)
416       throws IOException {
417   }
418 
419   @Override
420   public void preStopMaster(ObserverContext<MasterCoprocessorEnvironment> ctx)
421       throws IOException {
422   }
423 
424   @Override
425   public void postStartMaster(ObserverContext<MasterCoprocessorEnvironment> ctx)
426       throws IOException {
427   }
428 
429   @Override
430   public void preMasterInitialization(
431       ObserverContext<MasterCoprocessorEnvironment> ctx) throws IOException {
432   }
433 
434   @Override
435   public void start(CoprocessorEnvironment ctx) throws IOException {
436   }
437 
438   @Override
439   public void stop(CoprocessorEnvironment ctx) throws IOException {
440   }
441 
442   @Override
443   public void preMove(ObserverContext<MasterCoprocessorEnvironment> ctx,
444       HRegionInfo region, ServerName srcServer, ServerName destServer)
445   throws IOException {
446   }
447 
448   @Override
449   public void postMove(ObserverContext<MasterCoprocessorEnvironment> ctx,
450       HRegionInfo region, ServerName srcServer, ServerName destServer)
451   throws IOException {
452   }
453 
454   @Override
455   public void preSnapshot(final ObserverContext<MasterCoprocessorEnvironment> ctx,
456       final SnapshotDescription snapshot, final HTableDescriptor hTableDescriptor)
457       throws IOException {
458   }
459 
460   @Override
461   public void postSnapshot(final ObserverContext<MasterCoprocessorEnvironment> ctx,
462       final SnapshotDescription snapshot, final HTableDescriptor hTableDescriptor)
463       throws IOException {
464   }
465 
466   @Override
467   public void preListSnapshot(final ObserverContext<MasterCoprocessorEnvironment> ctx,
468       final SnapshotDescription snapshot) throws IOException {
469   }
470 
471   @Override
472   public void postListSnapshot(final ObserverContext<MasterCoprocessorEnvironment> ctx,
473       final SnapshotDescription snapshot) throws IOException {
474   }
475 
476   @Override
477   public void preCloneSnapshot(final ObserverContext<MasterCoprocessorEnvironment> ctx,
478       final SnapshotDescription snapshot, final HTableDescriptor hTableDescriptor)
479       throws IOException {
480   }
481 
482   @Override
483   public void postCloneSnapshot(final ObserverContext<MasterCoprocessorEnvironment> ctx,
484       final SnapshotDescription snapshot, final HTableDescriptor hTableDescriptor)
485       throws IOException {
486   }
487 
488   @Override
489   public void preRestoreSnapshot(final ObserverContext<MasterCoprocessorEnvironment> ctx,
490       final SnapshotDescription snapshot, final HTableDescriptor hTableDescriptor)
491       throws IOException {
492   }
493 
494   @Override
495   public void postRestoreSnapshot(final ObserverContext<MasterCoprocessorEnvironment> ctx,
496       final SnapshotDescription snapshot, final HTableDescriptor hTableDescriptor)
497       throws IOException {
498   }
499 
500   @Override
501   public void preDeleteSnapshot(final ObserverContext<MasterCoprocessorEnvironment> ctx,
502       final SnapshotDescription snapshot) throws IOException {
503   }
504 
505   @Override
506   public void postDeleteSnapshot(final ObserverContext<MasterCoprocessorEnvironment> ctx,
507       final SnapshotDescription snapshot) throws IOException {
508   }
509 
510   @Override
511   public void preGetTableDescriptors(ObserverContext<MasterCoprocessorEnvironment> ctx,
512       List<TableName> tableNamesList, List<HTableDescriptor> descriptors, String regex)
513       throws IOException {
514   }
515 
516   @Override
517   public void postGetTableDescriptors(ObserverContext<MasterCoprocessorEnvironment> ctx,
518       List<TableName> tableNamesList, List<HTableDescriptor> descriptors,
519       String regex) throws IOException {
520   }
521 
522   @Override
523   public void preGetTableNames(ObserverContext<MasterCoprocessorEnvironment> ctx,
524       List<HTableDescriptor> descriptors, String regex) throws IOException {
525   }
526 
527   @Override
528   public void postGetTableNames(ObserverContext<MasterCoprocessorEnvironment> ctx,
529       List<HTableDescriptor> descriptors, String regex) throws IOException {
530   }
531 
532   @Override
533   public void preTableFlush(ObserverContext<MasterCoprocessorEnvironment> ctx,
534       TableName tableName) throws IOException {
535   }
536 
537   @Override
538   public void postTableFlush(ObserverContext<MasterCoprocessorEnvironment> ctx,
539       TableName tableName) throws IOException {
540   }
541 
542   @Override
543   public void preSetUserQuota(final ObserverContext<MasterCoprocessorEnvironment> ctx,
544       final String userName, final Quotas quotas) throws IOException {
545   }
546 
547   @Override
548   public void postSetUserQuota(final ObserverContext<MasterCoprocessorEnvironment> ctx,
549       final String userName, final Quotas quotas) throws IOException {
550   }
551 
552   @Override
553   public void preSetUserQuota(final ObserverContext<MasterCoprocessorEnvironment> ctx,
554       final String userName, final TableName tableName, final Quotas quotas) throws IOException {
555   }
556 
557   @Override
558   public void postSetUserQuota(final ObserverContext<MasterCoprocessorEnvironment> ctx,
559       final String userName, final TableName tableName, final Quotas quotas) throws IOException {
560   }
561 
562   @Override
563   public void preSetUserQuota(final ObserverContext<MasterCoprocessorEnvironment> ctx,
564       final String userName, final String namespace, final Quotas quotas) throws IOException {
565   }
566 
567   @Override
568   public void postSetUserQuota(final ObserverContext<MasterCoprocessorEnvironment> ctx,
569       final String userName, final String namespace, final Quotas quotas) throws IOException {
570   }
571 
572   @Override
573   public void preSetTableQuota(final ObserverContext<MasterCoprocessorEnvironment> ctx,
574       final TableName tableName, final Quotas quotas) throws IOException {
575   }
576 
577   @Override
578   public void postSetTableQuota(final ObserverContext<MasterCoprocessorEnvironment> ctx,
579       final TableName tableName, final Quotas quotas) throws IOException {
580   }
581 
582   @Override
583   public void preSetNamespaceQuota(final ObserverContext<MasterCoprocessorEnvironment> ctx,
584       final String namespace, final Quotas quotas) throws IOException {
585   }
586 
587   @Override
588   public void postSetNamespaceQuota(final ObserverContext<MasterCoprocessorEnvironment> ctx,
589       final String namespace, final Quotas quotas) throws IOException {
590   }
591 }