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