hbase git commit: HBASE-20295 fix NullPointException in TableOutputFormat.checkOutputSpecs
Repository: hbase Updated Branches: refs/heads/branch-2 2cfa344ab -> 10ed3f41f HBASE-20295 fix NullPointException in TableOutputFormat.checkOutputSpecs Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/10ed3f41 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/10ed3f41 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/10ed3f41 Branch: refs/heads/branch-2 Commit: 10ed3f41f5c19f996a33dd606950e647aebda7c6 Parents: 2cfa344 Author: michael.jin Authored: Thu Mar 29 07:06:10 2018 +0800 Committer: Michael Stack Committed: Sat Apr 7 09:30:52 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/10ed3f41/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..0a1928b 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());
hbase git commit: HBASE-20295 fix NullPointException in TableOutputFormat.checkOutputSpecs
Repository: hbase Updated Branches: refs/heads/branch-2.0 d396e4bc0 -> 57aaee5bb HBASE-20295 fix NullPointException in TableOutputFormat.checkOutputSpecs Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/57aaee5b Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/57aaee5b Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/57aaee5b Branch: refs/heads/branch-2.0 Commit: 57aaee5bbb846e2679b857329d2cb2d91cd29827 Parents: d396e4b Author: michael.jin Authored: Thu Mar 29 07:06:10 2018 +0800 Committer: Michael Stack Committed: Sat Apr 7 09:30:23 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/57aaee5b/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..0a1928b 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());
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 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 Authored: Thu Mar 29 07:06:10 2018 +0800 Committer: tedyu 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());