Package org.apache.hadoop.hbase.io.hfile
Class TestPrefetch
java.lang.Object
org.apache.hadoop.hbase.io.hfile.TestPrefetch
-
Field Summary
Modifier and TypeFieldDescriptionprivate org.apache.hadoop.hbase.io.hfile.BlockCache
private org.apache.hadoop.hbase.io.hfile.CacheConfig
static final HBaseClassTestRule
private org.apache.hadoop.conf.Configuration
private static final int
private org.apache.hadoop.fs.FileSystem
private static final org.slf4j.Logger
private static final int
private static final int
io.opentelemetry.sdk.testing.junit4.OpenTelemetryRule
private static final HBaseTestingUtil
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.hadoop.hbase.KeyValue.Type
generateKeyType
(Random rand) private long
getElapsedTime
(long startTime) private void
readStoreFile
(org.apache.hadoop.fs.Path storeFilePath) private void
readStoreFile
(org.apache.hadoop.fs.Path storeFilePath, BiFunction<org.apache.hadoop.hbase.io.hfile.HFile.Reader, Long, org.apache.hadoop.hbase.io.hfile.HFileBlock> readFunction, BiConsumer<org.apache.hadoop.hbase.io.hfile.BlockCacheKey, org.apache.hadoop.hbase.io.hfile.HFileBlock> validationFunction) private void
readStoreFile
(org.apache.hadoop.fs.Path storeFilePath, BiFunction<org.apache.hadoop.hbase.io.hfile.HFile.Reader, Long, org.apache.hadoop.hbase.io.hfile.HFileBlock> readFunction, BiConsumer<org.apache.hadoop.hbase.io.hfile.BlockCacheKey, org.apache.hadoop.hbase.io.hfile.HFileBlock> validationFunction, org.apache.hadoop.hbase.io.hfile.CacheConfig cacheConfig) private void
readStoreFileCacheOnly
(org.apache.hadoop.fs.Path storeFilePath) private void
readStoreFileLikeScanner
(org.apache.hadoop.fs.Path storeFilePath) Read a storefile in the same manner as a scanner -- using non-positional reads and without waiting for prefetch to complete.void
setUp()
void
void
void
void
void
void
void
void
void
private void
testPrefetchWhenHFileLink
(Consumer<org.apache.hadoop.hbase.io.hfile.Cacheable> test) void
private void
testPrefetchWhenRefs
(boolean compactionEnabled, Consumer<org.apache.hadoop.hbase.io.hfile.Cacheable> test) void
private org.apache.hadoop.fs.Path
writeStoreFile
(String fname) private org.apache.hadoop.fs.Path
writeStoreFile
(String fname, org.apache.hadoop.hbase.io.hfile.HFileContext context) private org.apache.hadoop.fs.Path
writeStoreFile
(String fname, org.apache.hadoop.hbase.io.hfile.HFileContext context, org.apache.hadoop.hbase.io.hfile.CacheConfig cacheConfig) private org.apache.hadoop.hbase.util.Pair<org.apache.hadoop.fs.Path,
byte[]> writeStoreFileForSplit
(org.apache.hadoop.fs.Path storeDir, org.apache.hadoop.hbase.io.hfile.HFileContext context)
-
Field Details
-
LOG
-
CLASS_RULE
-
TEST_UTIL
-
NUM_VALID_KEY_TYPES
-
DATA_BLOCK_SIZE
- See Also:
-
NUM_KV
- See Also:
-
conf
-
cacheConf
-
fs
-
blockCache
-
otelRule
-
-
Constructor Details
-
TestPrefetch
public TestPrefetch()
-
-
Method Details
-
setUp
- Throws:
IOException
InterruptedException
-
testPrefetchSetInHCDWorks
-
testPrefetchBlockCacheDisabled
- Throws:
Exception
-
testPrefetchHeapUsageAboveThreshold
- Throws:
Exception
-
testPrefetch
- Throws:
Exception
-
testPrefetchRace
- Throws:
Exception
-
readStoreFileLikeScanner
Read a storefile in the same manner as a scanner -- using non-positional reads and without waiting for prefetch to complete.- Throws:
Exception
-
readStoreFile
- Throws:
Exception
-
readStoreFileCacheOnly
- Throws:
Exception
-
readStoreFile
private void readStoreFile(org.apache.hadoop.fs.Path storeFilePath, BiFunction<org.apache.hadoop.hbase.io.hfile.HFile.Reader, Long, throws Exceptionorg.apache.hadoop.hbase.io.hfile.HFileBlock> readFunction, BiConsumer<org.apache.hadoop.hbase.io.hfile.BlockCacheKey, org.apache.hadoop.hbase.io.hfile.HFileBlock> validationFunction) - Throws:
Exception
-
readStoreFile
private void readStoreFile(org.apache.hadoop.fs.Path storeFilePath, BiFunction<org.apache.hadoop.hbase.io.hfile.HFile.Reader, Long, throws Exceptionorg.apache.hadoop.hbase.io.hfile.HFileBlock> readFunction, BiConsumer<org.apache.hadoop.hbase.io.hfile.BlockCacheKey, org.apache.hadoop.hbase.io.hfile.HFileBlock> validationFunction, org.apache.hadoop.hbase.io.hfile.CacheConfig cacheConfig) - Throws:
Exception
-
testPrefetchCompressed
- Throws:
Exception
-
testPrefetchDoesntSkipRefs
- Throws:
Exception
-
testOnConfigurationChange
-
testPrefetchWithDelay
- Throws:
Exception
-
testPrefetchWhenNoBlockCache
- Throws:
Exception
-
testPrefetchDoesntSkipHFileLink
- Throws:
Exception
-
testPrefetchWhenRefs
private void testPrefetchWhenRefs(boolean compactionEnabled, Consumer<org.apache.hadoop.hbase.io.hfile.Cacheable> test) throws Exception - Throws:
Exception
-
testPrefetchWhenHFileLink
private void testPrefetchWhenHFileLink(Consumer<org.apache.hadoop.hbase.io.hfile.Cacheable> test) throws Exception - Throws:
Exception
-
writeStoreFile
- Throws:
IOException
-
writeStoreFile
private org.apache.hadoop.fs.Path writeStoreFile(String fname, org.apache.hadoop.hbase.io.hfile.HFileContext context) throws IOException - Throws:
IOException
-
writeStoreFile
private org.apache.hadoop.fs.Path writeStoreFile(String fname, org.apache.hadoop.hbase.io.hfile.HFileContext context, org.apache.hadoop.hbase.io.hfile.CacheConfig cacheConfig) throws IOException - Throws:
IOException
-
writeStoreFileForSplit
private org.apache.hadoop.hbase.util.Pair<org.apache.hadoop.fs.Path,byte[]> writeStoreFileForSplit(org.apache.hadoop.fs.Path storeDir, org.apache.hadoop.hbase.io.hfile.HFileContext context) throws IOException - Throws:
IOException
-
generateKeyType
-
getElapsedTime
-