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.Coprocessor;
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  /**
40   * Defines coprocessor hooks for interacting with operations on the
41   * {@link org.apache.hadoop.hbase.master.HMaster} process.
42   */
43  @InterfaceAudience.LimitedPrivate(HBaseInterfaceAudience.COPROC)
44  @InterfaceStability.Evolving
45  public interface MasterObserver extends Coprocessor {
46  
47    /**
48     * Called before a new table is created by
49     * {@link org.apache.hadoop.hbase.master.HMaster}.  Called as part of create
50     * table RPC call.
51     * It can't bypass the default action, e.g., ctx.bypass() won't have effect.
52     * @param ctx the environment to interact with the framework and master
53     * @param desc the HTableDescriptor for the table
54     * @param regions the initial regions created for the table
55     * @throws IOException
56     */
57    void preCreateTable(final ObserverContext<MasterCoprocessorEnvironment> ctx,
58        HTableDescriptor desc, HRegionInfo[] regions) throws IOException;
59  
60    /**
61     * Called after the createTable operation has been requested.  Called as part
62     * of create table RPC call.
63     * @param ctx the environment to interact with the framework and master
64     * @param desc the HTableDescriptor for the table
65     * @param regions the initial regions created for the table
66     * @throws IOException
67     */
68    void postCreateTable(final ObserverContext<MasterCoprocessorEnvironment> ctx,
69        HTableDescriptor desc, HRegionInfo[] regions) throws IOException;
70    /**
71     * Called before a new table is created by
72     * {@link org.apache.hadoop.hbase.master.HMaster}.  Called as part of create
73     * table handler and it is async to the create RPC call.
74     * It can't bypass the default action, e.g., ctx.bypass() won't have effect.
75     * @param ctx the environment to interact with the framework and master
76     * @param desc the HTableDescriptor for the table
77     * @param regions the initial regions created for the table
78     * @throws IOException
79     */
80    void preCreateTableHandler(final ObserverContext<MasterCoprocessorEnvironment>
81        ctx, HTableDescriptor desc, HRegionInfo[] regions) throws IOException;
82  
83    /**
84     * Called after the createTable operation has been requested.  Called as part
85     * of create table RPC call.  Called as part of create table handler and
86     * it is async to the create RPC call.
87     * @param ctx the environment to interact with the framework and master
88     * @param desc the HTableDescriptor for the table
89     * @param regions the initial regions created for the table
90     * @throws IOException
91     */
92    void postCreateTableHandler(final ObserverContext<MasterCoprocessorEnvironment>
93    ctx, HTableDescriptor desc, HRegionInfo[] regions) throws IOException;
94  
95    /**
96     * Called before {@link org.apache.hadoop.hbase.master.HMaster} deletes a
97     * table.  Called as part of delete table RPC call.
98     * It can't bypass the default action, e.g., ctx.bypass() won't have effect.
99     * @param ctx the environment to interact with the framework and master
100    * @param tableName the name of the table
101    */
102   void preDeleteTable(final ObserverContext<MasterCoprocessorEnvironment> ctx,
103       TableName tableName) throws IOException;
104 
105   /**
106    * Called after the deleteTable operation has been requested.  Called as part
107    * of delete table RPC call.
108    * @param ctx the environment to interact with the framework and master
109    * @param tableName the name of the table
110    */
111   void postDeleteTable(final ObserverContext<MasterCoprocessorEnvironment> ctx,
112       TableName tableName) throws IOException;
113 
114   /**
115    * Called before {@link org.apache.hadoop.hbase.master.HMaster} deletes a
116    * table.  Called as part of delete table handler and
117    * it is async to the delete RPC call.
118    * It can't bypass the default action, e.g., ctx.bypass() won't have effect.
119    * @param ctx the environment to interact with the framework and master
120    * @param tableName the name of the table
121    */
122   void preDeleteTableHandler(
123       final ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName)
124       throws IOException;
125 
126   /**
127    * Called after {@link org.apache.hadoop.hbase.master.HMaster} deletes a
128    * table.  Called as part of delete table handler and it is async to the
129    * delete RPC call.
130    * It can't bypass the default action, e.g., ctx.bypass() won't have effect.
131    * @param ctx the environment to interact with the framework and master
132    * @param tableName the name of the table
133    */
134   void postDeleteTableHandler(
135       final ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName)
136       throws IOException;
137 
138 
139   /**
140    * Called before {@link org.apache.hadoop.hbase.master.HMaster} truncates a
141    * table.  Called as part of truncate table RPC call.
142    * It can't bypass the default action, e.g., ctx.bypass() won't have effect.
143    * @param ctx the environment to interact with the framework and master
144    * @param tableName the name of the table
145    */
146   void preTruncateTable(final ObserverContext<MasterCoprocessorEnvironment> ctx,
147       TableName tableName) throws IOException;
148 
149   /**
150    * Called after the truncateTable operation has been requested.  Called as part
151    * of truncate table RPC call.
152    * The truncate is synchronous, so this method will be called when the
153    * truncate operation is terminated.
154    * @param ctx the environment to interact with the framework and master
155    * @param tableName the name of the table
156    */
157   void postTruncateTable(final ObserverContext<MasterCoprocessorEnvironment> ctx,
158       TableName tableName) throws IOException;
159 
160   /**
161    * Called before {@link org.apache.hadoop.hbase.master.HMaster} truncates a
162    * table.  Called as part of truncate table handler and it is sync
163    * to the truncate RPC call.
164    * It can't bypass the default action, e.g., ctx.bypass() won't have effect.
165    * @param ctx the environment to interact with the framework and master
166    * @param tableName the name of the table
167    */
168   void preTruncateTableHandler(
169       final ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName)
170       throws IOException;
171 
172   /**
173    * Called after {@link org.apache.hadoop.hbase.master.HMaster} truncates a
174    * table.  Called as part of truncate table handler and it is sync to the
175    * truncate RPC call.
176    * It can't bypass the default action, e.g., ctx.bypass() won't have effect.
177    * @param ctx the environment to interact with the framework and master
178    * @param tableName the name of the table
179    */
180   void postTruncateTableHandler(
181       final ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName)
182       throws IOException;
183 
184   /**
185    * Called prior to modifying a table's properties.  Called as part of modify
186    * table RPC call.
187    * It can't bypass the default action, e.g., ctx.bypass() won't have effect.
188    * @param ctx the environment to interact with the framework and master
189    * @param tableName the name of the table
190    * @param htd the HTableDescriptor
191    */
192   void preModifyTable(final ObserverContext<MasterCoprocessorEnvironment> ctx,
193       final TableName tableName, HTableDescriptor htd) throws IOException;
194 
195   /**
196    * Called after the modifyTable operation has been requested.  Called as part
197    * of modify table RPC call.
198    * @param ctx the environment to interact with the framework and master
199    * @param tableName the name of the table
200    * @param htd the HTableDescriptor
201    */
202   void postModifyTable(final ObserverContext<MasterCoprocessorEnvironment> ctx,
203       final TableName tableName, HTableDescriptor htd) throws IOException;
204 
205   /**
206    * Called prior to modifying a table's properties.  Called as part of modify
207    * table handler and it is async to the modify table RPC call.
208    * It can't bypass the default action, e.g., ctx.bypass() won't have effect.
209    * @param ctx the environment to interact with the framework and master
210    * @param tableName the name of the table
211    * @param htd the HTableDescriptor
212    */
213   void preModifyTableHandler(
214       final ObserverContext<MasterCoprocessorEnvironment> ctx,
215       final TableName tableName, HTableDescriptor htd) throws IOException;
216 
217   /**
218    * Called after to modifying a table's properties.  Called as part of modify
219    * table handler and it is async to the modify table RPC call.
220    * It can't bypass the default action, e.g., ctx.bypass() won't have effect.
221    * @param ctx the environment to interact with the framework and master
222    * @param tableName the name of the table
223    * @param htd the HTableDescriptor
224    */
225   void postModifyTableHandler(
226       final ObserverContext<MasterCoprocessorEnvironment> ctx,
227       final TableName tableName, HTableDescriptor htd) throws IOException;
228 
229   /**
230    * Called prior to adding a new column family to the table.  Called as part of
231    * add column RPC call.
232    * @param ctx the environment to interact with the framework and master
233    * @param tableName the name of the table
234    * @param columnFamily the HColumnDescriptor
235    * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
236    *             (<a href="https://issues.apache.org/jira/browse/HBASE-13645">HBASE-13645</a>).
237    *             Use {@link #preAddColumnFamily(ObserverContext, TableName, HColumnDescriptor)}.
238    */
239   @Deprecated
240   void preAddColumn(final ObserverContext<MasterCoprocessorEnvironment> ctx,
241       TableName tableName, HColumnDescriptor columnFamily) throws IOException;
242 
243   /**
244    * Called prior to adding a new column family to the table.  Called as part of
245    * add column RPC call.
246    *
247    * Implementation note: This replaces the deprecated
248    * {@link #preAddColumn(ObserverContext, TableName, HColumnDescriptor)} method.
249    * Make sure to implement only one of the two as both are called.
250    *
251    * @param ctx the environment to interact with the framework and master
252    * @param tableName the name of the table
253    * @param columnFamily the HColumnDescriptor
254    */
255   void preAddColumnFamily(final ObserverContext<MasterCoprocessorEnvironment> ctx,
256       TableName tableName, HColumnDescriptor columnFamily) throws IOException;
257 
258   /**
259    * Called after the new column family has been created.  Called as part of
260    * add column RPC call.
261    * @param ctx the environment to interact with the framework and master
262    * @param tableName the name of the table
263    * @param columnFamily the HColumnDescriptor
264    * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
265    *             (<a href="https://issues.apache.org/jira/browse/HBASE-13645">HBASE-13645</a>).
266    *             Use {@link #postAddColumnFamily(ObserverContext, TableName, HColumnDescriptor)}.
267    */
268   @Deprecated
269   void postAddColumn(final ObserverContext<MasterCoprocessorEnvironment> ctx,
270       TableName tableName, HColumnDescriptor columnFamily) throws IOException;
271 
272   /**
273    * Called after the new column family has been created.  Called as part of
274    * add column RPC call.
275    *
276    * Implementation note: This replaces the deprecated
277    * {@link #postAddColumn(ObserverContext, TableName, HColumnDescriptor)} method.
278    * Make sure to implement only one of the two as both are called.
279    *
280    * @param ctx the environment to interact with the framework and master
281    * @param tableName the name of the table
282    * @param columnFamily the HColumnDescriptor
283    */
284   void postAddColumnFamily(final ObserverContext<MasterCoprocessorEnvironment> ctx,
285       TableName tableName, HColumnDescriptor columnFamily) throws IOException;
286 
287   /**
288    * Called prior to adding a new column family to the table.  Called as part of
289    * add column handler.
290    * @param ctx the environment to interact with the framework and master
291    * @param tableName the name of the table
292    * @param columnFamily the HColumnDescriptor
293    * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
294    *             (<a href="https://issues.apache.org/jira/browse/HBASE-13645">HBASE-13645</a>). Use
295    *             {@link #preAddColumnFamilyHandler(ObserverContext, TableName, HColumnDescriptor)}.
296    */
297   @Deprecated
298   void preAddColumnHandler(
299       final ObserverContext<MasterCoprocessorEnvironment> ctx,
300       TableName tableName, HColumnDescriptor columnFamily) throws IOException;
301 
302   /**
303    * Called prior to adding a new column family to the table.  Called as part of
304    * add column handler.
305    *
306    * Implementation note: This replaces the deprecated
307    * {@link #preAddColumnHandler(ObserverContext, TableName, HColumnDescriptor)} method.
308    * Make sure to implement only one of the two as both are called.
309    *
310    * @param ctx the environment to interact with the framework and master
311    * @param tableName the name of the table
312    * @param columnFamily the HColumnDescriptor
313    */
314   void preAddColumnFamilyHandler(
315       final ObserverContext<MasterCoprocessorEnvironment> ctx,
316       TableName tableName, HColumnDescriptor columnFamily) throws IOException;
317 
318 
319   /**
320    * Called after the new column family has been created.  Called as part of
321    * add column handler.
322    * @param ctx the environment to interact with the framework and master
323    * @param tableName the name of the table
324    * @param columnFamily the HColumnDescriptor
325    * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
326    *             (<a href="https://issues.apache.org/jira/browse/HBASE-13645">HBASE-13645</a>). Use
327    *             {@link #postAddColumnFamilyHandler(ObserverContext, TableName, HColumnDescriptor)}.
328    */
329   @Deprecated
330   void postAddColumnHandler(
331       final ObserverContext<MasterCoprocessorEnvironment> ctx,
332       TableName tableName, HColumnDescriptor columnFamily) throws IOException;
333 
334   /**
335    * Called after the new column family has been created.  Called as part of
336    * add column handler.
337    *
338    * Implementation note: This replaces the deprecated
339    * {@link #postAddColumnHandler(ObserverContext, TableName, HColumnDescriptor)} method.
340    * Make sure to implement only one of the two as both are called.
341    *
342    * @param ctx the environment to interact with the framework and master
343    * @param tableName the name of the table
344    * @param columnFamily the HColumnDescriptor
345    */
346   void postAddColumnFamilyHandler(
347       final ObserverContext<MasterCoprocessorEnvironment> ctx,
348       TableName tableName, HColumnDescriptor columnFamily) throws IOException;
349 
350   /**
351    * Called prior to modifying a column family's attributes.  Called as part of
352    * modify column RPC call.
353    * @param ctx the environment to interact with the framework and master
354    * @param tableName the name of the table
355    * @param columnFamily the HColumnDescriptor
356    * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
357    *             (<a href="https://issues.apache.org/jira/browse/HBASE-13645">HBASE-13645</a>).
358    *             Use {@link #preModifyColumnFamily(ObserverContext, TableName, HColumnDescriptor)}.
359    */
360   @Deprecated
361   void preModifyColumn(final ObserverContext<MasterCoprocessorEnvironment> ctx,
362       TableName tableName, HColumnDescriptor columnFamily) throws IOException;
363 
364   /**
365    * Called prior to modifying a column family's attributes.  Called as part of
366    * modify column RPC call.
367    *
368    * Implementation note: This replaces the deprecated
369    * {@link #preModifyColumn(ObserverContext, TableName, HColumnDescriptor)} method.
370    * Make sure to implement only one of the two as both are called.
371    *
372    * @param ctx the environment to interact with the framework and master
373    * @param tableName the name of the table
374    * @param columnFamily the HColumnDescriptor
375    */
376   void preModifyColumnFamily(final ObserverContext<MasterCoprocessorEnvironment> ctx,
377       TableName tableName, HColumnDescriptor columnFamily) throws IOException;
378 
379   /**
380    * Called after the column family has been updated.  Called as part of modify
381    * column RPC call.
382    * @param ctx the environment to interact with the framework and master
383    * @param tableName the name of the table
384    * @param columnFamily the HColumnDescriptor
385    * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
386    *             (<a href="https://issues.apache.org/jira/browse/HBASE-13645">HBASE-13645</a>).
387    *             Use {@link #postModifyColumnFamily(ObserverContext, TableName, HColumnDescriptor)}.
388    */
389   @Deprecated
390   void postModifyColumn(final ObserverContext<MasterCoprocessorEnvironment> ctx,
391       TableName tableName, HColumnDescriptor columnFamily) throws IOException;
392 
393   /**
394    * Called after the column family has been updated.  Called as part of modify
395    * column RPC call.
396    *
397    * Implementation note: This replaces the deprecated
398    * {@link #postModifyColumn(ObserverContext, TableName, HColumnDescriptor)} method.
399    * Make sure to implement only one of the two as both are called.
400    *
401    * @param ctx the environment to interact with the framework and master
402    * @param tableName the name of the table
403    * @param columnFamily the HColumnDescriptor
404    */
405   void postModifyColumnFamily(final ObserverContext<MasterCoprocessorEnvironment> ctx,
406       TableName tableName, HColumnDescriptor columnFamily) throws IOException;
407 
408   /**
409    * Called prior to modifying a column family's attributes.  Called as part of
410    * modify column handler.
411    * @param ctx the environment to interact with the framework and master
412    * @param tableName the name of the table
413    * @param columnFamily the HColumnDescriptor
414    * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
415    *       (<a href="https://issues.apache.org/jira/browse/HBASE-13645">HBASE-13645</a>).
416    *       Use {@link #preModifyColumnFamilyHandler(ObserverContext, TableName, HColumnDescriptor)}.
417    */
418   @Deprecated
419   void preModifyColumnHandler(
420       final ObserverContext<MasterCoprocessorEnvironment> ctx,
421       TableName tableName, HColumnDescriptor columnFamily) throws IOException;
422 
423   /**
424    * Called prior to modifying a column family's attributes.  Called as part of
425    * modify column handler.
426    *
427    * Implementation note: This replaces the deprecated
428    * {@link #preModifyColumnHandler(ObserverContext, TableName, HColumnDescriptor)} method.
429    * Make sure to implement only one of the two as both are called.
430    *
431    * @param ctx the environment to interact with the framework and master
432    * @param tableName the name of the table
433    * @param columnFamily the HColumnDescriptor
434    */
435   void preModifyColumnFamilyHandler(
436       final ObserverContext<MasterCoprocessorEnvironment> ctx,
437       TableName tableName, HColumnDescriptor columnFamily) throws IOException;
438 
439   /**
440    * Called after the column family has been updated.  Called as part of modify
441    * column handler.
442    * @param ctx the environment to interact with the framework and master
443    * @param tableName the name of the table
444    * @param columnFamily the HColumnDescriptor
445    * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
446    *      (<a href="https://issues.apache.org/jira/browse/HBASE-13645">HBASE-13645</a>).
447    *      Use {@link #postModifyColumnFamilyHandler(ObserverContext, TableName, HColumnDescriptor)}.
448    */
449   @Deprecated
450   void postModifyColumnHandler(
451       final ObserverContext<MasterCoprocessorEnvironment> ctx,
452       TableName tableName, HColumnDescriptor columnFamily) throws IOException;
453 
454   /**
455    * Called after the column family has been updated.  Called as part of modify
456    * column handler.
457    *
458    * Implementation note: This replaces the deprecated
459    * {@link #postModifyColumnHandler(ObserverContext, TableName, HColumnDescriptor)} method.
460    * Make sure to implement only one of the two as both are called.
461    *
462    * @param ctx the environment to interact with the framework and master
463    * @param tableName the name of the table
464    * @param columnFamily the HColumnDescriptor
465    */
466   void postModifyColumnFamilyHandler(
467       final ObserverContext<MasterCoprocessorEnvironment> ctx,
468       TableName tableName, HColumnDescriptor columnFamily) throws IOException;
469 
470   /**
471    * Called prior to deleting the entire column family.  Called as part of
472    * delete column RPC call.
473    * @param ctx the environment to interact with the framework and master
474    * @param tableName the name of the table
475    * @param columnFamily the column family
476    * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
477    *             (<a href="https://issues.apache.org/jira/browse/HBASE-13645">HBASE-13645</a>).
478    *             Use {@link #preDeleteColumnFamily(ObserverContext, TableName, byte[])}.
479    */
480   @Deprecated
481   void preDeleteColumn(final ObserverContext<MasterCoprocessorEnvironment> ctx,
482       final TableName tableName, final byte[] columnFamily) throws IOException;
483 
484   /**
485    * Called prior to deleting the entire column family.  Called as part of
486    * delete column RPC call.
487    *
488    * Implementation note: This replaces the deprecated
489    * {@link #preDeleteColumn(ObserverContext, TableName, byte[])} method.
490    * Make sure to implement only one of the two as both are called.
491    *
492    * @param ctx the environment to interact with the framework and master
493    * @param tableName the name of the table
494    * @param columnFamily the column
495    */
496   void preDeleteColumnFamily(final ObserverContext<MasterCoprocessorEnvironment> ctx,
497       final TableName tableName, final byte[] columnFamily) throws IOException;
498 
499   /**
500    * Called after the column family has been deleted.  Called as part of delete
501    * column RPC call.
502    * @param ctx the environment to interact with the framework and master
503    * @param tableName the name of the table
504    * @param columnFamily the column family
505    * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
506    *             (<a href="https://issues.apache.org/jira/browse/HBASE-13645">HBASE-13645</a>).
507    *             Use {@link #postDeleteColumnFamily(ObserverContext, TableName, byte[])}.
508    */
509   @Deprecated
510   void postDeleteColumn(final ObserverContext<MasterCoprocessorEnvironment> ctx,
511       final TableName tableName, final byte[] columnFamily) throws IOException;
512 
513   /**
514    * Called after the column family has been deleted.  Called as part of delete
515    * column RPC call.
516    *
517    * Implementation note: This replaces the deprecated
518    * {@link #postDeleteColumn(ObserverContext, TableName, byte[])} method.
519    * Make sure to implement only one of the two as both are called.
520    *
521    * @param ctx the environment to interact with the framework and master
522    * @param tableName the name of the table
523    * @param columnFamily the column family
524    */
525   void postDeleteColumnFamily(final ObserverContext<MasterCoprocessorEnvironment> ctx,
526       final TableName tableName, final byte[] columnFamily) throws IOException;
527 
528   /**
529    * Called prior to deleting the entire column family.  Called as part of
530    * delete column handler.
531    * @param ctx the environment to interact with the framework and master
532    * @param tableName the name of the table
533    * @param columnFamily the column family
534    * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
535    *             (<a href="https://issues.apache.org/jira/browse/HBASE-13645">HBASE-13645</a>).
536    *             Use {@link #preDeleteColumnFamilyHandler(ObserverContext, TableName, byte[])}.
537    */
538   @Deprecated
539   void preDeleteColumnHandler(
540       final ObserverContext<MasterCoprocessorEnvironment> ctx,
541       final TableName tableName, final byte[] columnFamily) throws IOException;
542 
543   /**
544    * Called prior to deleting the entire column family.  Called as part of
545    * delete column handler.
546    *
547    * Implementation note: This replaces the deprecated
548    * {@link #preDeleteColumnHandler(ObserverContext, TableName, byte[])} method.
549    * Make sure to implement only one of the two as both are called.
550    *
551    * @param ctx the environment to interact with the framework and master
552    * @param tableName the name of the table
553    * @param columnFamily the column family
554    */
555   void preDeleteColumnFamilyHandler(
556       final ObserverContext<MasterCoprocessorEnvironment> ctx,
557       final TableName tableName, final byte[] columnFamily) throws IOException;
558 
559   /**
560    * Called after the column family has been deleted.  Called as part of
561    * delete column handler.
562    * @param ctx the environment to interact with the framework and master
563    * @param tableName the name of the table
564    * @param columnFamily the column family
565    * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
566    *             (<a href="https://issues.apache.org/jira/browse/HBASE-13645">HBASE-13645</a>).
567    *             Use {@link #postDeleteColumnFamilyHandler(ObserverContext, TableName, byte[])}.
568    */
569   @Deprecated
570   void postDeleteColumnHandler(
571       final ObserverContext<MasterCoprocessorEnvironment> ctx,
572       final TableName tableName, final byte[] columnFamily) throws IOException;
573 
574   /**
575    * Called after the column family has been deleted.  Called as part of
576    * delete column handler.
577    *
578    * Implementation note: This replaces the deprecated
579    * {@link #postDeleteColumnHandler(ObserverContext, TableName, byte[])} method.
580    * Make sure to implement only one of the two as both are called.
581    *
582    * @param ctx the environment to interact with the framework and master
583    * @param tableName the name of the table
584    * @param columnFamily the column family
585    */
586   void postDeleteColumnFamilyHandler(
587       final ObserverContext<MasterCoprocessorEnvironment> ctx,
588       final TableName tableName, final byte[] columnFamily) throws IOException;
589 
590   /**
591    * Called prior to enabling a table.  Called as part of enable table RPC call.
592    * It can't bypass the default action, e.g., ctx.bypass() won't have effect.
593    * @param ctx the environment to interact with the framework and master
594    * @param tableName the name of the table
595    */
596   void preEnableTable(final ObserverContext<MasterCoprocessorEnvironment> ctx,
597       final TableName tableName) throws IOException;
598 
599   /**
600    * Called after the enableTable operation has been requested.  Called as part
601    * of enable table RPC call.
602    * @param ctx the environment to interact with the framework and master
603    * @param tableName the name of the table
604    */
605   void postEnableTable(final ObserverContext<MasterCoprocessorEnvironment> ctx,
606       final TableName tableName) throws IOException;
607 
608   /**
609    * Called prior to enabling a table.  Called as part of enable table handler
610    * and it is async to the enable table RPC call.
611    * It can't bypass the default action, e.g., ctx.bypass() won't have effect.
612    * @param ctx the environment to interact with the framework and master
613    * @param tableName the name of the table
614    */
615   void preEnableTableHandler(
616       final ObserverContext<MasterCoprocessorEnvironment> ctx,
617       final TableName tableName) throws IOException;
618 
619   /**
620    * Called after the enableTable operation has been requested.  Called as part
621    * of enable table handler and it is async to the enable table RPC call.
622    * @param ctx the environment to interact with the framework and master
623    * @param tableName the name of the table
624    */
625   void postEnableTableHandler(
626       final ObserverContext<MasterCoprocessorEnvironment> ctx,
627       final TableName tableName) throws IOException;
628 
629   /**
630    * Called prior to disabling a table.  Called as part of disable table RPC
631    * call.
632    * It can't bypass the default action, e.g., ctx.bypass() won't have effect.
633    * @param ctx the environment to interact with the framework and master
634    * @param tableName the name of the table
635    */
636   void preDisableTable(final ObserverContext<MasterCoprocessorEnvironment> ctx,
637       final TableName tableName) throws IOException;
638 
639   /**
640    * Called after the disableTable operation has been requested.  Called as part
641    * of disable table RPC call.
642    * @param ctx the environment to interact with the framework and master
643    * @param tableName the name of the table
644    */
645   void postDisableTable(final ObserverContext<MasterCoprocessorEnvironment> ctx,
646       final TableName tableName) throws IOException;
647 
648   /**
649    * Called prior to disabling a table.  Called as part of disable table handler
650    * and it is asyn to the disable table RPC call.
651    * It can't bypass the default action, e.g., ctx.bypass() won't have effect.
652    * @param ctx the environment to interact with the framework and master
653    * @param tableName the name of the table
654    */
655   void preDisableTableHandler(
656       final ObserverContext<MasterCoprocessorEnvironment> ctx,
657       final TableName tableName) throws IOException;
658 
659   /**
660    * Called after the disableTable operation has been requested.  Called as part
661    * of disable table handler and it is asyn to the disable table RPC call.
662    * @param ctx the environment to interact with the framework and master
663    * @param tableName the name of the table
664    */
665   void postDisableTableHandler(
666       final ObserverContext<MasterCoprocessorEnvironment> ctx,
667       final TableName tableName) throws IOException;
668 
669   /**
670    * Called prior to moving a given region from one region server to another.
671    * @param ctx the environment to interact with the framework and master
672    * @param region the HRegionInfo
673    * @param srcServer the source ServerName
674    * @param destServer the destination ServerName
675    */
676   void preMove(final ObserverContext<MasterCoprocessorEnvironment> ctx,
677       final HRegionInfo region, final ServerName srcServer,
678       final ServerName destServer)
679     throws IOException;
680 
681   /**
682    * Called after the region move has been requested.
683    * @param ctx the environment to interact with the framework and master
684    * @param region the HRegionInfo
685    * @param srcServer the source ServerName
686    * @param destServer the destination ServerName
687    */
688   void postMove(final ObserverContext<MasterCoprocessorEnvironment> ctx,
689       final HRegionInfo region, final ServerName srcServer,
690       final ServerName destServer)
691     throws IOException;
692 
693   /**
694    * Called prior to assigning a specific region.
695    * @param ctx the environment to interact with the framework and master
696    * @param regionInfo the regionInfo of the region
697    */
698   void preAssign(final ObserverContext<MasterCoprocessorEnvironment> ctx,
699       final HRegionInfo regionInfo) throws IOException;
700 
701   /**
702    * Called after the region assignment has been requested.
703    * @param ctx the environment to interact with the framework and master
704    * @param regionInfo the regionInfo of the region
705    */
706   void postAssign(final ObserverContext<MasterCoprocessorEnvironment> ctx,
707       final HRegionInfo regionInfo) throws IOException;
708 
709   /**
710    * Called prior to unassigning a given region.
711    * @param ctx the environment to interact with the framework and master
712    * @param regionInfo
713    * @param force whether to force unassignment or not
714    */
715   void preUnassign(final ObserverContext<MasterCoprocessorEnvironment> ctx,
716       final HRegionInfo regionInfo, final boolean force) throws IOException;
717 
718   /**
719    * Called after the region unassignment has been requested.
720    * @param ctx the environment to interact with the framework and master
721    * @param regionInfo
722    * @param force whether to force unassignment or not
723    */
724   void postUnassign(final ObserverContext<MasterCoprocessorEnvironment> ctx,
725       final HRegionInfo regionInfo, final boolean force) throws IOException;
726 
727   /**
728    * Called prior to marking a given region as offline. <code>ctx.bypass()</code> will not have any
729    * impact on this hook.
730    * @param ctx the environment to interact with the framework and master
731    * @param regionInfo
732    */
733   void preRegionOffline(final ObserverContext<MasterCoprocessorEnvironment> ctx,
734       final HRegionInfo regionInfo) throws IOException;
735 
736   /**
737    * Called after the region has been marked offline.
738    * @param ctx the environment to interact with the framework and master
739    * @param regionInfo
740    */
741   void postRegionOffline(final ObserverContext<MasterCoprocessorEnvironment> ctx,
742       final HRegionInfo regionInfo) throws IOException;
743 
744   /**
745    * Called prior to requesting rebalancing of the cluster regions, though after
746    * the initial checks for regions in transition and the balance switch flag.
747    * @param ctx the environment to interact with the framework and master
748    */
749   void preBalance(final ObserverContext<MasterCoprocessorEnvironment> ctx)
750       throws IOException;
751 
752   /**
753    * Called after the balancing plan has been submitted.
754    * @param ctx the environment to interact with the framework and master
755    * @param plans the RegionPlans which master has executed. RegionPlan serves as hint
756    * as for the final destination for the underlying region but may not represent the
757    * final state of assignment
758    */
759   void postBalance(final ObserverContext<MasterCoprocessorEnvironment> ctx, List<RegionPlan> plans)
760       throws IOException;
761 
762   /**
763    * Called prior to modifying the flag used to enable/disable region balancing.
764    * @param ctx the coprocessor instance's environment
765    * @param newValue the new flag value submitted in the call
766    */
767   boolean preBalanceSwitch(final ObserverContext<MasterCoprocessorEnvironment> ctx,
768       final boolean newValue) throws IOException;
769 
770   /**
771    * Called after the flag to enable/disable balancing has changed.
772    * @param ctx the coprocessor instance's environment
773    * @param oldValue the previously set balanceSwitch value
774    * @param newValue the newly set balanceSwitch value
775    */
776   void postBalanceSwitch(final ObserverContext<MasterCoprocessorEnvironment> ctx,
777       final boolean oldValue, final boolean newValue) throws IOException;
778 
779   /**
780    * Called prior to shutting down the full HBase cluster, including this
781    * {@link org.apache.hadoop.hbase.master.HMaster} process.
782    */
783   void preShutdown(final ObserverContext<MasterCoprocessorEnvironment> ctx)
784       throws IOException;
785 
786 
787   /**
788    * Called immediately prior to stopping this
789    * {@link org.apache.hadoop.hbase.master.HMaster} process.
790    */
791   void preStopMaster(final ObserverContext<MasterCoprocessorEnvironment> ctx)
792       throws IOException;
793 
794   /**
795    * Called immediately after an active master instance has completed
796    * initialization.  Will not be called on standby master instances unless
797    * they take over the active role.
798    */
799   void postStartMaster(final ObserverContext<MasterCoprocessorEnvironment> ctx)
800       throws IOException;
801 
802   /**
803    * Call before the master initialization is set to true.
804    * {@link org.apache.hadoop.hbase.master.HMaster} process.
805    */
806   void preMasterInitialization(final ObserverContext<MasterCoprocessorEnvironment> ctx)
807       throws IOException;
808 
809   /**
810    * Called before a new snapshot is taken.
811    * Called as part of snapshot RPC call.
812    * It can't bypass the default action, e.g., ctx.bypass() won't have effect.
813    * @param ctx the environment to interact with the framework and master
814    * @param snapshot the SnapshotDescriptor for the snapshot
815    * @param hTableDescriptor the hTableDescriptor of the table to snapshot
816    * @throws IOException
817    */
818   void preSnapshot(final ObserverContext<MasterCoprocessorEnvironment> ctx,
819       final SnapshotDescription snapshot, final HTableDescriptor hTableDescriptor)
820       throws IOException;
821 
822   /**
823    * Called after the snapshot operation has been requested.
824    * Called as part of snapshot RPC call.
825    * @param ctx the environment to interact with the framework and master
826    * @param snapshot the SnapshotDescriptor for the snapshot
827    * @param hTableDescriptor the hTableDescriptor of the table to snapshot
828    * @throws IOException
829    */
830   void postSnapshot(final ObserverContext<MasterCoprocessorEnvironment> ctx,
831       final SnapshotDescription snapshot, final HTableDescriptor hTableDescriptor)
832       throws IOException;
833 
834   /**
835    * Called before listSnapshots request has been processed.
836    * It can't bypass the default action, e.g., ctx.bypass() won't have effect.
837    * @param ctx the environment to interact with the framework and master
838    * @param snapshot the SnapshotDescriptor of the snapshot to list
839    * @throws IOException
840    */
841   void preListSnapshot(final ObserverContext<MasterCoprocessorEnvironment> ctx,
842       final SnapshotDescription snapshot) throws IOException;
843 
844   /**
845    * Called after listSnapshots request has been processed.
846    * It can't bypass the default action, e.g., ctx.bypass() won't have effect.
847    * @param ctx the environment to interact with the framework and master
848    * @param snapshot the SnapshotDescriptor of the snapshot to list
849    * @throws IOException
850    */
851   void postListSnapshot(final ObserverContext<MasterCoprocessorEnvironment> ctx,
852       final SnapshotDescription snapshot) throws IOException;
853 
854   /**
855    * Called before a snapshot is cloned.
856    * Called as part of restoreSnapshot RPC call.
857    * It can't bypass the default action, e.g., ctx.bypass() won't have effect.
858    * @param ctx the environment to interact with the framework and master
859    * @param snapshot the SnapshotDescriptor for the snapshot
860    * @param hTableDescriptor the hTableDescriptor of the table to create
861    * @throws IOException
862    */
863   void preCloneSnapshot(final ObserverContext<MasterCoprocessorEnvironment> ctx,
864       final SnapshotDescription snapshot, final HTableDescriptor hTableDescriptor)
865       throws IOException;
866 
867   /**
868    * Called after a snapshot clone operation has been requested.
869    * Called as part of restoreSnapshot RPC call.
870    * @param ctx the environment to interact with the framework and master
871    * @param snapshot the SnapshotDescriptor for the snapshot
872    * @param hTableDescriptor the hTableDescriptor of the table to create
873    * @throws IOException
874    */
875   void postCloneSnapshot(final ObserverContext<MasterCoprocessorEnvironment> ctx,
876       final SnapshotDescription snapshot, final HTableDescriptor hTableDescriptor)
877       throws IOException;
878 
879   /**
880    * Called before a snapshot is restored.
881    * Called as part of restoreSnapshot RPC call.
882    * It can't bypass the default action, e.g., ctx.bypass() won't have effect.
883    * @param ctx the environment to interact with the framework and master
884    * @param snapshot the SnapshotDescriptor for the snapshot
885    * @param hTableDescriptor the hTableDescriptor of the table to restore
886    * @throws IOException
887    */
888   void preRestoreSnapshot(final ObserverContext<MasterCoprocessorEnvironment> ctx,
889       final SnapshotDescription snapshot, final HTableDescriptor hTableDescriptor)
890       throws IOException;
891 
892   /**
893    * Called after a snapshot restore operation has been requested.
894    * Called as part of restoreSnapshot RPC call.
895    * @param ctx the environment to interact with the framework and master
896    * @param snapshot the SnapshotDescriptor for the snapshot
897    * @param hTableDescriptor the hTableDescriptor of the table to restore
898    * @throws IOException
899    */
900   void postRestoreSnapshot(final ObserverContext<MasterCoprocessorEnvironment> ctx,
901       final SnapshotDescription snapshot, final HTableDescriptor hTableDescriptor)
902       throws IOException;
903 
904   /**
905    * Called before a snapshot is deleted.
906    * Called as part of deleteSnapshot RPC call.
907    * It can't bypass the default action, e.g., ctx.bypass() won't have effect.
908    * @param ctx the environment to interact with the framework and master
909    * @param snapshot the SnapshotDescriptor of the snapshot to delete
910    * @throws IOException
911    */
912   void preDeleteSnapshot(final ObserverContext<MasterCoprocessorEnvironment> ctx,
913       final SnapshotDescription snapshot) throws IOException;
914 
915   /**
916    * Called after the delete snapshot operation has been requested.
917    * Called as part of deleteSnapshot RPC call.
918    * @param ctx the environment to interact with the framework and master
919    * @param snapshot the SnapshotDescriptor of the snapshot to delete
920    * @throws IOException
921    */
922   void postDeleteSnapshot(final ObserverContext<MasterCoprocessorEnvironment> ctx,
923       final SnapshotDescription snapshot) throws IOException;
924 
925   /**
926    * Called before a getTableDescriptors request has been processed.
927    * @param ctx the environment to interact with the framework and master
928    * @param tableNamesList the list of table names, or null if querying for all
929    * @param descriptors an empty list, can be filled with what to return if bypassing
930    * @param regex regular expression used for filtering the table names
931    * @throws IOException
932    */
933   void preGetTableDescriptors(ObserverContext<MasterCoprocessorEnvironment> ctx,
934       List<TableName> tableNamesList, List<HTableDescriptor> descriptors,
935       String regex) throws IOException;
936 
937   /**
938    * Called after a getTableDescriptors request has been processed.
939    * @param ctx the environment to interact with the framework and master
940    * @param tableNamesList the list of table names, or null if querying for all
941    * @param descriptors the list of descriptors about to be returned
942    * @param regex regular expression used for filtering the table names
943    * @throws IOException
944    */
945   void postGetTableDescriptors(ObserverContext<MasterCoprocessorEnvironment> ctx,
946       List<TableName> tableNamesList, List<HTableDescriptor> descriptors,
947       String regex) throws IOException;
948 
949   /**
950    * Called before a getTableNames request has been processed.
951    * @param ctx the environment to interact with the framework and master
952    * @param descriptors an empty list, can be filled with what to return if bypassing
953    * @param regex regular expression used for filtering the table names
954    * @throws IOException
955    */
956   void preGetTableNames(ObserverContext<MasterCoprocessorEnvironment> ctx,
957       List<HTableDescriptor> descriptors, String regex) throws IOException;
958 
959   /**
960    * Called after a getTableNames request has been processed.
961    * @param ctx the environment to interact with the framework and master
962    * @param descriptors the list of descriptors about to be returned
963    * @param regex regular expression used for filtering the table names
964    * @throws IOException
965    */
966   void postGetTableNames(ObserverContext<MasterCoprocessorEnvironment> ctx,
967       List<HTableDescriptor> descriptors, String regex) throws IOException;
968 
969 
970 
971   /**
972    * Called before a new namespace is created by
973    * {@link org.apache.hadoop.hbase.master.HMaster}.
974    * It can't bypass the default action, e.g., ctx.bypass() won't have effect.
975    * @param ctx the environment to interact with the framework and master
976    * @param ns the NamespaceDescriptor for the table
977    * @throws IOException
978    */
979   void preCreateNamespace(final ObserverContext<MasterCoprocessorEnvironment> ctx,
980       NamespaceDescriptor ns) throws IOException;
981   /**
982    * Called after the createNamespace operation has been requested.
983    * @param ctx the environment to interact with the framework and master
984    * @param ns the NamespaceDescriptor for the table
985    * @throws IOException
986    */
987   void postCreateNamespace(final ObserverContext<MasterCoprocessorEnvironment> ctx,
988        NamespaceDescriptor ns) throws IOException;
989 
990   /**
991    * Called before {@link org.apache.hadoop.hbase.master.HMaster} deletes a
992    * namespace
993    * It can't bypass the default action, e.g., ctx.bypass() won't have effect.
994    * @param ctx the environment to interact with the framework and master
995    * @param namespace the name of the namespace
996    */
997   void preDeleteNamespace(final ObserverContext<MasterCoprocessorEnvironment> ctx,
998       String namespace) throws IOException;
999 
1000   /**
1001    * Called after the deleteNamespace operation has been requested.
1002    * @param ctx the environment to interact with the framework and master
1003    * @param namespace the name of the namespace
1004    */
1005   void postDeleteNamespace(final ObserverContext<MasterCoprocessorEnvironment> ctx,
1006       String namespace) throws IOException;
1007 
1008   /**
1009    * Called prior to modifying a namespace's properties.
1010    * It can't bypass the default action, e.g., ctx.bypass() won't have effect.
1011    * @param ctx the environment to interact with the framework and master
1012    * @param ns the NamespaceDescriptor
1013    */
1014   void preModifyNamespace(final ObserverContext<MasterCoprocessorEnvironment> ctx,
1015       NamespaceDescriptor ns) throws IOException;
1016 
1017   /**
1018    * Called after the modifyNamespace operation has been requested.
1019    * @param ctx the environment to interact with the framework and master
1020    * @param ns the NamespaceDescriptor
1021    */
1022   void postModifyNamespace(final ObserverContext<MasterCoprocessorEnvironment> ctx,
1023       NamespaceDescriptor ns) throws IOException;
1024 
1025   /**
1026    * Called before a getNamespaceDescriptor request has been processed.
1027    * @param ctx the environment to interact with the framework and master
1028    * @param namespace the name of the namespace
1029    * @throws IOException
1030    */
1031   void preGetNamespaceDescriptor(ObserverContext<MasterCoprocessorEnvironment> ctx,
1032       String namespace) throws IOException;
1033 
1034   /**
1035    * Called after a getNamespaceDescriptor request has been processed.
1036    * @param ctx the environment to interact with the framework and master
1037    * @param ns the NamespaceDescriptor
1038    * @throws IOException
1039    */
1040   void postGetNamespaceDescriptor(ObserverContext<MasterCoprocessorEnvironment> ctx,
1041       NamespaceDescriptor ns) throws IOException;
1042 
1043   /**
1044    * Called before a listNamespaceDescriptors request has been processed.
1045    * @param ctx the environment to interact with the framework and master
1046    * @param descriptors an empty list, can be filled with what to return if bypassing
1047    * @throws IOException
1048    */
1049   void preListNamespaceDescriptors(ObserverContext<MasterCoprocessorEnvironment> ctx,
1050       List<NamespaceDescriptor> descriptors) throws IOException;
1051 
1052   /**
1053    * Called after a listNamespaceDescriptors request has been processed.
1054    * @param ctx the environment to interact with the framework and master
1055    * @param descriptors the list of descriptors about to be returned
1056    * @throws IOException
1057    */
1058   void postListNamespaceDescriptors(ObserverContext<MasterCoprocessorEnvironment> ctx,
1059       List<NamespaceDescriptor> descriptors) throws IOException;
1060 
1061 
1062   /**
1063    * Called before the table memstore is flushed to disk.
1064    * @param ctx the environment to interact with the framework and master
1065    * @param tableName the name of the table
1066    * @throws IOException
1067    */
1068   void preTableFlush(final ObserverContext<MasterCoprocessorEnvironment> ctx,
1069       final TableName tableName) throws IOException;
1070 
1071   /**
1072    * Called after the table memstore is flushed to disk.
1073    * @param ctx the environment to interact with the framework and master
1074    * @param tableName the name of the table
1075    * @throws IOException
1076    */
1077   void postTableFlush(final ObserverContext<MasterCoprocessorEnvironment> ctx,
1078       final TableName tableName) throws IOException;
1079 
1080   /**
1081    * Called before the quota for the user is stored.
1082    * @param ctx the environment to interact with the framework and master
1083    * @param userName the name of user
1084    * @param quotas the quota settings
1085    * @throws IOException
1086    */
1087   void preSetUserQuota(final ObserverContext<MasterCoprocessorEnvironment> ctx,
1088       final String userName, final Quotas quotas) throws IOException;
1089 
1090   /**
1091    * Called after the quota for the user is stored.
1092    * @param ctx the environment to interact with the framework and master
1093    * @param userName the name of user
1094    * @param quotas the quota settings
1095    * @throws IOException
1096    */
1097   void postSetUserQuota(final ObserverContext<MasterCoprocessorEnvironment> ctx,
1098       final String userName, final Quotas quotas) throws IOException;
1099 
1100   /**
1101    * Called before the quota for the user on the specified table is stored.
1102    * @param ctx the environment to interact with the framework and master
1103    * @param userName the name of user
1104    * @param tableName the name of the table
1105    * @param quotas the quota settings
1106    * @throws IOException
1107    */
1108   void preSetUserQuota(final ObserverContext<MasterCoprocessorEnvironment> ctx,
1109       final String userName, final TableName tableName, final Quotas quotas) throws IOException;
1110 
1111   /**
1112    * Called after the quota for the user on the specified table is stored.
1113    * @param ctx the environment to interact with the framework and master
1114    * @param userName the name of user
1115    * @param tableName the name of the table
1116    * @param quotas the quota settings
1117    * @throws IOException
1118    */
1119   void postSetUserQuota(final ObserverContext<MasterCoprocessorEnvironment> ctx,
1120       final String userName, final TableName tableName, final Quotas quotas) throws IOException;
1121 
1122   /**
1123    * Called before the quota for the user on the specified namespace is stored.
1124    * @param ctx the environment to interact with the framework and master
1125    * @param userName the name of user
1126    * @param namespace the name of the namespace
1127    * @param quotas the quota settings
1128    * @throws IOException
1129    */
1130   void preSetUserQuota(final ObserverContext<MasterCoprocessorEnvironment> ctx,
1131       final String userName, final String namespace, final Quotas quotas) throws IOException;
1132 
1133   /**
1134    * Called after the quota for the user on the specified namespace is stored.
1135    * @param ctx the environment to interact with the framework and master
1136    * @param userName the name of user
1137    * @param namespace the name of the namespace
1138    * @param quotas the quota settings
1139    * @throws IOException
1140    */
1141   void postSetUserQuota(final ObserverContext<MasterCoprocessorEnvironment> ctx,
1142       final String userName, final String namespace, final Quotas quotas) throws IOException;
1143 
1144   /**
1145    * Called before the quota for the table is stored.
1146    * @param ctx the environment to interact with the framework and master
1147    * @param tableName the name of the table
1148    * @param quotas the quota settings
1149    * @throws IOException
1150    */
1151   void preSetTableQuota(final ObserverContext<MasterCoprocessorEnvironment> ctx,
1152       final TableName tableName, final Quotas quotas) throws IOException;
1153 
1154   /**
1155    * Called after the quota for the table is stored.
1156    * @param ctx the environment to interact with the framework and master
1157    * @param tableName the name of the table
1158    * @param quotas the quota settings
1159    * @throws IOException
1160    */
1161   void postSetTableQuota(final ObserverContext<MasterCoprocessorEnvironment> ctx,
1162       final TableName tableName, final Quotas quotas) throws IOException;
1163 
1164   /**
1165    * Called before the quota for the namespace is stored.
1166    * @param ctx the environment to interact with the framework and master
1167    * @param namespace the name of the namespace
1168    * @param quotas the quota settings
1169    * @throws IOException
1170    */
1171   void preSetNamespaceQuota(final ObserverContext<MasterCoprocessorEnvironment> ctx,
1172       final String namespace, final Quotas quotas) throws IOException;
1173 
1174   /**
1175    * Called after the quota for the namespace is stored.
1176    * @param ctx the environment to interact with the framework and master
1177    * @param namespace the name of the namespace
1178    * @param quotas the quota settings
1179    * @throws IOException
1180    */
1181   void postSetNamespaceQuota(final ObserverContext<MasterCoprocessorEnvironment> ctx,
1182       final String namespace, final Quotas quotas) throws IOException;
1183 }