Class TestCacheAwareLoadBalancer
java.lang.Object
org.apache.hadoop.hbase.master.balancer.BalancerTestBase
org.apache.hadoop.hbase.master.balancer.TestCacheAwareLoadBalancer
@Tag("org.apache.hadoop.hbase.testclassification.LargeTests")
public class TestCacheAwareLoadBalancer
extends BalancerTestBase
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.hadoop.hbase.master.balancer.BalancerTestBase
BalancerTestBase.MockMapping -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static org.apache.hadoop.hbase.master.balancer.CacheAwareLoadBalancerprivate static final org.slf4j.Logger(package private) static List<org.apache.hadoop.hbase.ServerName>(package private) static List<org.apache.hadoop.hbase.client.TableDescriptor>(package private) static org.apache.hadoop.hbase.TableName[]Fields inherited from class org.apache.hadoop.hbase.master.balancer.BalancerTestBase
clusterStateMocks, clusterStateMocksWithNoSlop, clusterStateMocksWithSlop, conf, largeCluster, regionId -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidprivate static List<org.apache.hadoop.hbase.client.TableDescriptor>constructTableDesc(boolean hasBogusTable) private static List<org.apache.hadoop.hbase.ServerName>generateServers(int numServers) private org.apache.hadoop.hbase.ServerMetricsmockServerMetricsWithRegionCacheInfo(List<org.apache.hadoop.hbase.client.RegionInfo> regionsOnServer, float currentCacheRatio, List<org.apache.hadoop.hbase.client.RegionInfo> oldRegionCacheInfo, int oldRegionCachedSize, int regionSize) voidvoidRegions on the overloaded RS report low block-cache ratio; no RS reports prefetch/historical cache for those regions (soCacheAwareLoadBalancer.CacheAwareCandidateGeneratorhas no "old server" to prefer).voidvoidvoidvoidvoidvoidvoidvoidvoidvoidMethods 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
-
LOG
-
loadBalancer
-
servers
-
tableDescs
-
tables
-
-
Constructor Details
-
TestCacheAwareLoadBalancer
public TestCacheAwareLoadBalancer()
-
-
Method Details
-
generateServers
-
constructTableDesc
private static List<org.apache.hadoop.hbase.client.TableDescriptor> constructTableDesc(boolean hasBogusTable) -
mockServerMetricsWithRegionCacheInfo
private org.apache.hadoop.hbase.ServerMetrics mockServerMetricsWithRegionCacheInfo(List<org.apache.hadoop.hbase.client.RegionInfo> regionsOnServer, float currentCacheRatio, List<org.apache.hadoop.hbase.client.RegionInfo> oldRegionCacheInfo, int oldRegionCachedSize, int regionSize) -
beforeAllTests
- Throws:
Exception
-
testRegionsNotCachedOnOldServerAndCurrentServer
- Throws:
Exception
-
testLowCacheRatioNoHistoricalCacheRelocatesWhenTargetHasFreeBlockCache
@Test public void testLowCacheRatioNoHistoricalCacheRelocatesWhenTargetHasFreeBlockCache() throws ExceptionRegions on the overloaded RS report low block-cache ratio; no RS reports prefetch/historical cache for those regions (soCacheAwareLoadBalancer.CacheAwareCandidateGeneratorhas no "old server" to prefer). Another RS has ample free block cache. The balancer should still emit plans that shed load from the hot RS onto the idle RS with spare cache capacity.- Throws:
Exception
-
testRegionsPartiallyCachedOnOldServerAndNotCachedOnCurrentServer
@Test public void testRegionsPartiallyCachedOnOldServerAndNotCachedOnCurrentServer() throws Exception- Throws:
Exception
-
testThrottlingRegionBeyondThreshold
- Throws:
Exception
-
testThrottlingRegionBelowThreshold
- Throws:
Exception
-
testThrottlingCacheRatioUnknownOnTarget
- Throws:
Exception
-
testThrottlingCacheRatioUnknownForRegion
- Throws:
Exception
-
testRegionPlansSortedByCacheRatioOnTarget
- Throws:
Exception
-
testRegionsFullyCachedOnOldServerAndNotCachedOnCurrentServers
- Throws:
Exception
-
testRegionsFullyCachedOnOldAndCurrentServers
- Throws:
Exception
-
testRegionsPartiallyCachedOnOldServerAndCurrentServer
- Throws:
Exception
-
testBalancerNotThrowNPEWhenBalancerPlansIsNull
- Throws:
Exception
-