diff --git a/dev-support/generate-hadoopX-poms.sh b/dev-support/generate-hadoopX-poms.sh new file mode 100755 index 0000000..5880a57 --- /dev/null +++ b/dev-support/generate-hadoopX-poms.sh @@ -0,0 +1,111 @@ +#!/bin/bash +## +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +## + +# Generates an adjacent pom.xml with a haoop1 or a hadoop2 suffix +# which can then be used for generating hadoop1 or hadoop2 suitable +# hbase's. +# +# Here is how you would build an hbase against hadoop2 and publish +# the artifacts to your local repo: +# +# First run this script passing in current project version and what +# version you would like the generated artifacts to have. Include +# either -hadoop1 if built against hadoop1 or -hadoop2 if build against +# hadoop2. These substrings are expected as part of the new version. +# +# $ bash -x ./dev-support/generate-hadoopX-poms.sh 0.95.2-SNAPSHOT 0.95.2-hadoop2-SNAPSHOT +# +# This will generate new poms beside current pom.xml made from the +# origin pom.xml but with a hadoop1 or hadoop2 suffix dependent on +# what you passed for a new version. Now build passing generated +# pom name as the pom mvn should use. For example, say we were building +# hbase against hadoop2: +# +#$ mvn clean install -DskipTests -f pom.xml.hadoop2 +# + +# TODO: Generate new poms into target dirs so doesn't pollute src tree. +# It is a little awkward to do since parent pom needs to be able to find +# the child modules and the child modules need to be able to get to the +# parent. + +function usage { + echo "Usage: $0 CURRENT_VERSION NEW_VERSION" + echo "For example, $0 hbase-0.95.2-SNAPSHOT hbase-0.95.2-hadoop1-SNAPSHOT" + echo "Presumes VERSION has hadoop1 or hadoop2 in it." + exit 1 +} + +if [[ "$#" -ne 2 ]]; then usage; fi +old_hbase_version="$1" +new_hbase_version="$2" +# Get hadoop version from the new hbase version +hadoop_version=`echo "$new_hbase_version" | sed -n 's/.*-\(hadoop[12]\)-.*/\1/p'` +if [[ -z $hadoop_version ]]; then usage ; fi + +# Get dir to operate in +hbase_home="${HBASE_HOME}" +if [[ -z "$hbase_home" ]]; then + here="`dirname \"$0\"`" # relative + here="`( cd \"$here\" && pwd )`" # absolutized and normalized + if [ -z "$here" ] ; then + # error; for some reason, the path is not accessible + # to the script (e.g. permissions re-evaled after suid) + exit 1 # fail + fi + hbase_home="`dirname \"$here\"`" +fi + +# Now figure which profile to activate. +h1= +h2= +default='!hadoop.profile<\/name>' +notdefault='hadoop.profile<\/name>' +case "${hadoop_version}" in + hadoop1) + h1="${default}" + h2="${notdefault}2.0<\/value>" + ;; + hadoop2) + h1="${notdefault}1.1<\/value>" + h2="${default}" + ;; + *) echo "Unknown ${hadoop_version}" + usage + ;; +esac + +pom=pom.xml +nupom="$pom.$hadoop_version" +poms=`find $hbase_home -name ${pom}` +for p in $poms; do + nuname="`dirname $p`/${nupom}" + # Now we do search and replace of explicit strings. The best + # way of seeing what the below does is by doing a diff between + # the original pom and the generated pom (pom.xml.hadoop1 or + # pom.xml.hadoop2) + sed -e "s/\${compat.module}/hbase-${hadoop_version}-compat/" \ + -e "s/${old_hbase_version}/${new_hbase_version}/" \ + -e "s/\([^<]*\)/\1\/${nupom}/" \ + -e "s/\(relativePath\>\.\.\)/\1\/${nupom}/" \ + -e "s/.*name>.*/${h1}/" \ + -e "s/.*.*/${h2}/" \ + -e '/--Below formatting for .*poms\.sh--/d' \ + $p > "$nuname" +done diff --git a/hbase-assembly/pom.xml b/hbase-assembly/pom.xml index 07186b7..ae420dd 100644 --- a/hbase-assembly/pom.xml +++ b/hbase-assembly/pom.xml @@ -40,7 +40,7 @@ ${maven.assembly.version} - hbase-${pom.version} + hbase-${project.version} false true - hadoop-1.0 + hadoop-1.1 - !hadoop.profile + + !hadoop.profile @@ -176,8 +177,8 @@ hadoop-2.0 - hadoop.profile - 2.0 + + hadoop.profile2.0 diff --git a/hbase-common/pom.xml b/hbase-common/pom.xml index 8a0363c..e5007ab 100644 --- a/hbase-common/pom.xml +++ b/hbase-common/pom.xml @@ -187,14 +187,27 @@ commons-logging commons-logging - - org.slf4j - slf4j-api - - - org.slf4j - slf4j-log4j12 - + + commons-codec + commons-codec + compile + + + commons-lang + commons-lang + compile + + + commons-collections + commons-collections + 3.2.1 + compile + + + commons-io + commons-io + compile + @@ -218,7 +231,8 @@ hadoop-1.1 - !hadoop.profile + + !hadoop.profile @@ -260,8 +274,8 @@ hadoop-2.0 - hadoop.profile - 2.0 + + hadoop.profile2.0 diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/JVM.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/JVM.java index d91c8b2..a60d96c 100644 --- a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/JVM.java +++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/JVM.java @@ -27,10 +27,10 @@ import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import java.lang.reflect.Method; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; @@ -44,10 +44,8 @@ import org.apache.hadoop.classification.InterfaceStability; @InterfaceAudience.Public @InterfaceStability.Evolving -public class JVM -{ - static final Logger LOG = LoggerFactory.getLogger(JVM.class); - +public class JVM { + private static final Log LOG = LogFactory.getLog(JVM.class); private OperatingSystemMXBean osMbean; private static final boolean ibmvendor = diff --git a/hbase-examples/pom.xml b/hbase-examples/pom.xml index 94e5323..a763ccb 100644 --- a/hbase-examples/pom.xml +++ b/hbase-examples/pom.xml @@ -70,6 +70,24 @@ test + org.apache.hbase + hbase-protocol + compile + + + org.apache.hbase + hbase-client + compile + + + org.apache.zookeeper + zookeeper + + + com.google.protobuf + protobuf-java + + org.apache.hbase hbase-server @@ -84,12 +102,8 @@ libthrift - org.slf4j - slf4j-api - - - org.slf4j - slf4j-log4j12 + commons-logging + commons-logging @@ -117,7 +131,8 @@ if we can combine these profiles somehow --> hadoop-1.1 - !hadoop.profile + + !hadoop.profile @@ -139,8 +154,8 @@ if we can combine these profiles somehow --> hadoop-2.0 - hadoop.profile - 2.0 + + hadoop.profile2.0 diff --git a/hbase-hadoop1-compat/pom.xml b/hbase-hadoop1-compat/pom.xml index 8df2960..86900b4 100644 --- a/hbase-hadoop1-compat/pom.xml +++ b/hbase-hadoop1-compat/pom.xml @@ -118,16 +118,16 @@ limitations under the License. metrics-core - log4j - log4j - - org.apache.hadoop hadoop-test ${hadoop-one.version} true test + + commons-logging + commons-logging + diff --git a/hbase-hadoop2-compat/pom.xml b/hbase-hadoop2-compat/pom.xml index c0c9ef0..00c3583 100644 --- a/hbase-hadoop2-compat/pom.xml +++ b/hbase-hadoop2-compat/pom.xml @@ -168,6 +168,18 @@ limitations under the License. hadoop-minicluster ${hadoop-two.version} + + commons-lang + commons-lang + + + commons-logging + commons-logging + + + com.google.guava + guava + diff --git a/hbase-it/pom.xml b/hbase-it/pom.xml index a13b845..07b38e4 100644 --- a/hbase-it/pom.xml +++ b/hbase-it/pom.xml @@ -140,10 +140,43 @@ org.apache.hbase hbase-common + jar + + + org.apache.hbase + hbase-common test-jar org.apache.hbase + hbase-protocol + + + org.apache.hbase + hbase-client + + + com.google.guava + guava + + + commons-logging + commons-logging + + + commons-cli + commons-cli + + + org.apache.commons + commons-math + + + commons-lang + commons-lang + + + org.apache.hbase hbase-server @@ -175,6 +208,10 @@ test-jar test + + org.cloudera.htrace + htrace + @@ -200,7 +237,8 @@ hadoop-1.1 - !hadoop.profile + + !hadoop.profile @@ -242,8 +280,8 @@ hadoop-2.0 - hadoop.profile - 2.0 + + hadoop.profile2.0 diff --git a/hbase-prefix-tree/pom.xml b/hbase-prefix-tree/pom.xml index 6254be4..2eb00e3 100644 --- a/hbase-prefix-tree/pom.xml +++ b/hbase-prefix-tree/pom.xml @@ -78,6 +78,105 @@ org.apache.hbase hbase-common + + org.apache.hbase + hbase-hadoop-compat + + + org.apache.hbase + ${compat.module} + ${project.version} + + + com.google.guava + guava + + + commons-logging + commons-logging + + + + + hadoop-1.1 + + + + !hadoop.profile + + + + + org.apache.hadoop + hadoop-core + + + + + hadoop-1.0 + + + hadoop.profile + 1.0 + + + + + org.apache.hadoop + hadoop-core + + + + + + hadoop-2.0 + + + + hadoop.profile2.0 + + + + + org.apache.hadoop + hadoop-client + + + org.apache.hadoop + hadoop-annotations + + + + + + hadoop-3.0 + + + hadoop.profile + 3.0 + + + + 3.0-SNAPSHOT + + + + org.apache.hadoop + hadoop-common + + + org.apache.hadoop + hadoop-annotations + + + + diff --git a/hbase-server/pom.xml b/hbase-server/pom.xml index a4de5e4..eb6e72c 100644 --- a/hbase-server/pom.xml +++ b/hbase-server/pom.xml @@ -300,6 +300,14 @@ test-jar + commons-httpclient + commons-httpclient + + + commons-collections + commons-collections + + org.apache.hbase hbase-hadoop-compat @@ -330,6 +338,12 @@ com.yammer.metrics metrics-core + + + org.slf4j + slf4j-api + + com.google.guava @@ -420,14 +434,6 @@ jackson-xc - org.slf4j - slf4j-api - - - org.slf4j - slf4j-log4j12 - - tomcat jasper-compiler @@ -548,7 +554,8 @@ hadoop-1.1 - !hadoop.profile + + !hadoop.profile @@ -589,8 +596,8 @@ hadoop-2.0 - hadoop.profile - 2.0 + + hadoop.profile2.0 diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/thrift/HThreadedSelectorServerArgs.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/thrift/HThreadedSelectorServerArgs.java index f19ec5f..8c4ab61 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/thrift/HThreadedSelectorServerArgs.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/thrift/HThreadedSelectorServerArgs.java @@ -19,21 +19,19 @@ package org.apache.hadoop.hbase.thrift; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.conf.Configuration; import org.apache.thrift.server.TThreadedSelectorServer; import org.apache.thrift.transport.TNonblockingServerTransport; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; /** * A TThreadedSelectorServer.Args that reads hadoop configuration */ @InterfaceAudience.Private public class HThreadedSelectorServerArgs extends TThreadedSelectorServer.Args { - - private static final Logger LOG = - LoggerFactory.getLogger(TThreadedSelectorServer.class); + private static final Log LOG = LogFactory.getLog(TThreadedSelectorServer.class); /** * Number of selector threads for reading and writing socket diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterNoCluster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterNoCluster.java index 8741952..423c5c6 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterNoCluster.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterNoCluster.java @@ -65,8 +65,8 @@ import org.junit.BeforeClass; import org.junit.Test; import org.mockito.Mockito; import org.junit.experimental.categories.Category; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; /** * Standup the master and fake it to test various aspects of master function. @@ -78,7 +78,7 @@ import org.slf4j.LoggerFactory; */ @Category(MediumTests.class) public class TestMasterNoCluster { - private static Logger LOG = LoggerFactory.getLogger(TestMasterNoCluster.class); + private static final Log LOG = LogFactory.getLog(TestMasterNoCluster.class); private static final HBaseTestingUtility TESTUTIL = new HBaseTestingUtility(); @BeforeClass @@ -240,7 +240,7 @@ public class TestMasterNoCluster { * @throws IOException * @throws KeeperException * @throws InterruptedException - * @throws DeserializationException + * @throws DeserializationException * @throws ServiceException */ @Test (timeout=30000) diff --git a/pom.xml b/pom.xml index 361fbf5..761ade9 100644 --- a/pom.xml +++ b/pom.xml @@ -596,6 +596,9 @@ prepare-package + test-jar @@ -871,7 +874,9 @@ 2.4 2.6 1.1.1 - 2.1 + 2.2 + 3.2.1 + 3.0.1 2.1.2 12.0.1 1.8.8 @@ -883,7 +888,6 @@ 1.6.8 4.11 1.50 - 1.4.3 1.2.17 1.9.0 2.4.1 @@ -1036,6 +1040,12 @@ com.yammer.metrics metrics-core ${metrics-core.version} + + + org.slf4j + slf4j-api + + com.google.guava @@ -1043,6 +1053,16 @@ ${guava.version} + commons-collections + commons-collections + ${collections.version} + + + commons-httpclient + commons-httpclient + ${httpclient.version} + + commons-cli commons-cli ${commons-cli.version} @@ -1191,16 +1211,6 @@ ${jackson.version} - org.slf4j - slf4j-api - ${slf4j.version} - - - org.slf4j - slf4j-log4j12 - ${slf4j.version} - - + !hadoop.profile @@ -1433,7 +1450,6 @@ ${hadoop-one.version} - 1.4.3 hbase-hadoop1-compat src/main/assembly/hadoop-one-compat.xml @@ -1494,7 +1510,6 @@ 1.0.4 ${hadoop.version} - 1.4.3 hbase-hadoop1-compat src/main/assembly/hadoop-one-compat.xml @@ -1545,8 +1560,8 @@ hadoop-2.0 - hadoop.profile - 2.0 + + hadoop.profile2.0 @@ -1554,7 +1569,6 @@ ${hadoop-two.version} - 1.6.1 hbase-hadoop2-compat src/main/assembly/hadoop-two-compat.xml @@ -1612,7 +1626,6 @@ - 1.6.1 3.0.0-SNAPSHOT