Class TestRegionSizeCalculator
java.lang.Object
org.apache.hadoop.hbase.mapreduce.TestRegionSizeCalculator
-
Field Summary
Modifier and TypeFieldDescriptionstatic final HBaseClassTestRule
private org.apache.hadoop.conf.Configuration
private final long
private final org.apache.hadoop.hbase.ServerName
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate org.apache.hadoop.hbase.client.Admin
mockAdmin
(org.apache.hadoop.hbase.RegionMetrics... regionLoadArray) Creates mock returning RegionLoad info about given servers.private org.apache.hadoop.hbase.RegionMetrics
mockRegion
(String regionName, int fileSizeMb) Creates mock of region with given name and size.private org.apache.hadoop.hbase.client.RegionLocator
mockRegionLocator
(String... regionNames) Makes some table with given region names.private org.apache.hadoop.hbase.client.RegionLocator
mockRegionLocator
(org.apache.hadoop.hbase.ServerName serverName, List<String> regionNames) void
When calculator is disabled, it should return 0 for each request.void
When size of region in megabytes is larger than largest possible integer there could be error caused by lost of precision.void
void
-
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
Creates mock of region with given name and size.- Parameters:
fileSizeMb
- number of megabytes occupied by region in file store in megabytes
-