From dfc63998d20a956bf7a44ed6bcd7c495801fc4bf Mon Sep 17 00:00:00 2001 From: Zhihong Yu Date: Wed, 23 May 2012 16:00:28 +0000 Subject: [PATCH] HBASE-6069 TableInputFormatBase#createRecordReader() doesn't initialize TableRecordReader which causes NPE (Jie Huang) git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1341922 13f79535-47bb-0310-9956-ffa450edef68 --- .../hadoop/hbase/mapreduce/TableInputFormatBase.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/apache/hadoop/hbase/mapreduce/TableInputFormatBase.java b/src/main/java/org/apache/hadoop/hbase/mapreduce/TableInputFormatBase.java index f84c2ba7ba3..6054b36ecf9 100644 --- a/src/main/java/org/apache/hadoop/hbase/mapreduce/TableInputFormatBase.java +++ b/src/main/java/org/apache/hadoop/hbase/mapreduce/TableInputFormatBase.java @@ -20,6 +20,7 @@ package org.apache.hadoop.hbase.mapreduce; import java.io.IOException; +import java.io.InterruptedIOException; import java.net.InetAddress; import java.util.ArrayList; import java.util.HashMap; @@ -31,7 +32,6 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; -import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HServerAddress; import org.apache.hadoop.hbase.client.HTable; import org.apache.hadoop.hbase.client.Result; @@ -128,6 +128,11 @@ extends InputFormat { sc.setStopRow(tSplit.getEndRow()); trr.setScan(sc); trr.setHTable(table); + try { + trr.initialize(tSplit, context); + } catch (InterruptedException e) { + throw new InterruptedIOException(e.getMessage()); + } return trr; }