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