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