Class IntegrationTestBigLinkedList
- All Implemented Interfaces:
org.apache.hadoop.conf.Configurable
,org.apache.hadoop.util.Tool
- Direct Known Subclasses:
IntegrationTestBigLinkedListWithVisibility
,IntegrationTestReplication
This is an integration test borrowed from goraci, written by Keith Turner, which is in turn inspired by the Accumulo test called continous ingest (ci). The original source code can be found here:
- https://github.com/keith-turner/goraci
- https://github.com/enis/goraci/
Apache Accumulo [0] has a simple test suite that verifies that data is not lost at scale. This test suite is called continuous ingest. This test runs many ingest clients that continually create linked lists containing 25 million nodes. At some point the clients are stopped and a map reduce job is run to ensure no linked list has a hole. A hole indicates data was lost.
The nodes in the linked list are random. This causes each linked list to spread across the table. Therefore if one part of a table loses data, then it will be detected by references in another part of the table.
THE ANATOMY OF THE TEST
Below is rough sketch of how data is written. For specific details look at the Generator code.
- Write out 1 million nodes (1M is the configurable 'width' mentioned below)
- Flush the client
- Write out 1 million that reference previous million
- If this is the 25th set of 1 million nodes, then update 1st set of million to point to last (25 is configurable; its the 'wrap multiplier' referred to below)
- goto 1
The key is that nodes only reference flushed nodes. Therefore a node should never reference a missing node, even if the ingest client is killed at any point in time.
When running this test suite w/ Accumulo there is a script running in parallel called the Aggitator that randomly and continuously kills server processes. The outcome was that many data loss bugs were found in Accumulo by doing this. This test suite can also help find bugs that impact uptime and stability when run for days or weeks.
This test suite consists the following
- a few Java programs
- a little helper script to run the java programs
- a maven script to build it
When generating data, its best to have each map task generate a multiple of 25 million. The reason for this is that circular linked list are generated every 25M. Not generating a multiple in 25M will result in some nodes in the linked list not having references. The loss of an unreferenced node can not be detected.
Below is a description of the Java programs
Generator
- A map only job that generates data. As stated previously, its best to generate data in multiples of 25M. An option is also available to allow concurrent walkers to select and walk random flushed loops during this phase.Verify
- A map reduce job that looks for holes. Look at the counts after running.REFERENCED
andUNREFERENCED
are ok, anyUNDEFINED
counts are bad. Do not run at the same time as the Generator.Walker
- A standalone program that start following a linked list and emits timing info.Print
- A standalone program that prints nodes in the linked listDelete
- A standalone program that deletes a single node
ex:
./hbase org.apache.hadoop.hbase.test.IntegrationTestBigLinkedList loop 2 1 100000 /temp 1 1000 50 1 0
-
Nested Class Summary
Modifier and TypeClassDescription(package private) static class
private static class
private static class
A stand alone program that deletes a single node.(package private) static class
A Map only job that generates random linked list and stores them.(package private) static class
Executes Generate and Verify in a loop.private static class
A stand alone program that prints out portions of a list created byIntegrationTestBigLinkedList.Generator
(package private) static class
Tool to search missing rows in WALs and hfiles.(package private) static class
A Map Reduce job that verifies that the linked lists generated byIntegrationTestBigLinkedList.Generator
do not have any holes.private static class
A stand alone program that follows a linked list created byIntegrationTestBigLinkedList.Generator
and prints timing info.(package private) static class
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 byte[]
protected static final byte[]
protected static final byte[]
protected static final byte[]
private static final int
private static final String
protected static String
protected static byte[]
private static final String
private static final String
How many rows to write per map task.private static final String
private static final String
private static final int
protected static final byte[]
protected int
protected String[]
private static final int
protected static String
private static byte[]
protected String
private static final int
private static final int
The 'wrap multipler' default.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
private static IntegrationTestBigLinkedList.CINode
getCINode
(org.apache.hadoop.hbase.client.Result result, IntegrationTestBigLinkedList.CINode node) 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 activity(package private) static org.apache.hadoop.hbase.TableName
getTableName
(org.apache.hadoop.conf.Configuration conf) private static boolean
isMultiUnevenColumnFamilies
(org.apache.hadoop.conf.Configuration conf) static void
private void
protected void
processOptions
(org.apache.hbase.thirdparty.org.apache.commons.cli.CommandLine cmd) int
private static void
setJobConf
(org.apache.hadoop.mapreduce.Job job, int numMappers, long numNodes, Integer width, Integer wrapMultiplier, Integer numWalkers) static void
setJobScannerConf
(org.apache.hadoop.mapreduce.Job job) void
void
private void
usage()
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, printUsage, processOldArgs, run, setConf
-
Field Details
-
NO_KEY
-
TABLE_NAME_KEY
-
DEFAULT_TABLE_NAME
-
FAMILY_NAME
-
BIG_FAMILY_NAME
-
TINY_FAMILY_NAME
-
COLUMN_PREV
-
COLUMN_CLIENT
-
COLUMN_COUNT
-
GENERATOR_NUM_ROWS_PER_MAP_KEY
How many rows to write per map task. This has to be a multiple of 25M- See Also:
-
GENERATOR_NUM_MAPPERS_KEY
- See Also:
-
GENERATOR_WIDTH_KEY
- See Also:
-
GENERATOR_WRAP_KEY
- See Also:
-
CONCURRENT_WALKER_KEY
- See Also:
-
NUM_SLAVES_BASE
-
MISSING_ROWS_TO_LOG
- See Also:
-
WIDTH_DEFAULT
- See Also:
-
WRAP_DEFAULT
The 'wrap multipler' default.- See Also:
-
ROWKEY_LENGTH
- See Also:
-
CONCURRENT_WALKER_DEFAULT
- See Also:
-
toRun
-
otherArgs
-
-
Constructor Details
-
IntegrationTestBigLinkedList
public IntegrationTestBigLinkedList()
-
-
Method Details
-
getTableName
-
getCINode
private static IntegrationTestBigLinkedList.CINode getCINode(org.apache.hadoop.hbase.client.Result result, IntegrationTestBigLinkedList.CINode node) -
setUpCluster
- Specified by:
setUpCluster
in classIntegrationTestBase
- Throws:
Exception
-
cleanUpCluster
- Overrides:
cleanUpCluster
in classIntegrationTestBase
- Throws:
Exception
-
isMultiUnevenColumnFamilies
-
testContinuousIngest
- Throws:
IOException
Exception
-
usage
-
printCommands
-
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.
-
setJobConf
private static void setJobConf(org.apache.hadoop.mapreduce.Job job, int numMappers, long numNodes, Integer width, Integer wrapMultiplier, Integer numWalkers) -
setJobScannerConf
-
main
- Throws:
Exception
-