Package org.apache.hadoop.hbase.quotas
Class TestRegionSizeUse
java.lang.Object
org.apache.hadoop.hbase.quotas.TestRegionSizeUse
Test class which verifies that region sizes are reported to the master.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final HBaseClassTestRule
private SingleProcessHBaseCluster
private static final String
private static final org.slf4j.Logger
private static final int
private static final int
private static final HBaseTestingUtil
org.junit.rules.TestName
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate int
numRegionsForTable
(org.apache.hadoop.hbase.TableName tn, Map<org.apache.hadoop.hbase.client.RegionInfo, Long> regions) Computes the number of regions for the given table that have a positive size.void
setUp()
void
tearDown()
void
private org.apache.hadoop.hbase.TableName
writeData
(long sizeInBytes) Writes at leastsizeInBytes
bytes of data to HBase and returns the TableName used.
-
Field Details
-
CLASS_RULE
-
LOG
-
SIZE_PER_VALUE
- See Also:
-
NUM_SPLITS
- See Also:
-
F1
- See Also:
-
TEST_UTIL
-
cluster
-
testName
-
-
Constructor Details
-
TestRegionSizeUse
public TestRegionSizeUse()
-
-
Method Details
-
setUp
- Throws:
Exception
-
tearDown
- Throws:
Exception
-
testBasicRegionSizeReports
- Throws:
Exception
-
writeData
Writes at leastsizeInBytes
bytes of data to HBase and returns the TableName used.- Parameters:
sizeInBytes
- The amount of data to write in bytes.- Returns:
- The table the data was written to
- Throws:
IOException
-
numRegionsForTable
private int numRegionsForTable(org.apache.hadoop.hbase.TableName tn, Map<org.apache.hadoop.hbase.client.RegionInfo, Long> regions) Computes the number of regions for the given table that have a positive size.- Parameters:
tn
- The TableName in questionregions
- A collection of region sizes- Returns:
- The number of regions for the given table.
-