1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.hadoop.hbase.test;
20
21 import java.util.List;
22
23 import org.apache.hadoop.conf.Configuration;
24 import org.apache.hadoop.hbase.HBaseConfiguration;
25 import org.apache.hadoop.hbase.IntegrationTestingUtility;
26 import org.apache.hadoop.hbase.testclassification.IntegrationTests;
27 import org.apache.hadoop.hbase.util.LoadTestTool;
28 import org.apache.hadoop.util.ToolRunner;
29 import org.junit.experimental.categories.Category;
30
31 import com.google.common.collect.Lists;
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46 @Category(IntegrationTests.class)
47 public class IntegrationTestTimeBoundedMultiGetRequestsWithRegionReplicas
48 extends IntegrationTestTimeBoundedRequestsWithRegionReplicas {
49
50 @Override
51 protected String[] getArgsForLoadTestTool(String mode, String modeSpecificArg, long startKey,
52 long numKeys) {
53 List<String> args = Lists.newArrayList(super.getArgsForLoadTestTool(
54 mode, modeSpecificArg, startKey, numKeys));
55 String clazz = this.getClass().getSimpleName();
56 args.add("-" + LoadTestTool.OPT_MULTIGET);
57 args.add(conf.get(String.format("%s.%s", clazz, LoadTestTool.OPT_MULTIGET), "100"));
58
59 args.add("-" + LoadTestTool.OPT_NUM_REGIONS_PER_SERVER);
60 args.add(conf.get(String.format("%s.%s", clazz, LoadTestTool.OPT_NUM_REGIONS_PER_SERVER),
61 Integer.toString(LoadTestTool.DEFAULT_NUM_REGIONS_PER_SERVER)));
62
63 return args.toArray(new String[args.size()]);
64 }
65
66 public static void main(String args[]) throws Exception {
67 Configuration conf = HBaseConfiguration.create();
68 IntegrationTestingUtility.setUseDistributedCluster(conf);
69 int ret = ToolRunner.run(conf,
70 new IntegrationTestTimeBoundedMultiGetRequestsWithRegionReplicas(), args);
71 System.exit(ret);
72 }
73 }