Class TestHStoreFile
java.lang.Object
org.apache.hadoop.hbase.regionserver.TestHStoreFile
Test HStoreFile
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intprivate org.apache.hadoop.hbase.io.hfile.CacheConfigprivate static final intprivate static final org.apache.hadoop.hbase.util.ChecksumTypestatic final HBaseClassTestRuleprivate org.apache.hadoop.conf.Configurationprivate static final charprivate org.apache.hadoop.fs.FileSystemprivate static final charprivate static final Stringprivate static final org.slf4j.Loggerorg.junit.rules.TestNameprivate static org.apache.hadoop.fs.Path(package private) byte[]private static Stringprivate static final HBaseTestingUtilprivate org.apache.hadoop.fs.Path -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidassertOrdering(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 voidbloomWriteRead(org.apache.hadoop.hbase.regionserver.StoreFileWriter writer, org.apache.hadoop.fs.FileSystem fs) private voidcheckHalfHFile(org.apache.hadoop.hbase.regionserver.HRegionFileSystem regionFs, org.apache.hadoop.hbase.regionserver.HStoreFile f, org.apache.hadoop.hbase.regionserver.storefiletracker.StoreFileTracker sft) (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.StoreFileScannergetStoreFileScanner(org.apache.hadoop.hbase.regionserver.StoreFileReader reader, boolean cacheBlocks, boolean pread) private org.apache.hadoop.hbase.regionserver.HStoreFilemockStoreFile(boolean bulkLoad, long size, long bulkTimestamp, long seqId, String path) Create a mock StoreFile with the given attributes.voidsetUp()private org.apache.hadoop.fs.PathsplitStoreFile(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, org.apache.hadoop.hbase.regionserver.storefiletracker.StoreFileTracker sft) static voidvoidWrite a file and then assert that we can read from top and bottom halves using two HalfMapFiles, as well as one HalfMapFile and one HFileLink file.voidvoidvoidvoidCheck if data block encoding information is saved correctly in HFile's file info.voidvoidvoidprivate voidtestDataBlockSizeWithCompressionRatePredicator(int expectedBlockCount, BiFunction<Integer, Integer, Boolean> validation) voidvoidvoidvoidTest to ensure correctness when using StoreFile with multiple timestampsvoidTest that our mechanism of writing store files in one region to reference store files in other regions works.voidThis 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.voidTest for HBASE-8012voidvoidvoidstatic voidwriteLargeStoreFile(org.apache.hadoop.hbase.regionserver.StoreFileWriter writer, byte[] fam, byte[] qualifier, int rounds) private org.apache.hadoop.hbase.regionserver.StoreFileWriterwriteStoreFile(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.hbase.io.hfile.CacheConfig cacheConf, org.apache.hadoop.fs.Path path, int numBlocks) private voidwriteStoreFile(org.apache.hadoop.hbase.regionserver.StoreFileWriter writer) static voidwriteStoreFile(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 HalfMapFiles, as well as one HalfMapFile and one HFileLink file.- 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
-
testsample
-
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, org.apache.hadoop.hbase.regionserver.storefiletracker.StoreFileTracker sft) 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, org.apache.hadoop.hbase.regionserver.storefiletracker.StoreFileTracker sft) 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
-