Package org.apache.hadoop.hbase.test
Class IntegrationTestTimeBoundedRequestsWithRegionReplicas
java.lang.Object
org.apache.hadoop.hbase.util.AbstractHBaseTool
org.apache.hadoop.hbase.IntegrationTestBase
org.apache.hadoop.hbase.IntegrationTestIngest
org.apache.hadoop.hbase.test.IntegrationTestTimeBoundedRequestsWithRegionReplicas
- All Implemented Interfaces:
org.apache.hadoop.conf.Configurable
,org.apache.hadoop.util.Tool
- Direct Known Subclasses:
IntegrationTestTimeBoundedMultiGetRequestsWithRegionReplicas
An IntegrationTest for doing reads with a timeout, to a read-only table with region replicas.
ChaosMonkey is run which kills the region servers and master, but ensures that meta region server
is not killed, and at most 2 region servers are dead at any point in time. The expected behavior
is that all reads with stale mode true will return before the timeout (5 sec by default). The
test fails if the read requests does not finish in time.
This test uses LoadTestTool to read and write the data from a single client but multiple threads. The data is written first, then we allow the region replicas to catch up. Then we start the reader threads doing get requests with stale mode true. Chaos Monkey is started after some delay (20 sec by default) after the reader threads are started so that there is enough time to fully cache meta. These parameters (and some other parameters from LoadTestTool) can be used to control behavior, given values are default:
-Dhbase.IntegrationTestTimeBoundedRequestsWithRegionReplicas.runtime=600000 -DIntegrationTestTimeBoundedRequestsWithRegionReplicas.num_regions_per_server=5 -DIntegrationTestTimeBoundedRequestsWithRegionReplicas.get_timeout_ms=5000 -DIntegrationTestTimeBoundedRequestsWithRegionReplicas.num_keys_per_server=2500 -DIntegrationTestTimeBoundedRequestsWithRegionReplicas.region_replication=3 -DIntegrationTestTimeBoundedRequestsWithRegionReplicas.num_read_threads=20 -DIntegrationTestTimeBoundedRequestsWithRegionReplicas.num_write_threads=20 -DIntegrationTestTimeBoundedRequestsWithRegionReplicas.num_regions_per_server=5 -DIntegrationTestTimeBoundedRequestsWithRegionReplicas.chaos_monkey_delay=20000Use this test with "serverKilling" ChaosMonkey. Sample usage:
hbase org.apache.hadoop.hbase.test.IntegrationTestTimeBoundedRequestsWithRegionReplicas -Dhbase.IntegrationTestTimeBoundedRequestsWithRegionReplicas.runtime=600000 -DIntegrationTestTimeBoundedRequestsWithRegionReplicas.num_write_threads=40 -DIntegrationTestTimeBoundedRequestsWithRegionReplicas.num_read_threads=40 -Dhbase.ipc.client.allowsInterrupt=true --monkey serverKilling
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Nested classes/interfaces inherited from class org.apache.hadoop.hbase.util.AbstractHBaseTool
org.apache.hadoop.hbase.util.AbstractHBaseTool.OptionsOrderComparator
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final String
protected static final long
protected static final long
protected static final int
protected static final String
private static final org.slf4j.Logger
private static final String
Fields inherited from class org.apache.hadoop.hbase.IntegrationTestIngest
cluster, DEFAULT_NUM_KEYS_PER_SERVER, DEFAULT_NUM_READ_THREADS, DEFAULT_NUM_WRITE_THREADS, DEFAULT_RUN_TIME, HIPHEN, JUNIT_RUN_TIME, LOAD_TEST_TOOL_INIT_ARGS, loadTool, NUM_KEYS_PER_SERVER_KEY, NUM_READ_THREADS_KEY, NUM_WRITE_THREADS_KEY, RUN_TIME_KEY
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 TypeMethodDescriptionprotected String[]
getArgsForLoadTestTool
(String mode, String modeSpecificArg, long startKey, long numKeys) protected MonkeyFactory
static void
protected void
runIngestTest
(long defaultRunTime, long keysPerServerPerIter, int colsPerKey, int recordSize, int writeThreads, int readThreads) void
setConf
(org.apache.hadoop.conf.Configuration conf) protected void
protected void
writeData
(int colsPerKey, int recordSize, int writeThreads, long startKey, long numKeys) Methods inherited from class org.apache.hadoop.hbase.IntegrationTestIngest
getArgsForLoadTestToolInitTable, getColumnFamilies, getMinServerCount, getNumKeys, getTablename, initTable, internalRunIngestTest, runTestFromCommandLine, setUpCluster, testIngest
Methods inherited from class org.apache.hadoop.hbase.IntegrationTestBase
addOptions, cleanUp, cleanUpCluster, cleanUpMonkey, cleanUpMonkey, doWork, getConf, getTestingUtil, loadMonkeyProperties, processBaseOptions, processOptions, setUp, setUpMonkey
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
-
TEST_NAME
-
DEFAULT_GET_TIMEOUT
- See Also:
-
GET_TIMEOUT_KEY
- See Also:
-
DEFAUL_CHAOS_MONKEY_DELAY
- See Also:
-
CHAOS_MONKEY_DELAY_KEY
- See Also:
-
DEFAULT_REGION_REPLICATION
- See Also:
-
-
Constructor Details
-
IntegrationTestTimeBoundedRequestsWithRegionReplicas
-
-
Method Details
-
startMonkey
- Overrides:
startMonkey
in classIntegrationTestBase
- Throws:
Exception
-
getDefaultMonkeyFactory
- Overrides:
getDefaultMonkeyFactory
in classIntegrationTestBase
-
setConf
- Specified by:
setConf
in interfaceorg.apache.hadoop.conf.Configurable
- Overrides:
setConf
in classorg.apache.hadoop.hbase.util.AbstractHBaseTool
-
writeData
protected void writeData(int colsPerKey, int recordSize, int writeThreads, long startKey, long numKeys) throws IOException - Throws:
IOException
-
runIngestTest
protected void runIngestTest(long defaultRunTime, long keysPerServerPerIter, int colsPerKey, int recordSize, int writeThreads, int readThreads) throws Exception - Overrides:
runIngestTest
in classIntegrationTestIngest
- Throws:
Exception
-
getArgsForLoadTestTool
protected String[] getArgsForLoadTestTool(String mode, String modeSpecificArg, long startKey, long numKeys) - Overrides:
getArgsForLoadTestTool
in classIntegrationTestIngest
-
main
- Throws:
Exception
-