Package org.apache.hadoop.hbase.test
Class IntegrationTestLoadAndVerify
java.lang.Object
org.apache.hadoop.hbase.util.AbstractHBaseTool
org.apache.hadoop.hbase.IntegrationTestBase
org.apache.hadoop.hbase.test.IntegrationTestLoadAndVerify
- All Implemented Interfaces:
org.apache.hadoop.conf.Configurable
,org.apache.hadoop.util.Tool
- Direct Known Subclasses:
IntegrationTestWithCellVisibilityLoadAndVerify
A large test which loads a lot of data that has internal references, and verifies the data. In
load step, 200 map tasks are launched, which in turn write loadmapper.num_to_write (default 100K)
rows to an hbase table. Rows are written in blocks, for a total of 100 blocks. Each row in a
block, contains loadmapper.backrefs (default 50) references to random rows in the prev block.
Verify step is scans the table, and verifies that for every referenced row, the row is actually
there (no data loss). Failed rows are output from reduce to be saved in the job output dir in
hdfs and inspected later. This class can be run as a unit test, as an integration test, or from
the command line Originally taken from Apache Bigtop.
-
Nested Class Summary
Modifier and TypeClassDescriptionprivate static enum
static class
static class
static class
static class
Tool to search missing rows in WALs and hfiles.Nested classes/interfaces inherited from class org.apache.hadoop.hbase.util.AbstractHBaseTool
org.apache.hadoop.hbase.util.AbstractHBaseTool.OptionsOrderComparator
-
Field Summary
Modifier and TypeFieldDescription(package private) static final String
private String
private static final org.slf4j.Logger
private static final int
private static final int
private static final String
private static final int
private static final String
private static final int
private static final String
private static final long
private static final String
private static final int
(package private) static final String
private static final String
private static final String
private static final byte[]
private static final String
private static final byte[]
private String
Fields inherited from class org.apache.hadoop.hbase.IntegrationTestBase
CHAOS_MONKEY_PROPS, monkey, MONKEY_LONG_OPT, monkeyProps, monkeyToUse, NO_CLUSTER_CLEANUP_LONG_OPT, noClusterCleanUp, util
Fields inherited from class org.apache.hadoop.hbase.util.AbstractHBaseTool
cmdLineArgs, conf, EXIT_FAILURE, EXIT_SUCCESS, LONG_HELP_OPTION, options, SHORT_HELP_OPTION
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
protected org.apache.hadoop.mapreduce.Job
doLoad
(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.hbase.HTableDescriptor htd) private int
protected void
doVerify
(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.hbase.HTableDescriptor htd) Provides the name of the CFs that are protected from random Chaos monkey activity (alter)org.apache.hadoop.hbase.TableName
Provides the name of the table that is protected from random Chaos monkey activityorg.apache.hadoop.fs.Path
getTestDir
(String testName, String subdir) static void
void
protected void
processOptions
(org.apache.hbase.thirdparty.org.apache.commons.cli.CommandLine cmd) private static SortedSet<byte[]>
readFileToSearch
(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.FileStatus keyFileStatus, SortedSet<byte[]> result) (package private) static SortedSet<byte[]>
readKeysToSearch
(org.apache.hadoop.conf.Configuration conf) int
private static void
setJobScannerConf
(org.apache.hadoop.mapreduce.Job job) protected void
setMapperClass
(org.apache.hadoop.mapreduce.Job job) void
static long
swapLong
(long value) Converts a "long" value between endian systems.void
Methods inherited from class org.apache.hadoop.hbase.IntegrationTestBase
addOptions, cleanUp, cleanUpMonkey, cleanUpMonkey, doWork, getConf, getDefaultMonkeyFactory, getTestingUtil, loadMonkeyProperties, processBaseOptions, setUp, setUpMonkey, startMonkey
Methods inherited from class org.apache.hadoop.hbase.util.AbstractHBaseTool
addOption, addOptNoArg, addOptNoArg, addOptWithArg, addOptWithArg, addRequiredOption, addRequiredOptWithArg, addRequiredOptWithArg, doStaticMain, getOptionAsDouble, getOptionAsInt, getOptionAsInt, getOptionAsLong, getOptionAsLong, newParser, parseArgs, parseInt, parseLong, printUsage, processOldArgs, run, setConf
-
Field Details
-
LOG
-
TEST_NAME
- See Also:
-
TEST_FAMILY
-
TEST_QUALIFIER
-
NUM_TO_WRITE_KEY
- See Also:
-
NUM_TO_WRITE_DEFAULT
- See Also:
-
TABLE_NAME_KEY
- See Also:
-
TABLE_NAME_DEFAULT
- See Also:
-
NUM_BACKREFS_KEY
- See Also:
-
NUM_BACKREFS_DEFAULT
- See Also:
-
NUM_MAP_TASKS_KEY
- See Also:
-
NUM_REDUCE_TASKS_KEY
- See Also:
-
NUM_MAP_TASKS_DEFAULT
- See Also:
-
NUM_REDUCE_TASKS_DEFAULT
- See Also:
-
SCANNER_CACHING
- See Also:
-
MISSING_ROWS_TO_LOG
- See Also:
-
toRun
-
keysDir
-
FOUND_GROUP_KEY
- See Also:
-
SEARCHER_INPUTDIR_KEY
- See Also:
-
-
Constructor Details
-
IntegrationTestLoadAndVerify
public IntegrationTestLoadAndVerify()
-
-
Method Details
-
setUpCluster
- Specified by:
setUpCluster
in classIntegrationTestBase
- Throws:
Exception
-
cleanUpCluster
- Overrides:
cleanUpCluster
in classIntegrationTestBase
- Throws:
Exception
-
swapLong
Converts a "long" value between endian systems. Borrowed from Apache Commons IO- Parameters:
value
- value to convert- Returns:
- the converted value
-
doLoad
protected org.apache.hadoop.mapreduce.Job doLoad(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.hbase.HTableDescriptor htd) throws Exception - Throws:
Exception
-
setMapperClass
-
doVerify
protected void doVerify(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.hbase.HTableDescriptor htd) throws Exception - Throws:
Exception
-
readKeysToSearch
static SortedSet<byte[]> readKeysToSearch(org.apache.hadoop.conf.Configuration conf) throws IOException, InterruptedException - Throws:
IOException
InterruptedException
-
readFileToSearch
private static SortedSet<byte[]> readFileToSearch(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.FileStatus keyFileStatus, SortedSet<byte[]> result) throws IOException, InterruptedException - Throws:
IOException
InterruptedException
-
doSearch
- Throws:
Exception
-
setJobScannerConf
-
getTestDir
- Throws:
IOException
-
testLoadAndVerify
- Throws:
Exception
-
printUsage
- Overrides:
printUsage
in classorg.apache.hadoop.hbase.util.AbstractHBaseTool
-
processOptions
- Overrides:
processOptions
in classIntegrationTestBase
-
runTestFromCommandLine
- Specified by:
runTestFromCommandLine
in classIntegrationTestBase
- Throws:
Exception
-
getTablename
Description copied from class:IntegrationTestBase
Provides the name of the table that is protected from random Chaos monkey activity- Specified by:
getTablename
in classIntegrationTestBase
- Returns:
- table to not delete.
-
getColumnFamilies
Description copied from class:IntegrationTestBase
Provides the name of the CFs that are protected from random Chaos monkey activity (alter)- Specified by:
getColumnFamilies
in classIntegrationTestBase
- Returns:
- set of cf names to protect.
-
main
- Throws:
Exception
-