public class IntegrationTestTableSnapshotInputFormat extends IntegrationTestBase
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
Modifier and Type | Field and Description |
---|---|
private static int |
DEFAULT_NUM_REGIONS |
private static String |
DEFAULT_TABLE_NAME |
private static byte[] |
END_ROW |
private static org.slf4j.Logger |
LOG |
private static byte[] |
MAPRED_END_ROW |
private static String |
MAPRED_IMPLEMENTATION |
private static byte[] |
MAPRED_START_ROW |
private static String |
MAPREDUCE_IMPLEMENTATION |
private static String |
MR_IMPLEMENTATION_KEY |
private static String |
NUM_REGIONS_KEY |
private static String |
SNAPSHOT_NAME_KEY |
private static byte[] |
START_ROW |
private static String |
TABLE_DIR_KEY |
private static String |
TABLE_NAME_KEY |
CHAOS_MONKEY_PROPS, monkey, MONKEY_LONG_OPT, monkeyProps, monkeyToUse, NO_CLUSTER_CLEANUP_LONG_OPT, noClusterCleanUp, util
Constructor and Description |
---|
IntegrationTestTableSnapshotInputFormat() |
Modifier and Type | Method and Description |
---|---|
void |
cleanUp() |
protected Set<String> |
getColumnFamilies()
Provides the name of the CFs that are protected from random Chaos monkey activity (alter)
|
org.apache.hadoop.hbase.TableName |
getTablename()
Provides the name of the table that is protected from random Chaos monkey activity
|
static void |
main(String[] args) |
int |
runTestFromCommandLine() |
void |
setConf(org.apache.hadoop.conf.Configuration conf) |
void |
setUp() |
void |
setUpCluster() |
addOptions, cleanUpCluster, cleanUpMonkey, cleanUpMonkey, doWork, getConf, getDefaultMonkeyFactory, getTestingUtil, loadMonkeyProperties, processBaseOptions, processOptions, setUpMonkey, startMonkey
addOption, addOptNoArg, addOptNoArg, addOptWithArg, addOptWithArg, addRequiredOption, addRequiredOptWithArg, addRequiredOptWithArg, doStaticMain, getOptionAsDouble, getOptionAsInt, getOptionAsInt, getOptionAsLong, getOptionAsLong, newParser, parseArgs, parseInt, parseLong, printUsage, printUsage, processOldArgs, run
private static final org.slf4j.Logger LOG
private static final String TABLE_NAME_KEY
private static final String DEFAULT_TABLE_NAME
private static final String SNAPSHOT_NAME_KEY
private static final String NUM_REGIONS_KEY
private static final String MR_IMPLEMENTATION_KEY
private static final String MAPRED_IMPLEMENTATION
private static final String MAPREDUCE_IMPLEMENTATION
private static final int DEFAULT_NUM_REGIONS
private static final String TABLE_DIR_KEY
private static final byte[] START_ROW
private static final byte[] END_ROW
private static final byte[] MAPRED_START_ROW
private static final byte[] MAPRED_END_ROW
public IntegrationTestTableSnapshotInputFormat()
public void setConf(org.apache.hadoop.conf.Configuration conf)
setConf
in interface org.apache.hadoop.conf.Configurable
setConf
in class org.apache.hadoop.hbase.util.AbstractHBaseTool
public void setUp() throws Exception
setUp
in class IntegrationTestBase
Exception
public void cleanUp() throws Exception
cleanUp
in class IntegrationTestBase
Exception
public void setUpCluster() throws Exception
setUpCluster
in class IntegrationTestBase
Exception
public int runTestFromCommandLine() throws Exception
runTestFromCommandLine
in class IntegrationTestBase
Exception
public org.apache.hadoop.hbase.TableName getTablename()
IntegrationTestBase
getTablename
in class IntegrationTestBase
protected Set<String> getColumnFamilies()
IntegrationTestBase
getColumnFamilies
in class IntegrationTestBase
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.