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
CHAOS_MONKEY_PROPS, monkey, MONKEY_LONG_OPT, monkeyProps, monkeyToUse, NO_CLUSTER_CLEANUP_LONG_OPT, noClusterCleanUp| Constructor and Description |
|---|
IntegrationTestTableSnapshotInputFormat() |
| Modifier and Type | Method and Description |
|---|---|
void |
cleanUp() |
protected java.util.Set<java.lang.String> |
getColumnFamilies()
Provides the name of the CFs that are protected from random Chaos monkey activity (alter)
|
TableName |
getTablename()
Provides the name of the table that is protected from random Chaos monkey activity
|
static void |
main(java.lang.String[] args) |
int |
runTestFromCommandLine() |
void |
setConf(Configuration conf) |
void |
setUp() |
void |
setUpCluster() |
addOptions, cleanUpCluster, cleanUpMonkey, cleanUpMonkey, doWork, getConf, getDefaultMonkeyFactory, getTestingUtil, processBaseOptions, processOptions, setUpMonkey, startMonkeypublic IntegrationTestTableSnapshotInputFormat()
public void setConf(Configuration conf)
public void setUp()
throws java.lang.Exception
setUp in class IntegrationTestBasejava.lang.Exceptionpublic void cleanUp()
throws java.lang.Exception
cleanUp in class IntegrationTestBasejava.lang.Exceptionpublic void setUpCluster()
throws java.lang.Exception
setUpCluster in class IntegrationTestBasejava.lang.Exceptionpublic int runTestFromCommandLine()
throws java.lang.Exception
runTestFromCommandLine in class IntegrationTestBasejava.lang.Exceptionpublic TableName getTablename()
IntegrationTestBasegetTablename in class IntegrationTestBaseprotected java.util.Set<java.lang.String> getColumnFamilies()
IntegrationTestBasegetColumnFamilies in class IntegrationTestBasepublic static void main(java.lang.String[] args)
throws java.lang.Exception
java.lang.Exception