Package org.apache.hadoop.hbase.tool
Class TestBulkLoadHFiles
java.lang.Object
org.apache.hadoop.hbase.tool.TestBulkLoadHFiles
- Direct Known Subclasses:
TestBulkLoadHFilesSFT,TestSecureBulkLoadHFiles
Test cases for the "load" half of the HFileOutputFormat bulk load functionality. These tests run
faster than the full MR cluster tests in TestHFileOutputFormat
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final HBaseClassTestRule(package private) static final Stringprivate static final byte[](package private) static final intprivate static final Stringprivate static final byte[]private static final byte[][]org.junit.rules.TestName(package private) static HBaseTestingUtil -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddStartEndKeysForTest(TreeMap<byte[], Integer> map, byte[] first, byte[] last) private org.apache.hadoop.hbase.client.TableDescriptorbuildHTD(org.apache.hadoop.hbase.TableName tableName, org.apache.hadoop.hbase.regionserver.BloomType bloomType) private static voidcreateRandomDataFile(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path, int size) static intloadHFiles(String testName, org.apache.hadoop.hbase.client.TableDescriptor htd, HBaseTestingUtil util, byte[] fam, byte[] qual, boolean preCreateTable, byte[][] tableSplitKeys, byte[][][] hfileRanges, boolean useMap, boolean deleteFile, boolean copyFiles, int initRowCount, int factor, int depth) private voidrunTest(String testName, org.apache.hadoop.hbase.client.TableDescriptor htd, boolean preCreateTable, byte[][] tableSplitKeys, byte[][][] hfileRanges, boolean useMap, boolean copyFiles, int depth) private voidrunTest(String testName, org.apache.hadoop.hbase.regionserver.BloomType bloomType, byte[][][] hfileRanges) private voidrunTest(String testName, org.apache.hadoop.hbase.regionserver.BloomType bloomType, byte[][][] hfileRanges, boolean useMap) private voidrunTest(String testName, org.apache.hadoop.hbase.regionserver.BloomType bloomType, byte[][] tableSplitKeys, byte[][][] hfileRanges) private voidrunTest(String testName, org.apache.hadoop.hbase.regionserver.BloomType bloomType, byte[][] tableSplitKeys, byte[][][] hfileRanges, boolean useMap) private voidrunTest(String testName, org.apache.hadoop.hbase.TableName tableName, org.apache.hadoop.hbase.regionserver.BloomType bloomType, boolean preCreateTable, byte[][] tableSplitKeys, byte[][][] hfileRanges, boolean useMap, int depth) static voidprotected static voidstatic voidvoidvoidvoidvoidvoidTest loading into a column family that does not exist.voidprivate voidtestNonHfileFolder(String tableName, boolean preCreateTable) Write a random data file and a non-file in a dir with a valid family name but not part of the table families.voidvoidTest case that creates some regions and loads HFiles that cross the boundaries and have different region boundaries than the table pre-split.private voidtestRegionCrossingHFileSplit(org.apache.hadoop.hbase.regionserver.BloomType bloomType) voidTest case that creates some regions and loads HFiles that cross the boundaries have a ROW bloom filter and a different region boundaries than the table pre-split.voidTest case that creates some regions and loads HFiles that cross the boundaries have a ROWCOL bloom filter and a different region boundaries than the table pre-split.voidTest case that creates some regions and loads HFiles that cross the boundaries of those regionsvoidTest loading into a column family that has a ROW bloom filter.voidTest loading into a column family that has a ROWCOL bloom filter.voidTest case that creates some regions and loads HFiles that have different region boundaries than the table pre-split.voidTest case that creates some regions and loads HFiles that fit snugly inside those regionsvoidvoidvoidvoidvoidprivate voidtestSplitStoreFileWithDifferentEncoding(org.apache.hadoop.hbase.io.encoding.DataBlockEncoding bulkloadEncoding, org.apache.hadoop.hbase.io.encoding.DataBlockEncoding cfEncoding) voidvoidvoidTest hfile splits with the favored nodesvoidvoidvoidvoidTest that tags survive through a bulk load that needs to split hfiles.voidprivate intverifyHFile(org.apache.hadoop.fs.Path p) private voidverifyHFileCreateTimeTS(org.apache.hadoop.fs.Path p) private voidverifyHFileFavoriteNode(org.apache.hadoop.fs.Path p, org.apache.hadoop.hbase.client.AsyncTableRegionLocator regionLocator, org.apache.hadoop.fs.FileSystem fs) test split storefile with favorite node information
-
Field Details
-
CLASS_RULE
-
tn
-
QUALIFIER
-
FAMILY
-
NAMESPACE
- See Also:
-
EXPECTED_MSG_FOR_NON_EXISTING_FAMILY
- See Also:
-
MAX_FILES_PER_REGION_PER_FAMILY
- See Also:
-
SPLIT_KEYS
-
util
-
-
Constructor Details
-
TestBulkLoadHFiles
public TestBulkLoadHFiles()
-
-
Method Details
-
setUpBeforeClass
- Throws:
Exception
-
setupNamespace
- Throws:
Exception
-
tearDownAfterClass
- Throws:
Exception
-
testSimpleLoadWithMap
- Throws:
Exception
-
testSimpleLoad
Test case that creates some regions and loads HFiles that fit snugly inside those regions- Throws:
Exception
-
testSimpleLoadWithFileCopy
- Throws:
Exception
-
testRegionCrossingLoad
Test case that creates some regions and loads HFiles that cross the boundaries of those regions- Throws:
Exception
-
testRegionCrossingRowBloom
Test loading into a column family that has a ROW bloom filter.- Throws:
Exception
-
testRegionCrossingRowColBloom
Test loading into a column family that has a ROWCOL bloom filter.- Throws:
Exception
-
testSimpleHFileSplit
Test case that creates some regions and loads HFiles that have different region boundaries than the table pre-split.- Throws:
Exception
-
testRegionCrossingHFileSplit
Test case that creates some regions and loads HFiles that cross the boundaries and have different region boundaries than the table pre-split.- Throws:
Exception
-
testRegionCrossingHFileSplitRowBloom
Test case that creates some regions and loads HFiles that cross the boundaries have a ROW bloom filter and a different region boundaries than the table pre-split.- Throws:
Exception
-
testRegionCrossingHFileSplitRowColBloom
Test case that creates some regions and loads HFiles that cross the boundaries have a ROWCOL bloom filter and a different region boundaries than the table pre-split.- Throws:
Exception
-
testSplitALot
- Throws:
Exception
-
testRegionCrossingHFileSplit
private void testRegionCrossingHFileSplit(org.apache.hadoop.hbase.regionserver.BloomType bloomType) throws Exception - Throws:
Exception
-
buildHTD
private org.apache.hadoop.hbase.client.TableDescriptor buildHTD(org.apache.hadoop.hbase.TableName tableName, org.apache.hadoop.hbase.regionserver.BloomType bloomType) -
runTest
private void runTest(String testName, org.apache.hadoop.hbase.regionserver.BloomType bloomType, byte[][][] hfileRanges) throws Exception - Throws:
Exception
-
runTest
private void runTest(String testName, org.apache.hadoop.hbase.regionserver.BloomType bloomType, byte[][][] hfileRanges, boolean useMap) throws Exception - Throws:
Exception
-
runTest
private void runTest(String testName, org.apache.hadoop.hbase.regionserver.BloomType bloomType, byte[][] tableSplitKeys, byte[][][] hfileRanges) throws Exception - Throws:
Exception
-
runTest
private void runTest(String testName, org.apache.hadoop.hbase.regionserver.BloomType bloomType, byte[][] tableSplitKeys, byte[][][] hfileRanges, boolean useMap) throws Exception - Throws:
Exception
-
runTest
private void runTest(String testName, org.apache.hadoop.hbase.TableName tableName, org.apache.hadoop.hbase.regionserver.BloomType bloomType, boolean preCreateTable, byte[][] tableSplitKeys, byte[][][] hfileRanges, boolean useMap, int depth) throws Exception - Throws:
Exception
-
loadHFiles
public static int loadHFiles(String testName, org.apache.hadoop.hbase.client.TableDescriptor htd, HBaseTestingUtil util, byte[] fam, byte[] qual, boolean preCreateTable, byte[][] tableSplitKeys, byte[][][] hfileRanges, boolean useMap, boolean deleteFile, boolean copyFiles, int initRowCount, int factor, int depth) throws Exception - Throws:
Exception
-
runTest
private void runTest(String testName, org.apache.hadoop.hbase.client.TableDescriptor htd, boolean preCreateTable, byte[][] tableSplitKeys, byte[][][] hfileRanges, boolean useMap, boolean copyFiles, int depth) throws Exception - Throws:
Exception
-
testTagsSurviveBulkLoadSplit
Test that tags survive through a bulk load that needs to split hfiles. This test depends on the "hbase.client.rpc.codec" = KeyValueCodecWithTags so that the client can get tags in the responses.- Throws:
Exception
-
testNonexistentColumnFamilyLoad
Test loading into a column family that does not exist.- Throws:
Exception
-
testNonHfileFolderWithUnmatchedFamilyName
- Throws:
Exception
-
testNonHfileFolder
- Throws:
Exception
-
testNonHfileFolder
Write a random data file and a non-file in a dir with a valid family name but not part of the table families. we should we able to bulkload without getting the unmatched family exception. HBASE-13037/HBASE-13227- Throws:
Exception
-
createRandomDataFile
private static void createRandomDataFile(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path, int size) throws IOException - Throws:
IOException
-
testSplitStoreFile
- Throws:
IOException
-
testSplitStoreFileWithFavoriteNodes
Test hfile splits with the favored nodes- Throws:
IOException
-
testSplitStoreFileWithCreateTimeTS
- Throws:
IOException
-
testSplitStoreFileWithNoneToNone
- Throws:
IOException
-
testSplitStoreFileWithEncodedToEncoded
- Throws:
IOException
-
testSplitStoreFileWithEncodedToNone
- Throws:
IOException
-
testSplitStoreFileWithNoneToEncoded
- Throws:
IOException
-
testSplitStoreFileWithDifferentEncoding
private void testSplitStoreFileWithDifferentEncoding(org.apache.hadoop.hbase.io.encoding.DataBlockEncoding bulkloadEncoding, org.apache.hadoop.hbase.io.encoding.DataBlockEncoding cfEncoding) throws IOException - Throws:
IOException
-
verifyHFile
- Throws:
IOException
-
verifyHFileCreateTimeTS
- Throws:
IOException
-
verifyHFileFavoriteNode
private void verifyHFileFavoriteNode(org.apache.hadoop.fs.Path p, org.apache.hadoop.hbase.client.AsyncTableRegionLocator regionLocator, org.apache.hadoop.fs.FileSystem fs) throws IOException test split storefile with favorite node information- Throws:
IOException
-
addStartEndKeysForTest
-
testInferBoundaries
-
testLoadTooMayHFiles
- Throws:
Exception
-
testWithoutAnExistingTableAndCreateTableSetToNo
- Throws:
Exception
-
testTableWithCFNameStartWithUnderScore
- Throws:
Exception
-
testBulkLoadByFamily
- Throws:
Exception
-
testFailIfNeedSplitHFile
- Throws:
IOException
-