Index: src/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperWrapper.java =================================================================== --- src/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperWrapper.java (revision 773812) +++ src/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperWrapper.java (working copy) @@ -20,6 +20,8 @@ package org.apache.hadoop.hbase.zookeeper; import java.io.IOException; +import java.net.InetAddress; +import java.net.UnknownHostException; import java.util.ArrayList; import java.util.List; import java.util.Properties; @@ -32,6 +34,7 @@ import org.apache.hadoop.hbase.HServerAddress; import org.apache.hadoop.hbase.HServerInfo; import org.apache.hadoop.hbase.util.Bytes; +import org.apache.hadoop.util.StringUtils; import org.apache.zookeeper.CreateMode; import org.apache.zookeeper.KeeperException; import org.apache.zookeeper.Watcher; @@ -158,6 +161,7 @@ // The clientPort option may come after the server.X hosts, so we need to // grab everything and then create the final host:port comma separated list. + boolean anyValid = false; for (Entry property : properties.entrySet()) { String key = property.getKey().toString().trim(); String value = property.getValue().toString().trim(); @@ -167,9 +171,20 @@ else if (key.startsWith("server.")) { String host = value.substring(0, value.indexOf(':')); servers.add(host); + try { + InetAddress.getByName(host); + anyValid = true; + } catch (UnknownHostException e) { + LOG.warn(StringUtils.stringifyException(e)); + } } } + if (!anyValid) { + LOG.error("no valid quorum servers found in " + ZOOKEEPER_CONFIG_NAME); + return; + } + if (clientPort == null) { LOG.error("no clientPort found in " + ZOOKEEPER_CONFIG_NAME); return; Index: src/java/org/apache/hadoop/hbase/mapred/TableInputFormatBase.java =================================================================== --- src/java/org/apache/hadoop/hbase/mapred/TableInputFormatBase.java (revision 773812) +++ src/java/org/apache/hadoop/hbase/mapred/TableInputFormatBase.java (working copy) @@ -305,6 +305,13 @@ } /** + * Allows subclasses to get the {@link HTable}. + */ + protected HTable getHTable() { + return this.table; + } + + /** * Allows subclasses to set the {@link HTable}. * * @param table to get the data from Index: src/java/org/apache/hadoop/hbase/mapred/TableInputFormat.java =================================================================== --- src/java/org/apache/hadoop/hbase/mapred/TableInputFormat.java (revision 773812) +++ src/java/org/apache/hadoop/hbase/mapred/TableInputFormat.java (working copy) @@ -30,6 +30,7 @@ import org.apache.hadoop.mapred.FileInputFormat; import org.apache.hadoop.mapred.JobConf; import org.apache.hadoop.mapred.JobConfigurable; +import org.apache.hadoop.util.StringUtils; /** * Convert HBase tabular data into a format that is consumable by Map/Reduce. @@ -58,7 +59,7 @@ try { setHTable(new HTable(new HBaseConfiguration(job), tableNames[0].getName())); } catch (Exception e) { - LOG.error(e); + LOG.error(StringUtils.stringifyException(e)); } } @@ -69,6 +70,12 @@ throw new IOException("expecting one table name"); } + // connected to table? + if (getHTable() == null) { + throw new IOException("could not connect to table '" + + tableNames[0].getName() + "'"); + } + // expecting at least one column String colArg = job.get(COLUMN_LIST); if (colArg == null || colArg.length() == 0) {