diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/Import.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/Import.java index 1033dace35b..15540c6671c 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/Import.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/Import.java @@ -231,18 +231,26 @@ public class Import extends Configured implements Tool { } // TODO: This is kind of ugly doing setup of ZKW just to read the clusterid. ZooKeeperWatcher zkw = null; + Exception ex = null; try { zkw = new ZooKeeperWatcher(conf, context.getTaskAttemptID().toString(), null); clusterIds = Collections.singletonList(ZKClusterId.getUUIDForCluster(zkw)); } catch (ZooKeeperConnectionException e) { + ex = e; LOG.error("Problem connecting to ZooKeper during task setup", e); } catch (KeeperException e) { + ex = e; LOG.error("Problem reading ZooKeeper data during task setup", e); } catch (IOException e) { + ex = e; LOG.error("Problem setting up task", e); } finally { if (zkw != null) zkw.close(); } + if (clusterIds == null) { + // exit early if setup fails + throw new RuntimeException(ex); + } } }