1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.hadoop.hbase;
20
21 import org.apache.hadoop.hbase.util.ChaosMonkey;
22 import org.apache.hadoop.hbase.util.ChaosMonkey.BatchRestartRs;
23 import org.apache.hadoop.hbase.util.ChaosMonkey.RestartActiveMaster;
24 import org.apache.hadoop.hbase.util.ChaosMonkey.RestartRandomRs;
25 import org.apache.hadoop.hbase.util.ChaosMonkey.RestartRsHoldingMeta;
26 import org.apache.hadoop.hbase.util.ChaosMonkey.RestartRsHoldingRoot;
27 import org.apache.hadoop.hbase.util.ChaosMonkey.RollingBatchRestartRs;
28 import org.junit.After;
29 import org.junit.Before;
30 import org.junit.Test;
31 import org.junit.experimental.categories.Category;
32
33
34
35
36
37
38
39 @Category(IntegrationTests.class)
40 public class IntegrationTestDataIngestSlowDeterministic extends IngestIntegrationTestBase {
41 private static final int SERVER_COUNT = 3;
42 private static final long DEFAULT_RUN_TIME = 30 * 60 * 1000;
43 private static final long CHAOS_EVERY_MS = 150 * 1000;
44
45 private ChaosMonkey monkey;
46
47 @Before
48 public void setUp() throws Exception {
49 super.setUp(SERVER_COUNT);
50 ChaosMonkey.Action[] actions = new ChaosMonkey.Action[] {
51 new RestartRandomRs(60000),
52 new BatchRestartRs(5000, 0.5f),
53 new RestartActiveMaster(5000),
54 new RollingBatchRestartRs(5000, 1.0f),
55 new RestartRsHoldingMeta(35000),
56 new RestartRsHoldingRoot(35000)
57 };
58 monkey = new ChaosMonkey(util, new ChaosMonkey.CompositeSequentialPolicy(
59 new ChaosMonkey.DoActionsOncePolicy(CHAOS_EVERY_MS, actions),
60 new ChaosMonkey.PeriodicRandomActionPolicy(CHAOS_EVERY_MS, actions)));
61 monkey.start();
62 }
63
64 @After
65 public void tearDown() throws Exception {
66 if (monkey != null) {
67 monkey.stop("tearDown");
68 monkey.waitForStop();
69 }
70 super.tearDown();
71 }
72
73 @Test
74 public void testDataIngest() throws Exception {
75 runIngestTest(DEFAULT_RUN_TIME, 2500, 10, 100, 5);
76 }
77 }