public class RSGroupableBalancerTestBase extends BalancerTestBase
BalancerTestBase.MockMapping
Modifier and Type | Field and Description |
---|---|
(package private) static org.apache.hadoop.conf.Configuration |
conf |
(package private) static Map<String,org.apache.hadoop.hbase.rsgroup.RSGroupInfo> |
groupMap |
(package private) static String[] |
groups |
(package private) int[] |
regionAssignment |
(package private) static int |
regionId |
(package private) static List<org.apache.hadoop.hbase.ServerName> |
servers |
(package private) static org.apache.hadoop.hbase.TableName |
table0 |
(package private) static List<org.apache.hadoop.hbase.client.TableDescriptor> |
tableDescs |
(package private) static Map<org.apache.hadoop.hbase.TableName,String> |
tableMap |
(package private) static org.apache.hadoop.hbase.TableName[] |
tables |
clusterStateMocks, clusterStateMocksWithNoSlop, clusterStateMocksWithSlop, dummyMetricsStochasticBalancer, largeCluster, loadBalancer
Constructor and Description |
---|
RSGroupableBalancerTestBase() |
Modifier and Type | Method and Description |
---|---|
protected void |
assertClusterAsBalanced(org.apache.hbase.thirdparty.com.google.common.collect.ArrayListMultimap<String,org.apache.hadoop.hbase.master.balancer.ServerAndLoad> groupLoadMap)
Invariant is that all servers of a group have load between floor(avg) and ceiling(avg) number
of regions.
|
protected void |
assertImmediateAssignment(List<org.apache.hadoop.hbase.client.RegionInfo> regions,
List<org.apache.hadoop.hbase.ServerName> servers,
Map<org.apache.hadoop.hbase.client.RegionInfo,org.apache.hadoop.hbase.ServerName> assignments)
All regions have an assignment.
|
protected void |
assertRetainedAssignment(Map<org.apache.hadoop.hbase.client.RegionInfo,org.apache.hadoop.hbase.ServerName> existing,
List<org.apache.hadoop.hbase.ServerName> servers,
Map<org.apache.hadoop.hbase.ServerName,List<org.apache.hadoop.hbase.client.RegionInfo>> assignment)
Asserts a valid retained assignment plan.
|
protected List<org.apache.hadoop.hbase.client.RegionInfo> |
assignedRegions(int numRegions,
org.apache.hadoop.hbase.ServerName sn)
Generate assigned regions to a given server using group information.
|
protected static Map<String,org.apache.hadoop.hbase.rsgroup.RSGroupInfo> |
constructGroupInfo(List<org.apache.hadoop.hbase.ServerName> servers,
String[] groups)
Construct group info, with each group having at least one server.
|
protected static List<org.apache.hadoop.hbase.client.TableDescriptor> |
constructTableDesc(boolean hasBogusTable)
Construct table descriptors evenly distributed between the groups.
|
protected org.apache.hbase.thirdparty.com.google.common.collect.ArrayListMultimap<String,org.apache.hadoop.hbase.master.balancer.ServerAndLoad> |
convertToGroupBasedMap(Map<org.apache.hadoop.hbase.ServerName,List<org.apache.hadoop.hbase.client.RegionInfo>> serversMap) |
protected static List<org.apache.hadoop.hbase.ServerName> |
generateServers(int numServers) |
protected static org.apache.hadoop.hbase.rsgroup.RSGroupInfoManager |
getMockedGroupInfoManager() |
protected static org.apache.hadoop.hbase.master.MasterServices |
getMockedMaster() |
protected org.apache.hadoop.hbase.TableName |
getTableName(org.apache.hadoop.hbase.ServerName sn) |
protected Map<org.apache.hadoop.hbase.ServerName,List<org.apache.hadoop.hbase.client.RegionInfo>> |
mockClusterServers() |
protected String |
printStats(org.apache.hbase.thirdparty.com.google.common.collect.ArrayListMultimap<String,org.apache.hadoop.hbase.master.balancer.ServerAndLoad> groupBasedLoad) |
protected List<org.apache.hadoop.hbase.client.RegionInfo> |
randomRegions(int numRegions)
Generate a list of regions evenly distributed between the tables.
|
protected org.apache.hbase.thirdparty.com.google.common.collect.ArrayListMultimap<String,org.apache.hadoop.hbase.master.balancer.ServerAndLoad> |
reconcile(org.apache.hbase.thirdparty.com.google.common.collect.ArrayListMultimap<String,org.apache.hadoop.hbase.master.balancer.ServerAndLoad> previousLoad,
List<org.apache.hadoop.hbase.master.RegionPlan> plans) |
protected void |
updateLoad(org.apache.hbase.thirdparty.com.google.common.collect.ArrayListMultimap<String,org.apache.hadoop.hbase.master.balancer.ServerAndLoad> previousLoad,
org.apache.hadoop.hbase.ServerName sn,
int diff) |
assertClusterAsBalanced, assertClusterOverallAsBalanced, assertRegionReplicaPlacement, beforeAllTests, convertToList, createRegions, createServerMap, mockCluster, mockClusterServers, mockClusterServers, mockClusterServers, mockClusterServersWithTables, mockUniformClusterServers, printMock, printStats, randomRegions, randomServer, randomServers, reconcile, returnRegions, returnServer, returnServers, testWithCluster, testWithCluster, testWithClusterWithIteration, testWithClusterWithIteration, uniformRegions, updateLoad
static org.apache.hadoop.hbase.TableName table0
static org.apache.hadoop.hbase.TableName[] tables
static List<org.apache.hadoop.hbase.client.TableDescriptor> tableDescs
int[] regionAssignment
static int regionId
static org.apache.hadoop.conf.Configuration conf
public RSGroupableBalancerTestBase()
protected void assertClusterAsBalanced(org.apache.hbase.thirdparty.com.google.common.collect.ArrayListMultimap<String,org.apache.hadoop.hbase.master.balancer.ServerAndLoad> groupLoadMap)
protected void assertImmediateAssignment(List<org.apache.hadoop.hbase.client.RegionInfo> regions, List<org.apache.hadoop.hbase.ServerName> servers, Map<org.apache.hadoop.hbase.client.RegionInfo,org.apache.hadoop.hbase.ServerName> assignments) throws IOException
IOException
protected void assertRetainedAssignment(Map<org.apache.hadoop.hbase.client.RegionInfo,org.apache.hadoop.hbase.ServerName> existing, List<org.apache.hadoop.hbase.ServerName> servers, Map<org.apache.hadoop.hbase.ServerName,List<org.apache.hadoop.hbase.client.RegionInfo>> assignment) throws FileNotFoundException, IOException
Must meet the following conditions:
FileNotFoundException
IOException
protected String printStats(org.apache.hbase.thirdparty.com.google.common.collect.ArrayListMultimap<String,org.apache.hadoop.hbase.master.balancer.ServerAndLoad> groupBasedLoad)
protected org.apache.hbase.thirdparty.com.google.common.collect.ArrayListMultimap<String,org.apache.hadoop.hbase.master.balancer.ServerAndLoad> convertToGroupBasedMap(Map<org.apache.hadoop.hbase.ServerName,List<org.apache.hadoop.hbase.client.RegionInfo>> serversMap) throws IOException
IOException
protected org.apache.hbase.thirdparty.com.google.common.collect.ArrayListMultimap<String,org.apache.hadoop.hbase.master.balancer.ServerAndLoad> reconcile(org.apache.hbase.thirdparty.com.google.common.collect.ArrayListMultimap<String,org.apache.hadoop.hbase.master.balancer.ServerAndLoad> previousLoad, List<org.apache.hadoop.hbase.master.RegionPlan> plans)
protected void updateLoad(org.apache.hbase.thirdparty.com.google.common.collect.ArrayListMultimap<String,org.apache.hadoop.hbase.master.balancer.ServerAndLoad> previousLoad, org.apache.hadoop.hbase.ServerName sn, int diff)
protected Map<org.apache.hadoop.hbase.ServerName,List<org.apache.hadoop.hbase.client.RegionInfo>> mockClusterServers() throws IOException
IOException
protected List<org.apache.hadoop.hbase.client.RegionInfo> randomRegions(int numRegions)
randomRegions
in class BalancerTestBase
numRegions
- The number of regions to be generated.protected List<org.apache.hadoop.hbase.client.RegionInfo> assignedRegions(int numRegions, org.apache.hadoop.hbase.ServerName sn) throws IOException
numRegions
- the num regions to generatesn
- the servernameIOException
- Signals that an I/O exception has occurred.protected static List<org.apache.hadoop.hbase.ServerName> generateServers(int numServers)
protected static Map<String,org.apache.hadoop.hbase.rsgroup.RSGroupInfo> constructGroupInfo(List<org.apache.hadoop.hbase.ServerName> servers, String[] groups)
servers
- the serversgroups
- the groupsprotected static List<org.apache.hadoop.hbase.client.TableDescriptor> constructTableDesc(boolean hasBogusTable)
hasBogusTable
- there is a table that does not determine the groupprotected static org.apache.hadoop.hbase.master.MasterServices getMockedMaster() throws IOException
IOException
protected static org.apache.hadoop.hbase.rsgroup.RSGroupInfoManager getMockedGroupInfoManager() throws IOException
IOException
protected org.apache.hadoop.hbase.TableName getTableName(org.apache.hadoop.hbase.ServerName sn) throws IOException
IOException
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.