1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.hadoop.hbase.regionserver;
19
20 import java.io.IOException;
21 import java.util.List;
22
23
24 import org.apache.hadoop.hbase.client.Get;
25 import org.apache.hadoop.hbase.client.Put;
26 import org.apache.hadoop.hbase.client.Result;
27 import org.apache.hadoop.hbase.client.ResultScanner;
28 import org.apache.hadoop.hbase.client.Scan;
29 import org.apache.omid.transaction.TableAccessWrapper;
30
31
32 public class RegionAccessWrapper implements TableAccessWrapper {
33
34 private final Region region;
35
36 public RegionAccessWrapper(Region region) {
37 this.region = region;
38 }
39
40 @Override
41 public Result[] get(List<Get> get) throws IOException {
42 Result[] results = new Result[get.size()];
43
44 int i = 0;
45 for (Get g : get) {
46 results[i++] = region.get(g);
47 }
48 return results;
49 }
50
51 @Override
52 public Result get(Get get) throws IOException {
53 return region.get(get);
54 }
55
56 @Override
57 public void put(Put put) throws IOException {
58 region.put(put);
59 }
60
61 @Override
62 public ResultScanner getScanner(Scan scan) throws IOException {
63 return null;
64 }
65
66 @Override
67 public void close() throws Exception {
68
69 }
70 }