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
Nested ClassesModifier and TypeClassDescriptionprivate static enumstatic classstatic classstatic classstatic classTool 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
FieldsModifier and TypeFieldDescription(package private) static final Stringprivate Stringprivate static final org.slf4j.Loggerprivate static final intprivate static final intprivate static final Stringprivate static final intprivate static final Stringprivate static final intprivate static final Stringprivate static final longprivate static final Stringprivate static final int(package private) static final Stringprivate static final Stringprivate static final Stringprivate static final byte[]private static final Stringprivate static final byte[]private StringFields inherited from class org.apache.hadoop.hbase.IntegrationTestBase
CHAOS_MONKEY_PROPS, monkey, MONKEY_LONG_OPT, monkeyProps, monkeyToUse, NO_CLUSTER_CLEANUP_LONG_OPT, noClusterCleanUp, utilFields inherited from class org.apache.hadoop.hbase.util.AbstractHBaseTool
cmdLineArgs, conf, EXIT_FAILURE, EXIT_SUCCESS, LONG_HELP_OPTION, options, SHORT_HELP_OPTION -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected org.apache.hadoop.mapreduce.JobdoLoad(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.hbase.HTableDescriptor htd) private intprotected voiddoVerify(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.TableNameProvides the name of the table that is protected from random Chaos monkey activityorg.apache.hadoop.fs.PathgetTestDir(String testName, String subdir) static voidvoidprotected voidprocessOptions(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) intprivate static voidsetJobScannerConf(org.apache.hadoop.mapreduce.Job job) protected voidsetMapperClass(org.apache.hadoop.mapreduce.Job job) voidstatic longswapLong(long value) Converts a "long" value between endian systems.voidMethods inherited from class org.apache.hadoop.hbase.IntegrationTestBase
addOptions, cleanUp, cleanUpMonkey, cleanUpMonkey, doWork, getConf, getDefaultMonkeyFactory, getTestingUtil, loadMonkeyProperties, processBaseOptions, setUp, setUpMonkey, startMonkeyMethods 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:
setUpClusterin classIntegrationTestBase- Throws:
Exception
-
cleanUpCluster
- Overrides:
cleanUpClusterin 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:
IOExceptionInterruptedException
-
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:
IOExceptionInterruptedException
-
doSearch
- Throws:
Exception
-
setJobScannerConf
-
getTestDir
- Throws:
IOException
-
testLoadAndVerify
- Throws:
Exception
-
printUsage
- Overrides:
printUsagein classorg.apache.hadoop.hbase.util.AbstractHBaseTool
-
processOptions
- Overrides:
processOptionsin classIntegrationTestBase
-
runTestFromCommandLine
- Specified by:
runTestFromCommandLinein classIntegrationTestBase- Throws:
Exception
-
getTablename
Description copied from class:IntegrationTestBaseProvides the name of the table that is protected from random Chaos monkey activity- Specified by:
getTablenamein classIntegrationTestBase- Returns:
- table to not delete.
-
getColumnFamilies
Description copied from class:IntegrationTestBaseProvides the name of the CFs that are protected from random Chaos monkey activity (alter)- Specified by:
getColumnFamiliesin classIntegrationTestBase- Returns:
- set of cf names to protect.
-
main
- Throws:
Exception
-