From 58dfa28fef3ac6c45dee63c4676ef06300e1e627 Mon Sep 17 00:00:00 2001 From: Zhihong Yu Date: Mon, 22 Aug 2011 18:03:34 +0000 Subject: [PATCH] HBASE-4065 TableOutputFormat ignores failure to create table instance (Brock Noland) git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1160351 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES.txt | 2 ++ .../org/apache/hadoop/hbase/mapreduce/TableOutputFormat.java | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/CHANGES.txt b/CHANGES.txt index 0153c52b5c8..d8e2df3070f 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -204,6 +204,8 @@ Release 0.91.0 - Unreleased (BenoƮt Sigoure) HBASE-4175 Fix FSUtils.createTableDescriptor() (Ramkrishna) HBASE-4008 Problem while stopping HBase (Akash Ashok) + HBASE-4065 TableOutputFormat ignores failure to create table instance + (Brock Noland) IMPROVEMENTS HBASE-3290 Max Compaction Size (Nicolas Spiegelberg via Stack) diff --git a/src/main/java/org/apache/hadoop/hbase/mapreduce/TableOutputFormat.java b/src/main/java/org/apache/hadoop/hbase/mapreduce/TableOutputFormat.java index a9e5a0ca67a..c10f85e4d8b 100644 --- a/src/main/java/org/apache/hadoop/hbase/mapreduce/TableOutputFormat.java +++ b/src/main/java/org/apache/hadoop/hbase/mapreduce/TableOutputFormat.java @@ -178,6 +178,9 @@ implements Configurable { public void setConf(Configuration otherConf) { this.conf = HBaseConfiguration.create(otherConf); String tableName = this.conf.get(OUTPUT_TABLE); + if(tableName == null || tableName.length() <= 0) { + throw new IllegalArgumentException("Must specify table name"); + } String address = this.conf.get(QUORUM_ADDRESS); String serverClass = this.conf.get(REGION_SERVER_CLASS); String serverImpl = this.conf.get(REGION_SERVER_IMPL); @@ -194,6 +197,7 @@ implements Configurable { LOG.info("Created table instance for " + tableName); } catch(IOException e) { LOG.error(e); + throw new RuntimeException(e); } } }