1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.hadoop.hbase.regionserver.querymatcher;
19
20 import org.apache.hadoop.conf.Configuration;
21 import org.apache.hadoop.hbase.HBaseConfiguration;
22 import org.apache.hadoop.hbase.KeyValue;
23 import org.apache.hadoop.hbase.KeyValue.KVComparator;
24 import org.apache.hadoop.hbase.client.Get;
25 import org.apache.hadoop.hbase.client.Scan;
26 import org.apache.hadoop.hbase.util.Bytes;
27 import org.junit.Before;
28
29 public class AbstractTestScanQueryMatcher {
30
31 protected Configuration conf;
32
33 protected byte[] row1;
34 protected byte[] row2;
35 protected byte[] row3;
36 protected byte[] fam1;
37 protected byte[] fam2;
38 protected byte[] col1;
39 protected byte[] col2;
40 protected byte[] col3;
41 protected byte[] col4;
42 protected byte[] col5;
43
44 protected byte[] data;
45
46 protected Get get;
47
48 protected long ttl = Long.MAX_VALUE;
49 protected KVComparator rowComparator;
50 protected Scan scan;
51
52 @Before
53 public void setUp() throws Exception {
54 this.conf = HBaseConfiguration.create();
55 row1 = Bytes.toBytes("row1");
56 row2 = Bytes.toBytes("row2");
57 row3 = Bytes.toBytes("row3");
58 fam1 = Bytes.toBytes("fam1");
59 fam2 = Bytes.toBytes("fam2");
60 col1 = Bytes.toBytes("col1");
61 col2 = Bytes.toBytes("col2");
62 col3 = Bytes.toBytes("col3");
63 col4 = Bytes.toBytes("col4");
64 col5 = Bytes.toBytes("col5");
65
66 data = Bytes.toBytes("data");
67
68
69 get = new Get(row1);
70 get.addFamily(fam1);
71 get.addColumn(fam2, col2);
72 get.addColumn(fam2, col4);
73 get.addColumn(fam2, col5);
74 this.scan = new Scan(get);
75
76 rowComparator = KeyValue.COMPARATOR;
77 }
78 }