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); diff --git a/pom.xml b/pom.xml index 0e30078..5feae57 100644 --- a/pom.xml +++ b/pom.xml @@ -121,7 +121,7 @@ 2.5.0 ${basedir}/${hive.path.to.root}/testutils/hadoop 0.98.3-hadoop1 - 0.98.3-hadoop2 + 1.0.0 4.2.5 4.2.5 @@ -203,6 +203,10 @@ + hbase-1.0 + https://repository.apache.org/content/repositories/orgapachehbase-1052 + + sonatype-snapshot https://oss.sonatype.org/content/repositories/snapshots