public class TestRegionSizeCalculator extends Object
Modifier and Type | Field and Description |
---|---|
static HBaseClassTestRule |
CLASS_RULE |
private org.apache.hadoop.conf.Configuration |
configuration |
private long |
megabyte |
private org.apache.hadoop.hbase.ServerName |
sn |
Constructor and Description |
---|
TestRegionSizeCalculator() |
Modifier and Type | Method and Description |
---|---|
private 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.
|
void |
testDisabled()
When calculator is disabled, it should return 0 for each request.
|
void |
testLargeRegion()
When size of region in megabytes is larger than largest possible integer there could be error
caused by lost of precision.
|
void |
testSimpleTestCase() |
public static final HBaseClassTestRule CLASS_RULE
private org.apache.hadoop.conf.Configuration configuration
private final long megabyte
private final org.apache.hadoop.hbase.ServerName sn
public TestRegionSizeCalculator()
public void testSimpleTestCase() throws Exception
Exception
public void testLargeRegion() throws Exception
Exception
public void testDisabled() throws Exception
Exception
private org.apache.hadoop.hbase.client.RegionLocator mockRegionLocator(String... regionNames) throws IOException
IOException
private org.apache.hadoop.hbase.client.Admin mockAdmin(org.apache.hadoop.hbase.RegionMetrics... regionLoadArray) throws Exception
Exception
private org.apache.hadoop.hbase.RegionMetrics mockRegion(String regionName, int fileSizeMb)
fileSizeMb
- number of megabytes occupied by region in file store in megabytesCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.