Class TestBytesReadServerSideScanMetrics
java.lang.Object
org.apache.hadoop.hbase.regionserver.TestBytesReadServerSideScanMetrics
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final byte[]
static final HBaseClassTestRule
private org.apache.hadoop.conf.Configuration
private static final byte[]
private static final org.slf4j.Logger
org.junit.rules.TestName
private static final byte[]
private static final byte[]
private static final byte[]
private HBaseTestingUtil
private static final byte[]
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
assertBlockCacheWarmUp
(org.apache.hadoop.hbase.TableName tableName, org.apache.hadoop.hbase.KeyValue keyValue) private void
assertBlockIsCached
(org.apache.hadoop.hbase.io.hfile.HFile.Reader hfileReader, org.apache.hadoop.hbase.io.hfile.HFileBlock block, org.apache.hadoop.hbase.io.hfile.BlockCache blockCache) private void
assertBytesReadFromBlockCache
(org.apache.hadoop.hbase.TableName tableName, long actualBytesReadFromBlockCache, org.apache.hadoop.hbase.KeyValue keyValue) private void
assertBytesReadFromFs
(org.apache.hadoop.hbase.TableName tableName, long actualBytesReadFromFs, org.apache.hadoop.hbase.KeyValue keyValue, long actualReadOps) private org.apache.hadoop.hbase.client.Scan
createScanToReadOneRowAtATimeFromServer
(byte[] startRow, byte[] stopRow) private void
createTable
(org.apache.hadoop.hbase.TableName tableName, boolean blockCacheEnabled, org.apache.hadoop.hbase.regionserver.BloomType bloomType) private void
createTable
(org.apache.hadoop.hbase.TableName tableName, boolean blockCacheEnabled, org.apache.hadoop.hbase.regionserver.BloomType bloomType, int blocksize, Map<String, String> configuration) private void
createTable
(org.apache.hadoop.hbase.TableName tableName, boolean blockCacheEnabled, org.apache.hadoop.hbase.regionserver.BloomType bloomType, Map<String, String> configuration) private void
flushAndWaitUntilFlushed
(org.apache.hadoop.hbase.TableName tableName, boolean waitForUpdatedReaders) private int
getBytesReadFromFsForNonGetScan
(org.apache.hadoop.hbase.TableName tableName, org.apache.hadoop.hbase.client.metrics.ScanMetrics scanMetrics, int expectedStoreFileCount) private int
getBytesReadToReadConsecutiveDataBlocks
(org.apache.hadoop.hbase.TableName tableName, int expectedStoreFileCount, int expectedDataBlockCount, boolean isReadFromFs) private org.apache.hadoop.hbase.client.metrics.ScanMetrics
readDataAndGetScanMetrics
(org.apache.hadoop.hbase.TableName tableName, boolean isScanMetricsEnabled) private void
readHFile
(org.apache.hadoop.hbase.io.hfile.HFile.Reader hfileReader, org.apache.hadoop.hbase.io.hfile.CompoundBloomFilter cbf, org.apache.hadoop.hbase.KeyValue keyValue, Consumer<org.apache.hadoop.hbase.io.hfile.HFileBlock> bytesReadFunction) void
setUp()
void
void
void
void
void
void
void
void
void
Test consecutive calls to RegionScannerImpl.next() to make sure populating scan metrics from ThreadLocalServerSideScanMetrics is done correctly.void
private void
writeData
(org.apache.hadoop.hbase.TableName tableName, boolean shouldFlush)
-
Field Details
-
CLASS_RULE
-
name
-
LOG
-
UTIL
-
CF
-
CQ
-
VALUE
-
ROW2
-
ROW3
-
ROW4
-
conf
-
-
Constructor Details
-
TestBytesReadServerSideScanMetrics
public TestBytesReadServerSideScanMetrics()
-
-
Method Details
-
setUp
- Throws:
Exception
-
testScanMetricsDisabled
- Throws:
Exception
-
testBytesReadFromFsForSerialSeeks
- Throws:
Exception
-
testBytesReadFromFsForParallelSeeks
- Throws:
Exception
-
testBytesReadFromBlockCache
- Throws:
Exception
-
testBytesReadFromMemstore
- Throws:
Exception
-
testBytesReadWithSwitchFromPReadToStream
- Throws:
Exception
-
testBytesReadWhenFlushHappenedInTheMiddleOfScan
- Throws:
Exception
-
testBytesReadInReverseScan
- Throws:
Exception
-
testBytesReadWithLazySeek
- Throws:
Exception
-
testConsecutiveRegionScannerNextCalls
Test consecutive calls to RegionScannerImpl.next() to make sure populating scan metrics from ThreadLocalServerSideScanMetrics is done correctly.- Throws:
Exception
-
createScanToReadOneRowAtATimeFromServer
private org.apache.hadoop.hbase.client.Scan createScanToReadOneRowAtATimeFromServer(byte[] startRow, byte[] stopRow) -
flushAndWaitUntilFlushed
private void flushAndWaitUntilFlushed(org.apache.hadoop.hbase.TableName tableName, boolean waitForUpdatedReaders) throws Exception - Throws:
Exception
-
getBytesReadToReadConsecutiveDataBlocks
private int getBytesReadToReadConsecutiveDataBlocks(org.apache.hadoop.hbase.TableName tableName, int expectedStoreFileCount, int expectedDataBlockCount, boolean isReadFromFs) throws Exception - Throws:
Exception
-
getBytesReadFromFsForNonGetScan
private int getBytesReadFromFsForNonGetScan(org.apache.hadoop.hbase.TableName tableName, org.apache.hadoop.hbase.client.metrics.ScanMetrics scanMetrics, int expectedStoreFileCount) throws Exception - Throws:
Exception
-
readDataAndGetScanMetrics
private org.apache.hadoop.hbase.client.metrics.ScanMetrics readDataAndGetScanMetrics(org.apache.hadoop.hbase.TableName tableName, boolean isScanMetricsEnabled) throws Exception - Throws:
Exception
-
writeData
private void writeData(org.apache.hadoop.hbase.TableName tableName, boolean shouldFlush) throws Exception - Throws:
Exception
-
createTable
private void createTable(org.apache.hadoop.hbase.TableName tableName, boolean blockCacheEnabled, org.apache.hadoop.hbase.regionserver.BloomType bloomType) throws Exception - Throws:
Exception
-
createTable
private void createTable(org.apache.hadoop.hbase.TableName tableName, boolean blockCacheEnabled, org.apache.hadoop.hbase.regionserver.BloomType bloomType, Map<String, String> configuration) throws Exception- Throws:
Exception
-
createTable
private void createTable(org.apache.hadoop.hbase.TableName tableName, boolean blockCacheEnabled, org.apache.hadoop.hbase.regionserver.BloomType bloomType, int blocksize, Map<String, String> configuration) throws Exception- Throws:
Exception
-
assertBytesReadFromFs
private void assertBytesReadFromFs(org.apache.hadoop.hbase.TableName tableName, long actualBytesReadFromFs, org.apache.hadoop.hbase.KeyValue keyValue, long actualReadOps) throws Exception - Throws:
Exception
-
readHFile
private void readHFile(org.apache.hadoop.hbase.io.hfile.HFile.Reader hfileReader, org.apache.hadoop.hbase.io.hfile.CompoundBloomFilter cbf, org.apache.hadoop.hbase.KeyValue keyValue, Consumer<org.apache.hadoop.hbase.io.hfile.HFileBlock> bytesReadFunction) throws Exception - Throws:
Exception
-
assertBytesReadFromBlockCache
private void assertBytesReadFromBlockCache(org.apache.hadoop.hbase.TableName tableName, long actualBytesReadFromBlockCache, org.apache.hadoop.hbase.KeyValue keyValue) throws Exception - Throws:
Exception
-
assertBlockCacheWarmUp
private void assertBlockCacheWarmUp(org.apache.hadoop.hbase.TableName tableName, org.apache.hadoop.hbase.KeyValue keyValue) throws Exception - Throws:
Exception
-
assertBlockIsCached
private void assertBlockIsCached(org.apache.hadoop.hbase.io.hfile.HFile.Reader hfileReader, org.apache.hadoop.hbase.io.hfile.HFileBlock block, org.apache.hadoop.hbase.io.hfile.BlockCache blockCache)
-