diff --git a/hbase-handler/src/java/org/apache/hadoop/hive/hbase/HBaseStorageHandler.java b/hbase-handler/src/java/org/apache/hadoop/hive/hbase/HBaseStorageHandler.java index 3218639..9fe2b87 100644 --- a/hbase-handler/src/java/org/apache/hadoop/hive/hbase/HBaseStorageHandler.java +++ b/hbase-handler/src/java/org/apache/hadoop/hive/hbase/HBaseStorageHandler.java @@ -488,6 +488,14 @@ private void addHBaseDelegationToken(Configuration conf) throws IOException { } } + private static Class counterClass = null; + static { + try { + counterClass = Class.forName("org.cliffc.high_scale_lib.Counter"); + } catch (ClassNotFoundException cnfe) { + // this dependency is removed for HBase 1.0 + } + } @Override public void configureJobConf(TableDesc tableDesc, JobConf jobConf) { try { @@ -498,9 +506,13 @@ public void configureJobConf(TableDesc tableDesc, JobConf jobConf) { * will not be required once Hive bumps up its hbase version). At that time , we will * only need TableMapReduceUtil.addDependencyJars(jobConf) here. */ - TableMapReduceUtil.addDependencyJars( - jobConf, HBaseStorageHandler.class, TableInputFormatBase.class, - org.cliffc.high_scale_lib.Counter.class); // this will be removed for HBase 1.0 + if (counterClass != null) { + TableMapReduceUtil.addDependencyJars( + jobConf, HBaseStorageHandler.class, TableInputFormatBase.class, counterClass); + } else { + TableMapReduceUtil.addDependencyJars( + jobConf, HBaseStorageHandler.class, TableInputFormatBase.class); + } Set merged = new LinkedHashSet(jobConf.getStringCollection("tmpjars")); Job copy = new Job(jobConf);