HBASE-5873 TimeOut Monitor thread should be started after atleast one region server registers.

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1330551 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
larsh 2012-04-25 20:43:35 +00:00
parent bbd5306d27
commit 0be3011b5f
2 changed files with 6 additions and 2 deletions

View File

@ -214,8 +214,6 @@ public class AssignmentManager extends ZooKeeperListener {
conf.getInt("hbase.master.assignment.timeoutmonitor.period", 10000),
master, serverManager,
conf.getInt("hbase.master.assignment.timeoutmonitor.timeout", 1800000));
Threads.setDaemonThreadRunning(timeoutMonitor.getThread(),
master.getServerName() + ".timeoutMonitor");
this.zkTable = new ZKTable(this.master.getZooKeeper());
this.maximumAssignmentAttempts =
this.master.getConfiguration().getInt("hbase.assignment.maximum.attempts", 10);
@ -224,6 +222,11 @@ public class AssignmentManager extends ZooKeeperListener {
this.masterMetrics = metrics;// can be null only with tests.
}
void startTimeOutMonitor() {
Threads.setDaemonThreadRunning(timeoutMonitor.getThread(), master.getServerName()
+ ".timeoutMonitor");
}
/**
* Compute the average load across all region servers.
* Currently, this uses a very naive computation - just uses the number of

View File

@ -567,6 +567,7 @@ Server {
}
}
this.assignmentManager.startTimeOutMonitor();
Set<ServerName> onlineServers = new HashSet<ServerName>(serverManager
.getOnlineServers().keySet());
// TODO: Should do this in background rather than block master startup