Class TestRegionSizeCalculator
java.lang.Object
org.apache.hadoop.hbase.mapreduce.TestRegionSizeCalculator
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final HBaseClassTestRuleprivate org.apache.hadoop.conf.Configurationprivate final longprivate final org.apache.hadoop.hbase.ServerName -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate org.apache.hadoop.hbase.client.AdminmockAdmin(org.apache.hadoop.hbase.RegionMetrics... regionLoadArray) Creates mock returning RegionLoad info about given servers.private org.apache.hadoop.hbase.RegionMetricsmockRegion(String regionName, int fileSizeMb, int memStoreSize) Creates mock of region with given name and size.private org.apache.hadoop.hbase.client.RegionLocatormockRegionLocator(String... regionNames) Makes some table with given region names.private org.apache.hadoop.hbase.client.RegionLocatormockRegionLocator(org.apache.hadoop.hbase.ServerName serverName, List<String> regionNames) voidWhen calculator is disabled, it should return 0 for each request.voidWhen size of region in megabytes is larger than largest possible integer there could be error caused by lost of precision.voidvoid
-
Field Details
-
CLASS_RULE
-
configuration
-
megabyte
- See Also:
-
sn
-
-
Constructor Details
-
TestRegionSizeCalculator
public TestRegionSizeCalculator()
-
-
Method Details
-
testSimpleTestCase
- Throws:
Exception
-
testLargeRegion
When size of region in megabytes is larger than largest possible integer there could be error caused by lost of precision.- Throws:
Exception
-
testDisabled
When calculator is disabled, it should return 0 for each request.- Throws:
Exception
-
testRegionWithNullServerName
- Throws:
Exception
-
mockRegionLocator
private org.apache.hadoop.hbase.client.RegionLocator mockRegionLocator(String... regionNames) throws IOException Makes some table with given region names.- Throws:
IOException
-
mockRegionLocator
private org.apache.hadoop.hbase.client.RegionLocator mockRegionLocator(org.apache.hadoop.hbase.ServerName serverName, List<String> regionNames) throws IOException - Throws:
IOException
-
mockAdmin
private org.apache.hadoop.hbase.client.Admin mockAdmin(org.apache.hadoop.hbase.RegionMetrics... regionLoadArray) throws Exception Creates mock returning RegionLoad info about given servers.- Throws:
Exception
-
mockRegion
private org.apache.hadoop.hbase.RegionMetrics mockRegion(String regionName, int fileSizeMb, int memStoreSize) Creates mock of region with given name and size.- Parameters:
fileSizeMb- number of megabytes occupied by region in file store in megabytesmemStoreSize- number of megabytes occupied by region in memstore in megabytes
-