1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.hadoop.hbase.util;
18
19 import static org.junit.Assert.assertEquals;
20
21 import org.apache.hadoop.hbase.testclassification.LargeTests;
22 import org.apache.hadoop.hbase.io.encoding.DataBlockEncoding;
23 import org.junit.Test;
24 import org.junit.experimental.categories.Category;
25 import org.junit.runner.RunWith;
26 import org.junit.runners.Parameterized;
27
28
29
30
31
32 @Category(LargeTests.class)
33 @RunWith(Parameterized.class)
34 public class TestMiniClusterLoadParallel
35 extends TestMiniClusterLoadSequential {
36
37 public TestMiniClusterLoadParallel(boolean isMultiPut,
38 DataBlockEncoding encoding) {
39 super(isMultiPut, encoding);
40 }
41
42 @Test(timeout=TIMEOUT_MS)
43 public void loadTest() throws Exception {
44 prepareForLoadTest();
45
46 readerThreads.linkToWriter(writerThreads);
47
48 writerThreads.start(0, numKeys, NUM_THREADS);
49 readerThreads.start(0, numKeys, NUM_THREADS);
50
51 writerThreads.waitForFinish();
52 readerThreads.waitForFinish();
53
54 assertEquals(0, writerThreads.getNumWriteFailures());
55 assertEquals(0, readerThreads.getNumReadFailures());
56 assertEquals(0, readerThreads.getNumReadErrors());
57 assertEquals(numKeys, readerThreads.getNumUniqueKeysVerified());
58 }
59
60 }