1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.hadoop.hbase.procedure;
19
20 import java.io.IOException;
21 import java.util.Hashtable;
22
23 import org.apache.hadoop.conf.Configuration;
24 import org.apache.hadoop.hbase.master.MasterServices;
25 import org.apache.hadoop.hbase.master.MetricsMaster;
26 import org.apache.zookeeper.KeeperException;
27
28
29
30
31
32
33 public class MasterProcedureManagerHost extends
34 ProcedureManagerHost<MasterProcedureManager> {
35
36 private Hashtable<String, MasterProcedureManager> procedureMgrMap
37 = new Hashtable<String, MasterProcedureManager>();
38
39 @Override
40 public void loadProcedures(Configuration conf) {
41 loadUserProcedures(conf, MASTER_PROCEDURE_CONF_KEY);
42 for (MasterProcedureManager mpm : getProcedureManagers()) {
43 procedureMgrMap.put(mpm.getProcedureSignature(), mpm);
44 }
45 }
46
47 public void initialize(MasterServices master, final MetricsMaster metricsMaster)
48 throws KeeperException, IOException, UnsupportedOperationException {
49 for (MasterProcedureManager mpm : getProcedureManagers()) {
50 mpm.initialize(master, metricsMaster);
51 }
52 }
53
54 public void stop(String why) {
55 for (MasterProcedureManager mpm : getProcedureManagers()) {
56 mpm.stop(why);
57 }
58 }
59
60 public MasterProcedureManager getProcedureManager(String signature) {
61 return procedureMgrMap.get(signature);
62 }
63 }