HBASE-15327 Canary will always invoke admin.balancer() in each sniffing period when writeSniffing is enabled (Jianwei Cui)

This commit is contained in:
tedyu 2016-03-30 09:00:04 -07:00
parent 1e44dd82eb
commit e339bec3f1
1 changed files with 7 additions and 1 deletions

View File

@ -46,6 +46,7 @@ import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.AuthUtil;
import org.apache.hadoop.hbase.ChoreService;
import org.apache.hadoop.hbase.ClusterStatus;
import org.apache.hadoop.hbase.DoNotRetryIOException;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.HColumnDescriptor;
@ -924,7 +925,12 @@ public final class Canary implements Tool {
admin.enableTable(writeTableName);
}
int numberOfServers = admin.getClusterStatus().getServers().size();
ClusterStatus status = admin.getClusterStatus();
int numberOfServers = status.getServersSize();
if (status.getServers().contains(status.getMaster())) {
numberOfServers -= 1;
}
List<HRegionLocation> locations;
RegionLocator locator = connection.getRegionLocator(writeTableName);
try {