Package org.apache.hadoop.hbase.client
Class TestTableScanMetrics
java.lang.Object
org.apache.hadoop.hbase.client.TestTableScanMetrics
@Tag("org.apache.hadoop.hbase.testclassification.ClientTests") @Tag("org.apache.hadoop.hbase.testclassification.LargeTests")
public class TestTableScanMetrics
extends Object
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final byte[]private static org.apache.hadoop.hbase.client.Connectionprivate static final byte[]private static intprivate org.apache.hadoop.hbase.client.Scanprivate static final Randomprivate static final org.apache.hadoop.hbase.TableNameprivate static final HBaseTestingUtilprivate static final byte[] -
Constructor Summary
ConstructorsConstructorDescriptionTestTableScanMetrics(String scannerName, org.apache.hadoop.hbase.client.Scan originalScan) -
Method Summary
Modifier and TypeMethodDescriptionprivate org.apache.hadoop.hbase.client.metrics.ScanMetricsassertScannedRowsAndGetScanMetrics(org.apache.hadoop.hbase.client.Scan scan, int expectedCount) private org.apache.hadoop.hbase.client.ScangenerateScan(byte[] smallerRow, byte[] largerRow) private RunnablegetPeriodicScanMetricsCollector(org.apache.hadoop.hbase.client.metrics.ScanMetrics scanMetrics, Map<org.apache.hadoop.hbase.client.metrics.ScanMetricsRegionInfo, Map<String, Long>> scanMetricsByRegionCollection, CountDownLatch latch) private List<byte[]>mergeRegions(org.apache.hadoop.hbase.TableName tableName, byte[] topRegion, byte[] bottomRegion) Merges two regions with the start row key as topRegion and bottomRegion.private voidmergeScanMetricsByRegion(Map<org.apache.hadoop.hbase.client.metrics.ScanMetricsRegionInfo, Map<String, Long>> srcMap, Map<org.apache.hadoop.hbase.client.metrics.ScanMetricsRegionInfo, Map<String, Long>> dstMap) private byte[]moveRegion(org.apache.hadoop.hbase.TableName tableName, byte[] startRow) Moves the region with start row key from its original region server to some other region server.static Stream<org.junit.jupiter.params.provider.Arguments>static voidsetUp()private List<byte[]>splitRegion(org.apache.hadoop.hbase.TableName tableName, byte[] startRow, byte[] splitKey) Splits the region with start row key at the split key provided.static voidtearDown()voidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoid
-
Field Details
-
TEST_UTIL
-
TABLE_NAME
-
CF
-
CQ
-
VALUE
-
RAND
-
NUM_REGIONS
-
CONN
-
originalScan
-
-
Constructor Details
-
TestTableScanMetrics
-
-
Method Details
-
parameters
-
setUp
- Throws:
Exception
-
tearDown
- Throws:
Exception
-
generateScan
private org.apache.hadoop.hbase.client.Scan generateScan(byte[] smallerRow, byte[] largerRow) throws IOException - Throws:
IOException
-
assertScannedRowsAndGetScanMetrics
private org.apache.hadoop.hbase.client.metrics.ScanMetrics assertScannedRowsAndGetScanMetrics(org.apache.hadoop.hbase.client.Scan scan, int expectedCount) throws IOException - Throws:
IOException
-
testScanMetricsDisabled
- Throws:
Exception
-
testScanMetricsWithScanMetricByRegionDisabled
- Throws:
Exception
-
testScanMetricsResetWithScanMetricsByRegionDisabled
- Throws:
Exception
-
testScanMetricsByRegionForSingleRegionScan
- Throws:
Exception
-
testScanMetricsByRegionForMultiRegionScan
- Throws:
Exception
-
testScanMetricsByRegionReset
- Throws:
Exception
-
testConcurrentUpdatesAndResetOfScanMetricsByRegion
- Throws:
Exception
-
testRPCCallProcessingAndQueueWaitTimeMetrics
- Throws:
Exception
-
testScanMetricsByRegionWithRegionMove
- Throws:
Exception
-
testScanMetricsByRegionWithRegionSplit
- Throws:
Exception
-
testScanMetricsByRegionWithRegionMerge
- Throws:
Exception
-
getPeriodicScanMetricsCollector
private Runnable getPeriodicScanMetricsCollector(org.apache.hadoop.hbase.client.metrics.ScanMetrics scanMetrics, Map<org.apache.hadoop.hbase.client.metrics.ScanMetricsRegionInfo, Map<String, Long>> scanMetricsByRegionCollection, CountDownLatch latch) -
mergeScanMetricsByRegion
-
moveRegion
private byte[] moveRegion(org.apache.hadoop.hbase.TableName tableName, byte[] startRow) throws IOException Moves the region with start row key from its original region server to some other region server. This is a synchronous method.- Parameters:
tableName- Table name of region to be moved belongs.startRow- Start row key of the region to be moved.- Returns:
- Encoded region name of the region which was moved.
- Throws:
IOException
-
splitRegion
private List<byte[]> splitRegion(org.apache.hadoop.hbase.TableName tableName, byte[] startRow, byte[] splitKey) throws IOException Splits the region with start row key at the split key provided. This is a synchronous method.- Parameters:
tableName- Table name of region to be split.startRow- Start row key of the region to be split.splitKey- Split key for splitting the region.- Returns:
- List of encoded region names with first element being parent region followed by two child regions.
- Throws:
IOException
-
mergeRegions
private List<byte[]> mergeRegions(org.apache.hadoop.hbase.TableName tableName, byte[] topRegion, byte[] bottomRegion) throws IOException Merges two regions with the start row key as topRegion and bottomRegion. Ensures that the regions to be merged are adjacent regions. This is a synchronous method.- Parameters:
tableName- Table name of regions to be merged.topRegion- Start row key of first region for merging.bottomRegion- Start row key of second region for merging.- Returns:
- List of encoded region names with first two elements being original regions followed by the merged region.
- Throws:
IOException
-