HBASE-19194 TestRSGroupsBase has some always false checks
This commit is contained in:
parent
dc1310f487
commit
c5e60d16b4
|
@ -414,7 +414,7 @@ public abstract class TestRSGroupsBase {
|
|||
getTableServerRegionMap().get(tableName);
|
||||
final ServerName first = assignMap.entrySet().iterator().next().getKey();
|
||||
for(HRegionInfo region: admin.getTableRegions(tableName)) {
|
||||
if(!assignMap.get(first).contains(region)) {
|
||||
if(!assignMap.get(first).contains(region.getRegionNameAsString())) {
|
||||
admin.move(region.getEncodedNameAsBytes(), Bytes.toBytes(first.getServerName()));
|
||||
}
|
||||
}
|
||||
|
@ -516,7 +516,11 @@ public abstract class TestRSGroupsBase {
|
|||
});
|
||||
|
||||
//verify that targetServer didn't open it
|
||||
assertFalse(ProtobufUtil.getOnlineRegions(targetRS).contains(targetRegion));
|
||||
for (HRegionInfo region: ProtobufUtil.getOnlineRegions(targetRS)) {
|
||||
if (targetRegion.equals(region.getRegionNameAsString())) {
|
||||
fail("Target server opened region");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -181,6 +181,7 @@ import org.mortbay.jetty.servlet.Context;
|
|||
import org.mortbay.jetty.servlet.ServletHolder;
|
||||
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.google.protobuf.Descriptors;
|
||||
import com.google.protobuf.Service;
|
||||
|
@ -1666,7 +1667,12 @@ public class HMaster extends HRegionServer implements MasterServices, Server {
|
|||
return;
|
||||
}
|
||||
} else {
|
||||
dest = ServerName.valueOf(Bytes.toString(destServerName));
|
||||
ServerName candidate = ServerName.valueOf(Bytes.toString(destServerName));
|
||||
dest = balancer.randomAssignment(hri, Lists.newArrayList(candidate));
|
||||
if (dest == null) {
|
||||
LOG.debug("Unable to determine a plan to assign " + hri);
|
||||
return;
|
||||
}
|
||||
if (dest.equals(serverName) && balancer instanceof BaseLoadBalancer
|
||||
&& !((BaseLoadBalancer)balancer).shouldBeOnMaster(hri)) {
|
||||
// To avoid unnecessary region moving later by balancer. Don't put user
|
||||
|
|
Loading…
Reference in New Issue