Package org.apache.hadoop.hbase.client
Class TestTableScanMetrics
java.lang.Object
org.apache.hadoop.hbase.client.FromClientSideBase
org.apache.hadoop.hbase.client.TestTableScanMetrics
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final byte[]
static final HBaseClassTestRule
private static org.apache.hadoop.hbase.client.Connection
private static final byte[]
private static int
org.apache.hadoop.hbase.client.Scan
private static final Random
private static final org.apache.hadoop.hbase.TableName
private static final HBaseTestingUtil
private static final byte[]
Fields inherited from class org.apache.hadoop.hbase.client.FromClientSideBase
FAMILY, INVALID_FAMILY, QUALIFIER, ROW, SLAVES
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate org.apache.hadoop.hbase.client.metrics.ScanMetrics
assertScannedRowsAndGetScanMetrics
(org.apache.hadoop.hbase.client.Scan scan, int expectedCount) private org.apache.hadoop.hbase.client.Scan
generateScan
(byte[] smallerRow, byte[] largerRow) 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) 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 void
mergeScanMetricsByRegion
(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.params()
static void
setUp()
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 void
tearDown()
void
void
void
void
void
void
void
void
void
void
Methods inherited from class org.apache.hadoop.hbase.client.FromClientSideBase
afterClass, assertDoubleResult, assertEmptyResult, assertIncrementKey, assertKey, assertNResult, assertNResult, assertNullResult, assertNumKeys, assertRowCount, assertSingleResult, assertSingleResult, assertSingleResult, buildScanner, createScanWithRowFilter, createScanWithRowFilter, deleteColumns, equals, getAllVersionsAndVerify, getNumberOfRows, getSingleScanResult, getTestNull, getTestNull, getVerifySingleColumn, getVerifySingleEmpty, getVersionAndVerify, getVersionAndVerifyMissing, getVersionRangeAndVerify, getVersionRangeAndVerifyGreaterThan, initialize, isSameParameterizedCluster, makeN, makeNAscii, makeNBig, makeStamps, putRows, scanAllVersionsAndVerify, scanTestNull, scanTestNull, scanVerifySingleColumn, scanVerifySingleEmpty, scanVersionAndVerify, scanVersionAndVerifyMissing, scanVersionRangeAndVerify, scanVersionRangeAndVerifyGreaterThan, singleRowGetTest, singleRowScanTest, splitTable
-
Field Details
-
CLASS_RULE
-
TEST_UTIL
-
TABLE_NAME
-
CF
-
CQ
-
VALUE
-
RAND
-
NUM_REGIONS
-
CONN
-
scannerName
-
originalScan
-
-
Constructor Details
-
TestTableScanMetrics
public TestTableScanMetrics()
-
-
Method Details
-
params
-
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
-
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
-