1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.hadoop.hbase.master.balancer;
20
21 import org.apache.hadoop.hbase.classification.InterfaceAudience;
22 import org.apache.hadoop.hbase.Chore;
23 import org.apache.hadoop.hbase.master.HMaster;
24 import org.apache.hadoop.hbase.master.LoadBalancer;
25
26
27
28
29 @InterfaceAudience.Private
30 public class ClusterStatusChore extends Chore {
31
32 private final HMaster master;
33 private final LoadBalancer balancer;
34
35 public ClusterStatusChore(HMaster master, LoadBalancer balancer) {
36 super(master.getServerName() + "-ClusterStatusChore",
37 master.getConfiguration().getInt("hbase.balancer.statusPeriod", 60000),
38 master);
39 this.master = master;
40 this.balancer = balancer;
41 }
42
43 @Override
44 protected void chore() {
45 balancer.setClusterStatus(master.getClusterStatus());
46 }
47 }