You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by te...@apache.org on 2018/03/30 14:08:32 UTC
hbase git commit: HBASE-20295 fix NullPointException in
TableOutputFormat.checkOutputSpecs
Repository: hbase
Updated Branches:
refs/heads/master cbd8b15e6 -> 53b4507c7
HBASE-20295 fix NullPointException in TableOutputFormat.checkOutputSpecs
Signed-off-by: tedyu <yu...@gmail.com>
Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/53b4507c
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/53b4507c
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/53b4507c
Branch: refs/heads/master
Commit: 53b4507c7949362d49a1b827f2cdf2b1e8cefa68
Parents: cbd8b15
Author: michael.jin <mi...@zoom.us>
Authored: Thu Mar 29 07:06:10 2018 +0800
Committer: tedyu <yu...@gmail.com>
Committed: Fri Mar 30 07:07:45 2018 -0700
----------------------------------------------------------------------
.../org/apache/hadoop/hbase/mapreduce/TableOutputFormat.java | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hbase/blob/53b4507c/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/TableOutputFormat.java
----------------------------------------------------------------------
diff --git a/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/TableOutputFormat.java b/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/TableOutputFormat.java
index 7598520..4eb2654 100644
--- a/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/TableOutputFormat.java
+++ b/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/TableOutputFormat.java
@@ -174,9 +174,13 @@ implements Configurable {
@Override
public void checkOutputSpecs(JobContext context) throws IOException,
InterruptedException {
+ Configuration hConf = context.getConfiguration();
+ if (hConf == null) {
+ hConf = this.conf;
+ }
- try (Admin admin = ConnectionFactory.createConnection(getConf()).getAdmin()) {
- TableName tableName = TableName.valueOf(this.conf.get(OUTPUT_TABLE));
+ try (Admin admin = ConnectionFactory.createConnection(hConf).getAdmin()) {
+ TableName tableName = TableName.valueOf(hConf.get(OUTPUT_TABLE));
if (!admin.tableExists(tableName)) {
throw new TableNotFoundException("Can't write, table does not exist:" +
tableName.getNameAsString());