this.output = output;
this.reporter = reporter;
}
public void run() {
LineReader lineReader = null;
try {
Text key = new Text();
Text val = new Text();
Text line = new Text();
lineReader = new LineReader((InputStream)clientIn_, job_);
// 3/4 Tool to Hadoop
while (lineReader.readLine(line) > 0) {
answer = line.getBytes();
splitKeyVal(answer, line.getLength(), key, val);
output.collect(key, val);
line.clear();
numRecWritten_++;
long now = System.currentTimeMillis();
if (now-lastStdoutReport > reporterOutDelay_) {
lastStdoutReport = now;
String hline = "Records R/W=" + numRecRead_ + "/" + numRecWritten_;
reporter.setStatus(hline);
logprintln(hline);
logflush();
}
}
if (lineReader != null) {
lineReader.close();
}
if (clientIn_ != null) {
clientIn_.close();
clientIn_ = null;
LOG.info("MROutputThread done");
}
} catch (Throwable th) {
outerrThreadsThrowable = th;
LOG.warn(StringUtils.stringifyException(th));
try {
if (lineReader != null) {
lineReader.close();
}
if (clientIn_ != null) {
clientIn_.close();
clientIn_ = null;
}