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