Class TestHStoreFile
java.lang.Object
org.apache.hadoop.hbase.regionserver.TestHStoreFile
Test HStoreFile
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final int
private org.apache.hadoop.hbase.io.hfile.CacheConfig
private static final int
private static final org.apache.hadoop.hbase.util.ChecksumType
static final HBaseClassTestRule
private org.apache.hadoop.conf.Configuration
private static final char
private org.apache.hadoop.fs.FileSystem
private static final char
private static final String
private static final org.slf4j.Logger
org.junit.rules.TestName
private static org.apache.hadoop.fs.Path
(package private) byte[]
private static String
private static final HBaseTestingUtility
private org.apache.hadoop.fs.Path
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate void
assertOrdering
(Comparator<? super org.apache.hadoop.hbase.regionserver.HStoreFile> comparator, org.apache.hadoop.hbase.regionserver.HStoreFile... sfs) Assert that the given comparator orders the given storefiles in the same way that they're passed.private void
bloomWriteRead
(org.apache.hadoop.hbase.regionserver.StoreFileWriter writer, org.apache.hadoop.fs.FileSystem fs) private void
checkHalfHFile
(org.apache.hadoop.hbase.regionserver.HRegionFileSystem regionFs, org.apache.hadoop.hbase.regionserver.HStoreFile f) (package private) List<org.apache.hadoop.hbase.KeyValue>
getKeyValueSet
(long[] timestamps, int numRows, byte[] qualifier, byte[] family) Generate a list of KeyValues for testing based on given parametersprivate static org.apache.hadoop.hbase.regionserver.StoreFileScanner
getStoreFileScanner
(org.apache.hadoop.hbase.regionserver.StoreFileReader reader, boolean cacheBlocks, boolean pread) private org.apache.hadoop.hbase.regionserver.HStoreFile
mockStoreFile
(boolean bulkLoad, long size, long bulkTimestamp, long seqId, String path) Create a mock StoreFile with the given attributes.void
setUp()
private org.apache.hadoop.fs.Path
splitStoreFile
(org.apache.hadoop.hbase.regionserver.HRegionFileSystem regionFs, org.apache.hadoop.hbase.client.RegionInfo hri, String family, org.apache.hadoop.hbase.regionserver.HStoreFile sf, byte[] splitKey, boolean isTopRef) static void
void
Write a file and then assert that we can read from top and bottom halves using two <<<<<<< HEAD HalfMapFiles, as well as one HalfMapFile and one HFileLink file.void
void
void
void
Check if data block encoding information is saved correctly in HFile's file info.void
void
void
private void
testDataBlockSizeWithCompressionRatePredicator
(int expectedBlockCount, BiFunction<Integer, Integer, Boolean> validation) void
void
void
void
Test to ensure correctness when using StoreFile with multiple timestampsvoid
Test that our mechanism of writing store files in one region to reference store files in other regions works.void
This test creates an hfile and then the dir structures and files to verify that references to hfilelinks (created by snapshot clones) can be properly interpreted.void
Test for HBASE-8012void
void
static void
writeLargeStoreFile
(org.apache.hadoop.hbase.regionserver.StoreFileWriter writer, byte[] fam, byte[] qualifier, int rounds) private org.apache.hadoop.hbase.regionserver.StoreFileWriter
writeStoreFile
(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.hbase.io.hfile.CacheConfig cacheConf, org.apache.hadoop.fs.Path path, int numBlocks) private void
writeStoreFile
(org.apache.hadoop.hbase.regionserver.StoreFileWriter writer) static void
writeStoreFile
(org.apache.hadoop.hbase.regionserver.StoreFileWriter writer, byte[] fam, byte[] qualifier)
-
Field Details
-
CLASS_RULE
-
LOG
-
TEST_UTIL
-
cacheConf
-
ROOT_DIR
-
CKTYPE
-
CKBYTES
- See Also:
-
TEST_FAMILY
-
FIRST_CHAR
- See Also:
-
LAST_CHAR
- See Also:
-
name
-
conf
-
testDir
-
fs
-
SPLITKEY
byte[] SPLITKEY -
localFormatter
- See Also:
-
BLOCKSIZE_SMALL
- See Also:
-
-
Constructor Details
-
TestHStoreFile
public TestHStoreFile()
-
-
Method Details
-
setUp
- Throws:
IOException
-
tearDownAfterClass
-
testBasicHalfAndHFileLinkMapFile
Write a file and then assert that we can read from top and bottom halves using two <<<<<<< HEAD HalfMapFiles, as well as one HalfMapFile and one HFileLink file. ======= HalfMapFiles. >>>>>>> 16116fa35e... HBASE-24510 Remove HBaseTestCase and GenericTestUtils (#1859)- Throws:
Exception
-
writeStoreFile
private void writeStoreFile(org.apache.hadoop.hbase.regionserver.StoreFileWriter writer) throws IOException - Throws:
IOException
-
writeStoreFile
public static void writeStoreFile(org.apache.hadoop.hbase.regionserver.StoreFileWriter writer, byte[] fam, byte[] qualifier) throws IOException - Throws:
IOException
-
writeLargeStoreFile
public static void writeLargeStoreFile(org.apache.hadoop.hbase.regionserver.StoreFileWriter writer, byte[] fam, byte[] qualifier, int rounds) throws IOException - Throws:
IOException
-
testReference
Test that our mechanism of writing store files in one region to reference store files in other regions works.- Throws:
IOException
-
testStoreFileReference
- Throws:
Exception
-
testEmptyStoreFileRestrictKeyRanges
- Throws:
Exception
-
testHFileLink
- Throws:
IOException
-
testReferenceToHFileLink
This test creates an hfile and then the dir structures and files to verify that references to hfilelinks (created by snapshot clones) can be properly interpreted.- Throws:
IOException
-
checkHalfHFile
private void checkHalfHFile(org.apache.hadoop.hbase.regionserver.HRegionFileSystem regionFs, org.apache.hadoop.hbase.regionserver.HStoreFile f) throws IOException - Throws:
IOException
-
getStoreFileScanner
private static org.apache.hadoop.hbase.regionserver.StoreFileScanner getStoreFileScanner(org.apache.hadoop.hbase.regionserver.StoreFileReader reader, boolean cacheBlocks, boolean pread) -
bloomWriteRead
private void bloomWriteRead(org.apache.hadoop.hbase.regionserver.StoreFileWriter writer, org.apache.hadoop.fs.FileSystem fs) throws Exception - Throws:
Exception
-
testBloomFilter
- Throws:
Exception
-
testDeleteFamilyBloomFilter
- Throws:
Exception
-
testReseek
Test for HBASE-8012- Throws:
Exception
-
testBloomTypes
- Throws:
Exception
-
testSeqIdComparator
-
assertOrdering
private void assertOrdering(Comparator<? super org.apache.hadoop.hbase.regionserver.HStoreFile> comparator, org.apache.hadoop.hbase.regionserver.HStoreFile... sfs) Assert that the given comparator orders the given storefiles in the same way that they're passed. -
mockStoreFile
private org.apache.hadoop.hbase.regionserver.HStoreFile mockStoreFile(boolean bulkLoad, long size, long bulkTimestamp, long seqId, String path) Create a mock StoreFile with the given attributes. -
getKeyValueSet
List<org.apache.hadoop.hbase.KeyValue> getKeyValueSet(long[] timestamps, int numRows, byte[] qualifier, byte[] family) Generate a list of KeyValues for testing based on given parameters- Returns:
- the rows key-value list
-
testMultipleTimestamps
Test to ensure correctness when using StoreFile with multiple timestamps- Throws:
IOException
-
testCacheOnWriteEvictOnClose
- Throws:
Exception
-
splitStoreFile
private org.apache.hadoop.fs.Path splitStoreFile(org.apache.hadoop.hbase.regionserver.HRegionFileSystem regionFs, org.apache.hadoop.hbase.client.RegionInfo hri, String family, org.apache.hadoop.hbase.regionserver.HStoreFile sf, byte[] splitKey, boolean isTopRef) throws IOException - Throws:
IOException
-
writeStoreFile
private org.apache.hadoop.hbase.regionserver.StoreFileWriter writeStoreFile(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.hbase.io.hfile.CacheConfig cacheConf, org.apache.hadoop.fs.Path path, int numBlocks) throws IOException - Throws:
IOException
-
testDataBlockEncodingMetaData
Check if data block encoding information is saved correctly in HFile's file info.- Throws:
IOException
-
testDataBlockSizeEncoded
- Throws:
Exception
-
testDataBlockSizeCompressed
- Throws:
Exception
-
testDataBlockSizeUnCompressed
- Throws:
Exception
-
testDataBlockSizeWithCompressionRatePredicator
private void testDataBlockSizeWithCompressionRatePredicator(int expectedBlockCount, BiFunction<Integer, Integer, throws ExceptionBoolean> validation) - Throws:
Exception
-