ACCUMULO-2126 Hadoop profile names should be consistent across branches. Changes naming scheme to be by Hadoop generation, i.e. hadoop-1 and hadoop-2.
Adds ability to either rely on default or to specify default by profile, i.e. hadoop.profile=1 on 1.4. Adds a more helpful error message when the provided hadoop.profile doesn't match one of our expected options. Signed-off-by: Mike Drob <md...@cloudera.com> Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/71f150a7 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/71f150a7 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/71f150a7 Branch: refs/heads/1.6.0-SNAPSHOT Commit: 71f150a777f9fb125fd72e51a23b11ed1f48d5c2 Parents: 65d5fba Author: Sean Busbey <bus...@cloudera.com> Authored: Thu Jan 2 16:54:03 2014 -0600 Committer: Mike Drob <md...@cloudera.com> Committed: Mon Jan 6 15:58:05 2014 -0800 ---------------------------------------------------------------------- README | 8 +++--- pom.xml | 54 +++++++++++++++++++++++++++++++++------- src/core/pom.xml | 35 ++++++++++++++++++++------ src/examples/simple/pom.xml | 35 ++++++++++++++++++++------ src/minicluster/pom.xml | 35 ++++++++++++++++++++------ src/proxy/pom.xml | 35 ++++++++++++++++++++------ src/server/pom.xml | 35 ++++++++++++++++++++------ src/start/pom.xml | 35 ++++++++++++++++++++------ 8 files changed, 217 insertions(+), 55 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/71f150a7/README ---------------------------------------------------------------------- diff --git a/README b/README index 08bac4c..f32d606 100644 --- a/README +++ b/README @@ -21,11 +21,11 @@ file for the necessary components. Run "mvn package && mvn assembly:single -N". By default, Accumulo compiles against Hadoop 0.20.203.0. To compile against a different version -that is compatible with Hadoop 1.0, specify hadoop.version on the command line, +that is compatible with Hadoop 1, specify hadoop.version on the command line, e.g. "-Dhadoop.version=0.20.205.0" or "-Dhadoop.version=1.1.0". To compile -against Hadoop 2.0, specify "-Dhadoop.profile=2.0". By default this uses -2.2.0. To compile against a different 2.0-compatible version, specify -the profile and version, e.g. "-Dhadoop.profile=2.0 -Dhadoop.version=0.23.5". +against Hadoop 2, specify "-Dhadoop.profile=2". By default this uses +2.2.0. To compile against a different Hadoop 2-compatible version, specify +the profile and version, e.g. "-Dhadoop.profile=2 -Dhadoop.version=0.23.5". If you are running on another Unix-like operating system (OSX, etc) then you may wish to build the native libraries. They are not strictly necessary http://git-wip-us.apache.org/repos/asf/accumulo/blob/71f150a7/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index 7d3dc82..92d8106 100644 --- a/pom.xml +++ b/pom.xml @@ -63,6 +63,12 @@ <requireMavenVersion> <version>[2.0.9,)</version> </requireMavenVersion> + <requireProperty> + <property>hadoop.profile</property> + <regex>(1|2)</regex> + <regexMessage>You should specify the Hadoop profile by major Hadoop generation, i.e. 1 or 2, not by a version number. + Use hadoop.version to use a particular Hadoop version within that generation. See README for more details.</regexMessage> + </requireProperty> </rules> </configuration> </execution> @@ -707,16 +713,20 @@ </plugins> </build> </profile> - <!-- profile for building against Hadoop 1.0.x - Activate by not specifying hadoop.profile --> + <!-- profile for our default Hadoop build + unfortunately, has to duplicate one of our + specified profiles. see MNG-3328 --> <profile> - <id>hadoop-1.0</id> + <id>hadoop-default</id> <activation> <property> <name>!hadoop.profile</name> </property> </activation> <properties> + <!-- Denotes intention and allows the enforcer plugin to pass when + the user is relying on default behavior; won't work to activate profile --> + <hadoop.profile>1</hadoop.profile> <hadoop.version>0.20.203.0</hadoop.version> <slf4j.version>1.4.3</slf4j.version> </properties> @@ -731,14 +741,40 @@ </dependencies> </dependencyManagement> </profile> - <!-- profile for building against Hadoop 2.0.x - Activate using: mvn -Dhadoop.profile=2.0 --> + <!-- profile for building against Hadoop 1.x + XXX Since this is the default, make sure to sync hadoop-default when changing. + Activate using: mvn -Dhadoop.profile=1 --> <profile> - <id>hadoop-2.0</id> + <id>hadoop-1</id> <activation> <property> <name>hadoop.profile</name> - <value>2.0</value> + <value>1</value> + </property> + </activation> + <properties> + <hadoop.version>0.20.203.0</hadoop.version> + <slf4j.version>1.4.3</slf4j.version> + </properties> + <dependencyManagement> + <dependencies> + <dependency> + <groupId>org.apache.hadoop</groupId> + <artifactId>hadoop-core</artifactId> + <version>${hadoop.version}</version> + <scope>provided</scope> + </dependency> + </dependencies> + </dependencyManagement> + </profile> + <!-- profile for building against Hadoop 2.x + Activate using: mvn -Dhadoop.profile=2 --> + <profile> + <id>hadoop-2</id> + <activation> + <property> + <name>hadoop.profile</name> + <value>2</value> </property> </activation> <properties> @@ -943,9 +979,9 @@ <properties> <targetJdk>1.6</targetJdk> - <!-- overwritten in profiles hadoop-1.0 or hadoop-2.0 --> + <!-- overwritten in profiles hadoop-1 or hadoop-2 --> <hadoop.version>0.20.203.0</hadoop.version> - <!-- overwritten in profiles hadoop-1.0 or hadoop-2.0 --> + <!-- overwritten in profiles hadoop-1 or hadoop-2 --> <slf4j.version>1.4.3</slf4j.version> <zookeeper.version>3.3.1</zookeeper.version> </properties> http://git-wip-us.apache.org/repos/asf/accumulo/blob/71f150a7/src/core/pom.xml ---------------------------------------------------------------------- diff --git a/src/core/pom.xml b/src/core/pom.xml index 77a4a72..11ce09b 100644 --- a/src/core/pom.xml +++ b/src/core/pom.xml @@ -78,15 +78,18 @@ </build> <profiles> - <!-- profile for building against Hadoop 1.0.x - Activate by not specifying hadoop.profile --> <profile> - <id>hadoop-1.0</id> + <id>hadoop-default</id> <activation> <property> <name>!hadoop.profile</name> </property> </activation> + <properties> + <!-- Denotes intention and allows the enforcer plugin to pass when + the user is relying on default behavior; won't work to activate profile --> + <hadoop.profile>1</hadoop.profile> + </properties> <dependencies> <dependency> <groupId>org.apache.hadoop</groupId> @@ -94,14 +97,32 @@ </dependency> </dependencies> </profile> - <!-- profile for building against Hadoop 2.0.x - Activate using: mvn -Dhadoop.profile=2.0 --> + <!-- profile for building against Hadoop 1.x + XXX Since this is the default, make sure to sync hadoop-default when changing. + Activate using: mvn -Dhadoop.profile=1 --> <profile> - <id>hadoop-2.0</id> + <id>hadoop-1</id> <activation> <property> <name>hadoop.profile</name> - <value>2.0</value> + <value>1</value> + </property> + </activation> + <dependencies> + <dependency> + <groupId>org.apache.hadoop</groupId> + <artifactId>hadoop-core</artifactId> + </dependency> + </dependencies> + </profile> + <!-- profile for building against Hadoop 2.x + Activate using: mvn -Dhadoop.profile=2 --> + <profile> + <id>hadoop-2</id> + <activation> + <property> + <name>hadoop.profile</name> + <value>2</value> </property> </activation> <dependencies> http://git-wip-us.apache.org/repos/asf/accumulo/blob/71f150a7/src/examples/simple/pom.xml ---------------------------------------------------------------------- diff --git a/src/examples/simple/pom.xml b/src/examples/simple/pom.xml index 6834b87..6ef7741 100644 --- a/src/examples/simple/pom.xml +++ b/src/examples/simple/pom.xml @@ -30,15 +30,18 @@ <name>examples-simple</name> <profiles> - <!-- profile for building against Hadoop 1.0.x - Activate by not specifying hadoop.profile --> <profile> - <id>hadoop-1.0</id> + <id>hadoop-default</id> <activation> <property> <name>!hadoop.profile</name> </property> </activation> + <properties> + <!-- Denotes intention and allows the enforcer plugin to pass when + the user is relying on default behavior; won't work to activate profile --> + <hadoop.profile>1</hadoop.profile> + </properties> <dependencies> <dependency> <groupId>org.apache.hadoop</groupId> @@ -46,14 +49,32 @@ </dependency> </dependencies> </profile> - <!-- profile for building against Hadoop 2.0.x - Activate using: mvn -Dhadoop.profile=2.0 --> + <!-- profile for building against Hadoop 1.x + XXX Since this is the default, make sure to sync hadoop-default when changing. + Activate using: mvn -Dhadoop.profile=1 --> <profile> - <id>hadoop-2.0</id> + <id>hadoop-1</id> <activation> <property> <name>hadoop.profile</name> - <value>2.0</value> + <value>1</value> + </property> + </activation> + <dependencies> + <dependency> + <groupId>org.apache.hadoop</groupId> + <artifactId>hadoop-core</artifactId> + </dependency> + </dependencies> + </profile> + <!-- profile for building against Hadoop 2.x + Activate using: mvn -Dhadoop.profile=2 --> + <profile> + <id>hadoop-2</id> + <activation> + <property> + <name>hadoop.profile</name> + <value>2</value> </property> </activation> <dependencies> http://git-wip-us.apache.org/repos/asf/accumulo/blob/71f150a7/src/minicluster/pom.xml ---------------------------------------------------------------------- diff --git a/src/minicluster/pom.xml b/src/minicluster/pom.xml index 3c8843d..a956fdd 100644 --- a/src/minicluster/pom.xml +++ b/src/minicluster/pom.xml @@ -51,15 +51,18 @@ </build> <profiles> - <!-- profile for building against Hadoop 1.0.x - Activate by not specifying hadoop.profile --> <profile> - <id>hadoop-1.0</id> + <id>hadoop-default</id> <activation> <property> <name>!hadoop.profile</name> </property> </activation> + <properties> + <!-- Denotes intention and allows the enforcer plugin to pass when + the user is relying on default behavior; won't work to activate profile --> + <hadoop.profile>1</hadoop.profile> + </properties> <dependencies> <dependency> <groupId>org.apache.hadoop</groupId> @@ -67,14 +70,32 @@ </dependency> </dependencies> </profile> - <!-- profile for building against Hadoop 2.0.x - Activate using: mvn -Dhadoop.profile=2.0 --> + <!-- profile for building against Hadoop 1.x + XXX Since this is the default, make sure to sync hadoop-default when changing. + Activate using: mvn -Dhadoop.profile=1 --> <profile> - <id>hadoop-2.0</id> + <id>hadoop-1</id> <activation> <property> <name>hadoop.profile</name> - <value>2.0</value> + <value>1</value> + </property> + </activation> + <dependencies> + <dependency> + <groupId>org.apache.hadoop</groupId> + <artifactId>hadoop-core</artifactId> + </dependency> + </dependencies> + </profile> + <!-- profile for building against Hadoop 2.x + Activate using: mvn -Dhadoop.profile=2 --> + <profile> + <id>hadoop-2</id> + <activation> + <property> + <name>hadoop.profile</name> + <value>2</value> </property> </activation> <dependencies> http://git-wip-us.apache.org/repos/asf/accumulo/blob/71f150a7/src/proxy/pom.xml ---------------------------------------------------------------------- diff --git a/src/proxy/pom.xml b/src/proxy/pom.xml index eb88e6b..466d88a 100644 --- a/src/proxy/pom.xml +++ b/src/proxy/pom.xml @@ -119,15 +119,18 @@ </dependencies> <profiles> - <!-- profile for building against Hadoop 1.0.x - Activate by not specifying hadoop.profile --> <profile> - <id>hadoop-1.0</id> + <id>hadoop-default</id> <activation> <property> <name>!hadoop.profile</name> </property> </activation> + <properties> + <!-- Denotes intention and allows the enforcer plugin to pass when + the user is relying on default behavior; won't work to activate profile --> + <hadoop.profile>1</hadoop.profile> + </properties> <dependencies> <dependency> <groupId>org.apache.hadoop</groupId> @@ -135,14 +138,32 @@ </dependency> </dependencies> </profile> - <!-- profile for building against Hadoop 2.0.x - Activate using: mvn -Dhadoop.profile=2.0 --> + <!-- profile for building against Hadoop 1.x + XXX Since this is the default, make sure to sync hadoop-default when changing. + Activate using: mvn -Dhadoop.profile=1 --> <profile> - <id>hadoop-2.0</id> + <id>hadoop-1</id> <activation> <property> <name>hadoop.profile</name> - <value>2.0</value> + <value>1</value> + </property> + </activation> + <dependencies> + <dependency> + <groupId>org.apache.hadoop</groupId> + <artifactId>hadoop-core</artifactId> + </dependency> + </dependencies> + </profile> + <!-- profile for building against Hadoop 2.x + Activate using: mvn -Dhadoop.profile=2 --> + <profile> + <id>hadoop-2</id> + <activation> + <property> + <name>hadoop.profile</name> + <value>2</value> </property> </activation> <dependencies> http://git-wip-us.apache.org/repos/asf/accumulo/blob/71f150a7/src/server/pom.xml ---------------------------------------------------------------------- diff --git a/src/server/pom.xml b/src/server/pom.xml index 672a6d3..b58affc 100644 --- a/src/server/pom.xml +++ b/src/server/pom.xml @@ -111,15 +111,18 @@ </dependencies> <profiles> - <!-- profile for building against Hadoop 1.0.x - Activate by not specifying hadoop.profile --> <profile> - <id>hadoop-1.0</id> + <id>hadoop-default</id> <activation> <property> <name>!hadoop.profile</name> </property> </activation> + <properties> + <!-- Denotes intention and allows the enforcer plugin to pass when + the user is relying on default behavior; won't work to activate profile --> + <hadoop.profile>1</hadoop.profile> + </properties> <dependencies> <dependency> <groupId>org.apache.hadoop</groupId> @@ -127,14 +130,32 @@ </dependency> </dependencies> </profile> - <!-- profile for building against Hadoop 2.0.x - Activate using: mvn -Dhadoop.profile=2.0 --> + <!-- profile for building against Hadoop 1.x + XXX Since this is the default, make sure to sync hadoop-default when changing. + Activate using: mvn -Dhadoop.profile=1 --> <profile> - <id>hadoop-2.0</id> + <id>hadoop-1</id> <activation> <property> <name>hadoop.profile</name> - <value>2.0</value> + <value>1</value> + </property> + </activation> + <dependencies> + <dependency> + <groupId>org.apache.hadoop</groupId> + <artifactId>hadoop-core</artifactId> + </dependency> + </dependencies> + </profile> + <!-- profile for building against Hadoop 2.x + Activate using: mvn -Dhadoop.profile=2 --> + <profile> + <id>hadoop-2</id> + <activation> + <property> + <name>hadoop.profile</name> + <value>2</value> </property> </activation> <dependencies> http://git-wip-us.apache.org/repos/asf/accumulo/blob/71f150a7/src/start/pom.xml ---------------------------------------------------------------------- diff --git a/src/start/pom.xml b/src/start/pom.xml index de3be18..69a9ca7 100644 --- a/src/start/pom.xml +++ b/src/start/pom.xml @@ -51,15 +51,18 @@ </build> <profiles> - <!-- profile for building against Hadoop 1.0.x - Activate by not specifying hadoop.profile --> <profile> - <id>hadoop-1.0</id> + <id>hadoop-default</id> <activation> <property> <name>!hadoop.profile</name> </property> </activation> + <properties> + <!-- Denotes intention and allows the enforcer plugin to pass when + the user is relying on default behavior; won't work to activate profile --> + <hadoop.profile>1</hadoop.profile> + </properties> <dependencies> <dependency> <groupId>org.apache.hadoop</groupId> @@ -67,14 +70,32 @@ </dependency> </dependencies> </profile> - <!-- profile for building against Hadoop 2.0.x - Activate using: mvn -Dhadoop.profile=2.0 --> + <!-- profile for building against Hadoop 1.x + XXX Since this is the default, make sure to sync hadoop-default when changing. + Activate using: mvn -Dhadoop.profile=1 --> <profile> - <id>hadoop-2.0</id> + <id>hadoop-1</id> <activation> <property> <name>hadoop.profile</name> - <value>2.0</value> + <value>1</value> + </property> + </activation> + <dependencies> + <dependency> + <groupId>org.apache.hadoop</groupId> + <artifactId>hadoop-core</artifactId> + </dependency> + </dependencies> + </profile> + <!-- profile for building against Hadoop 2.x + Activate using: mvn -Dhadoop.profile=2 --> + <profile> + <id>hadoop-2</id> + <activation> + <property> + <name>hadoop.profile</name> + <value>2</value> </property> </activation> <dependencies>