Class TestCacheAwareLoadBalancerCostFunctions
java.lang.Object
org.apache.hadoop.hbase.master.balancer.BalancerTestBase
org.apache.hadoop.hbase.master.balancer.StochasticBalancerTestBase
org.apache.hadoop.hbase.master.balancer.TestCacheAwareLoadBalancerCostFunctions
@Tag("org.apache.hadoop.hbase.testclassification.MasterTests") @Tag("org.apache.hadoop.hbase.testclassification.MediumTests")
public class TestCacheAwareLoadBalancerCostFunctions
extends StochasticBalancerTestBase
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate classNested classes/interfaces inherited from class org.apache.hadoop.hbase.master.balancer.BalancerTestBase
BalancerTestBase.MockMapping -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int[][][]Data set to testCacheCost: [test][0][0] = mapping of server to number of regions it hosts [test][region + 1][0] = server that region is hosted on [test][region + 1][server + 1] = size of region cached on serverprivate final float[]private org.apache.hadoop.hbase.master.balancer.CacheAwareLoadBalancerprivate static org.apache.hadoop.conf.ConfigurationFields inherited from class org.apache.hadoop.hbase.master.balancer.StochasticBalancerTestBase
dummyMetricsStochasticBalancerFields inherited from class org.apache.hadoop.hbase.master.balancer.BalancerTestBase
clusterStateMocks, clusterStateMocksWithNoSlop, clusterStateMocksWithSlop, conf, largeCluster, regionId -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbuildRegionLoads(Collection<org.apache.hadoop.hbase.client.RegionInfo> regions, float cachedRatio, int regionSizeMb) private static List<org.apache.hadoop.hbase.ServerName>getServersInInsertionOrder(Map<org.apache.hadoop.hbase.ServerName, List<org.apache.hadoop.hbase.client.RegionInfo>> cluster) private static org.apache.hadoop.hbase.master.balancer.CacheAwareLoadBalancernewCacheAwareBalancer(org.apache.hadoop.conf.Configuration cfg) static voidvoidvoidChecks that needsBalance isn't true when regions report high cache ratiosvoidWhen block-cache persistence, cold regions (belowCacheAwareLoadBalancer.LOW_CACHE_RATIO_FOR_RELOCATION_KEY) together with RS-reported block-cache free bytes inflate plausible best placement so weighted cache cost crossesminCostNeedBalance;StochasticLoadBalancer.needsBalance(org.apache.hadoop.hbase.TableName, org.apache.hadoop.hbase.master.balancer.BalancerClusterState)returns true even with evenly spread region-count skew.voidvoidvoidvoidvoidMethods inherited from class org.apache.hadoop.hbase.master.balancer.StochasticBalancerTestBase
beforeAllTests, increaseMaxRunTimeOrFail, setMaxRunTime, testWithClusterWithIteration, testWithClusterWithIterationMethods inherited from class org.apache.hadoop.hbase.master.balancer.BalancerTestBase
assertClusterAsBalanced, assertClusterOverallAsBalanced, assertRegionReplicaPlacement, convertToList, createRegions, createServerMap, mockCluster, mockClusterServers, mockClusterServers, mockClusterServers, mockClusterServersUnsorted, mockClusterServersWithTables, mockUniformClusterServers, printMock, printStats, randomRegions, randomRegions, randomServer, randomServers, reconcile, returnRegions, returnServer, returnServers, uniformRegions, updateLoad
-
Field Details
-
expectedCacheCost
-
clusterRegionCacheRatioMocks
Data set to testCacheCost: [test][0][0] = mapping of server to number of regions it hosts [test][region + 1][0] = server that region is hosted on [test][region + 1][server + 1] = size of region cached on server -
storedConfiguration
-
loadBalancer
-
-
Constructor Details
-
TestCacheAwareLoadBalancerCostFunctions
-
-
Method Details
-
saveInitialConfiguration
-
beforeEachTest
-
testVerifyCacheAwareSkewnessCostFunctionEnabled
-
testVerifyCacheAwareSkewnessCostFunctionDisabled
-
testVerifyCacheCostFunctionEnabled
-
testVerifyCacheCostFunctionDisabledByNoBucketCachePersistence
-
testVerifyCacheCostFunctionDisabledByNoMultiplier
-
testCacheCost
-
testNeedsBalanceWhenLowCacheRatioRegionsAndFreeBlockCacheSpace
When block-cache persistence, cold regions (belowCacheAwareLoadBalancer.LOW_CACHE_RATIO_FOR_RELOCATION_KEY) together with RS-reported block-cache free bytes inflate plausible best placement so weighted cache cost crossesminCostNeedBalance;StochasticLoadBalancer.needsBalance(org.apache.hadoop.hbase.TableName, org.apache.hadoop.hbase.master.balancer.BalancerClusterState)returns true even with evenly spread region-count skew. -
testNeedsBalanceFalseWhenWarmRegionsDespiteFreeBlockCacheSpace
Checks that needsBalance isn't true when regions report high cache ratios -
newCacheAwareBalancer
private static org.apache.hadoop.hbase.master.balancer.CacheAwareLoadBalancer newCacheAwareBalancer(org.apache.hadoop.conf.Configuration cfg) -
buildRegionLoads
private static Map<String,Deque<org.apache.hadoop.hbase.master.balancer.BalancerRegionLoad>> buildRegionLoads(Collection<org.apache.hadoop.hbase.client.RegionInfo> regions, float cachedRatio, int regionSizeMb) -
getServersInInsertionOrder
private static List<org.apache.hadoop.hbase.ServerName> getServersInInsertionOrder(Map<org.apache.hadoop.hbase.ServerName, List<org.apache.hadoop.hbase.client.RegionInfo>> cluster)
-