hbase-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From 陈旭 <chenx...@meituan.com>
Subject HBASE-6721 - RegionServer Group based Assignment
Date Wed, 24 May 2017 05:57:48 GMT
code in RSGroupBasedLoadBalancer.roundRobinAssignment
  ...
  for(String groupKey : regionMap.keySet()) {
    if (regionMap.get(groupKey).size() > 0) {
      Map<ServerName, List<HRegionInfo>> result =
      this.internalBalancer.roundRobinAssignment(
        regionMap.get(groupKey),
        serverMap.get(groupKey));
      if(result != null) {
        assignments.putAll(result);
      }
    }
  }
  ...
Q: if two group both has BOGUS_SERVER_NAME, assignments.putAll may be not right?

---------------------------------------------------------------------------------
code in RSGroupBasedLoadBalancer.randomAssignment

  public ServerName randomAssignment(HRegionInfo region,
    List<ServerName> servers) throws HBaseIOException {
    ListMultimap<String,HRegionInfo> regionMap = LinkedListMultimap.create();
    ListMultimap<String,ServerName> serverMap = LinkedListMultimap.create();
    generateGroupMaps(Lists.newArrayList(region), servers, regionMap, serverMap);
    List<ServerName> filteredServers = serverMap.get(regionMap.keySet().iterator().next());
    return this.internalBalancer.randomAssignment(region, filteredServers);
  }

if internalBalancer.randomAssignment return BOGUS_SERVER_NAME, how does AM work?
I think we shoud return null instead of BOGUS_SERVER_NAME

Mime
View raw message