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
Modifier and TypeFieldDescriptionstatic final HBaseClassTestRule
(package private) static final String
private static final byte[]
(package private) static final int
private static final String
private static final byte[]
private static final byte[][]
org.junit.rules.TestName
(package private) static HBaseTestingUtil
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate void
addStartEndKeysForTest
(TreeMap<byte[], Integer> map, byte[] first, byte[] last) private org.apache.hadoop.hbase.client.TableDescriptor
buildHTD
(org.apache.hadoop.hbase.TableName tableName, org.apache.hadoop.hbase.regionserver.BloomType bloomType) private static void
createRandomDataFile
(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path, int size) 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) 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) private void
runTest
(String testName, org.apache.hadoop.hbase.client.TableDescriptor htd, boolean preCreateTable, byte[][] tableSplitKeys, byte[][][] hfileRanges, boolean useMap, boolean copyFiles, int depth) private void
runTest
(String testName, org.apache.hadoop.hbase.regionserver.BloomType bloomType, byte[][][] hfileRanges) private void
runTest
(String testName, org.apache.hadoop.hbase.regionserver.BloomType bloomType, byte[][][] hfileRanges, boolean useMap) private void
runTest
(String testName, org.apache.hadoop.hbase.regionserver.BloomType bloomType, byte[][] tableSplitKeys, byte[][][] hfileRanges) private void
runTest
(String testName, org.apache.hadoop.hbase.regionserver.BloomType bloomType, byte[][] tableSplitKeys, byte[][][] hfileRanges, boolean useMap) 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) static void
protected static void
static void
void
void
void
void
void
Test loading into a column family that does not exist.void
private void
testNonHfileFolder
(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.void
void
Test case that creates some regions and loads HFiles that cross the boundaries and have different region boundaries than the table pre-split.private void
testRegionCrossingHFileSplit
(org.apache.hadoop.hbase.regionserver.BloomType bloomType) void
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.void
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.void
Test case that creates some regions and loads HFiles that cross the boundaries of those regionsvoid
Test loading into a column family that has a ROW bloom filter.void
Test loading into a column family that has a ROWCOL bloom filter.void
Test case that creates some regions and loads HFiles that have different region boundaries than the table pre-split.void
Test case that creates some regions and loads HFiles that fit snugly inside those regionsvoid
void
void
void
void
private void
testSplitStoreFileWithDifferentEncoding
(org.apache.hadoop.hbase.io.encoding.DataBlockEncoding bulkloadEncoding, org.apache.hadoop.hbase.io.encoding.DataBlockEncoding cfEncoding) void
void
void
Test hfile splits with the favored nodesvoid
void
void
void
Test that tags survive through a bulk load that needs to split hfiles.void
private int
verifyHFile
(org.apache.hadoop.fs.Path p) private void
verifyHFileCreateTimeTS
(org.apache.hadoop.fs.Path p) private void
verifyHFileFavoriteNode
(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) 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
-