Class IntegrationTestTableSnapshotInputFormat
java.lang.Object
org.apache.hadoop.hbase.util.AbstractHBaseTool
org.apache.hadoop.hbase.IntegrationTestBase
org.apache.hadoop.hbase.mapreduce.IntegrationTestTableSnapshotInputFormat
- All Implemented Interfaces:
org.apache.hadoop.conf.Configurable
,org.apache.hadoop.util.Tool
An integration test to test
TableSnapshotInputFormat
which enables reading directly from
snapshot files without going through hbase servers. This test creates a table and loads the table
with the rows ranging from 'aaa' to 'zzz', and for each row, sets the columns f1:(null) and
f2:(null) to be the the same as the row value.
aaa, f1: => aaa aaa, f2: => aaa aab, f1: => aab .... zzz, f2: => zzzThen the test creates a snapshot from this table, and overrides the values in the original table with values 'after_snapshot_value'. The test, then runs a mapreduce job over the snapshot with a scan start row 'bbb' and stop row 'yyy'. The data is saved in a single reduce output file, and inspected later to verify that the MR job has seen all the values from the snapshot.
These parameters can be used to configure the job:
"IntegrationTestTableSnapshotInputFormat.table" => the name of the table
"IntegrationTestTableSnapshotInputFormat.snapshot" => the name of the snapshot
"IntegrationTestTableSnapshotInputFormat.numRegions" => number of regions in the table to be
created (default, 32).
"IntegrationTestTableSnapshotInputFormat.tableDir" => temporary directory to restore the
snapshot files
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.hadoop.hbase.util.AbstractHBaseTool
org.apache.hadoop.hbase.util.AbstractHBaseTool.OptionsOrderComparator
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final int
private static final String
private static final byte[]
private static final org.slf4j.Logger
private static final byte[]
private static final String
private static final byte[]
private static final String
private static final String
private static final String
private static final String
private static final byte[]
private static final String
private static final 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
cleanUp()
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 activitystatic void
int
void
setConf
(org.apache.hadoop.conf.Configuration conf) void
setUp()
void
Methods inherited from class org.apache.hadoop.hbase.IntegrationTestBase
addOptions, cleanUpCluster, cleanUpMonkey, cleanUpMonkey, doWork, getConf, getDefaultMonkeyFactory, getTestingUtil, loadMonkeyProperties, processBaseOptions, processOptions, 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, printUsage, processOldArgs, run
-
Field Details
-
LOG
-
TABLE_NAME_KEY
- See Also:
-
DEFAULT_TABLE_NAME
- See Also:
-
SNAPSHOT_NAME_KEY
- See Also:
-
NUM_REGIONS_KEY
- See Also:
-
MR_IMPLEMENTATION_KEY
- See Also:
-
MAPRED_IMPLEMENTATION
- See Also:
-
MAPREDUCE_IMPLEMENTATION
- See Also:
-
DEFAULT_NUM_REGIONS
- See Also:
-
TABLE_DIR_KEY
- See Also:
-
START_ROW
-
END_ROW
-
MAPRED_START_ROW
-
MAPRED_END_ROW
-
-
Constructor Details
-
IntegrationTestTableSnapshotInputFormat
-
-
Method Details
-
setConf
- Specified by:
setConf
in interfaceorg.apache.hadoop.conf.Configurable
- Overrides:
setConf
in classorg.apache.hadoop.hbase.util.AbstractHBaseTool
-
setUp
- Overrides:
setUp
in classIntegrationTestBase
- Throws:
Exception
-
cleanUp
- Overrides:
cleanUp
in classIntegrationTestBase
- Throws:
Exception
-
setUpCluster
- Specified by:
setUpCluster
in classIntegrationTestBase
- Throws:
Exception
-
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
-