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
FieldsModifier and TypeFieldDescriptionstatic final HBaseClassTestRuleprivate SingleProcessHBaseClusterprivate static final Stringprivate static final org.slf4j.Loggerprivate static final intprivate static final intprivate static final HBaseTestingUtilorg.junit.rules.TestName -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate intnumRegionsForTable(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.voidsetUp()voidtearDown()voidprivate org.apache.hadoop.hbase.TableNamewriteData(long sizeInBytes) Writes at leastsizeInBytesbytes 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 leastsizeInBytesbytes 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.
-