1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.hadoop.hbase.mapred;
20
21 import java.io.IOException;
22
23 import org.apache.hadoop.hbase.client.HTable;
24 import org.apache.hadoop.hbase.client.Result;
25 import org.apache.hadoop.hbase.filter.Filter;
26 import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
27 import org.apache.hadoop.mapred.RecordReader;
28
29
30
31
32
33 public class TableRecordReader
34 implements RecordReader<ImmutableBytesWritable, Result> {
35
36 private TableRecordReaderImpl recordReaderImpl = new TableRecordReaderImpl();
37
38
39
40
41
42
43
44 public void restart(byte[] firstRow) throws IOException {
45 this.recordReaderImpl.restart(firstRow);
46 }
47
48
49
50
51
52
53 public void init() throws IOException {
54 this.recordReaderImpl.restart(this.recordReaderImpl.getStartRow());
55 }
56
57
58
59
60 public void setHTable(HTable htable) {
61 this.recordReaderImpl.setHTable(htable);
62 }
63
64
65
66
67 public void setInputColumns(final byte [][] inputColumns) {
68 this.recordReaderImpl.setInputColumns(inputColumns);
69 }
70
71
72
73
74 public void setStartRow(final byte [] startRow) {
75 this.recordReaderImpl.setStartRow(startRow);
76 }
77
78
79
80
81
82 public void setEndRow(final byte [] endRow) {
83 this.recordReaderImpl.setEndRow(endRow);
84 }
85
86
87
88
89 public void setRowFilter(Filter rowFilter) {
90 this.recordReaderImpl.setRowFilter(rowFilter);
91 }
92
93 public void close() {
94 this.recordReaderImpl.close();
95 }
96
97
98
99
100
101
102 public ImmutableBytesWritable createKey() {
103 return this.recordReaderImpl.createKey();
104 }
105
106
107
108
109
110
111 public Result createValue() {
112 return this.recordReaderImpl.createValue();
113 }
114
115 public long getPos() {
116
117
118
119 return this.recordReaderImpl.getPos();
120 }
121
122 public float getProgress() {
123
124 return this.recordReaderImpl.getPos();
125 }
126
127
128
129
130
131
132
133 public boolean next(ImmutableBytesWritable key, Result value)
134 throws IOException {
135 return this.recordReaderImpl.next(key, value);
136 }
137 }