ACCUMULO-1166 Merge branch '1.4' into 1.5
Rework some more of the hadoop-1 and hadoop-2 support since 1.5.0 has
the compatibility to run on both present.
Conflicts:
README.md
pom.xml
src/main/resources/archetype-resources/pom.xml
src/main/resources/archetype-resources/src/test/java/ExampleAccumuloUnitTest.java
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..5080ddb
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,3 @@
+.project
+.settings
+/target
diff --git a/README.md b/README.md
index 8adbc78..69688f4 100644
--- a/README.md
+++ b/README.md
@@ -17,5 +17,5 @@
`mvn archetype:generate -DarchetypeGroupId=org.apache.accumulo -DarchetypeArtifactId=instamo-archetype -DinteractiveMode=false`
-Maven will prompt you to enter the rest of the necessary configuration
+and Maven will prompt you to enter the rest of the necessary configuration
parameters (e.g. groupId, artifactId, version and Java package)
diff --git a/pom.xml b/pom.xml
index 7693af5..6428a07 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,78 +1,84 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- 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.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.apache.accumulo</groupId>
- <artifactId>instamo-archetype</artifactId>
- <version>1.5.1-SNAPSHOT</version>
- <packaging>maven-archetype</packaging>
- <name>instamo-archetype</name>
- <scm>
- <connection>scm:svn:http://svn.apache.org/repos/asf/accumulo/contrib/instamo-archetype/branches/1.5</connection>
- <developerConnection>scm:svn:https://svn.apache.org/repos/asf/accumulo/contrib/instamo-archetype/branches/1.5</developerConnection>
- <url>http://svn.apache.org/viewvc/accumulo/contrib/instamo-archetype/branches/1.5</url>
- </scm>
- <url>http://accumulo.apache.org</url>
- <build>
- <extensions>
- <extension>
- <groupId>org.apache.maven.archetype</groupId>
- <artifactId>archetype-packaging</artifactId>
- <version>2.2</version>
- </extension>
- </extensions>
- <pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-archetype-plugin</artifactId>
- <version>2.2</version>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-source-plugin</artifactId>
- <version>2.2.1</version>
- <configuration>
- <includePom>true</includePom>
- </configuration>
- </plugin>
- </plugins>
- </pluginManagement>
- </build>
- <profiles>
- <profile>
- <id>release</id>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-source-plugin</artifactId>
- <executions>
- <execution>
- <id>attach-sources</id>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache</groupId>
+ <artifactId>apache</artifactId>
+ <version>10</version>
+ </parent>
+
+ <groupId>org.apache.accumulo</groupId>
+ <artifactId>instamo-archetype</artifactId>
+ <version>1.5.0-SNAPSHOT</version>
+ <packaging>maven-archetype</packaging>
+ <name>instamo-archetype</name>
+ <scm>
+ <connection>scm:git:git://git.apache.org/accumulo-instamo-archetype.git</connection>
+ <developerConnection>scm:git:https://git-wip-us.apache.org/repos/asf/accumulo-instamo-archetype.git</developerConnection>
+ <url>https://git-wip-us.apache.org/repos/asf?p=accumulo-instamo-archetype.git</url>
+ </scm>
+ <url>http://accumulo.apache.org</url>
+ <build>
+ <extensions>
+ <extension>
+ <groupId>org.apache.maven.archetype</groupId>
+ <artifactId>archetype-packaging</artifactId>
+ <version>2.2</version>
+ </extension>
+ </extensions>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-archetype-plugin</artifactId>
+ <version>2.2</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <version>2.2.1</version>
+ <configuration>
+ <includePom>true</includePom>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+ <profiles>
+ <profile>
+ <id>release</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-sources</id>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+</project>
diff --git a/src/main/resources/META-INF/maven/archetype-metadata.xml b/src/main/resources/META-INF/maven/archetype-metadata.xml
index 6f37215..0601ba1 100644
--- a/src/main/resources/META-INF/maven/archetype-metadata.xml
+++ b/src/main/resources/META-INF/maven/archetype-metadata.xml
@@ -27,7 +27,7 @@
<defaultValue>instamo</defaultValue>
</requiredProperty>
<requiredProperty key="version">
- <defaultValue>1.0-SNAPSHOT</defaultValue>
+ <defaultValue>0.0.1-SNAPSHOT</defaultValue>
</requiredProperty>
<requiredProperty key="package">
<defaultValue>instamo</defaultValue>
diff --git a/src/main/resources/archetype-resources/pom.xml b/src/main/resources/archetype-resources/pom.xml
index 7704cde..60779f5 100644
--- a/src/main/resources/archetype-resources/pom.xml
+++ b/src/main/resources/archetype-resources/pom.xml
@@ -26,14 +26,14 @@
<properties>
<accumulo.version>1.5.0</accumulo.version>
- <hadoop-one.version>1.0.4</hadoop-one.version>
- <hadoop-two.version>2.0.2-alpha</hadoop-two.version>
+ <hadoop-one.version>1.2.1</hadoop-one.version>
+ <hadoop-two.version>2.1.0-beta</hadoop-two.version>
<slf4j.version>1.6.1</slf4j.version>
<maclass>${package}.MapReduceExample</maclass>
</properties>
<profiles>
- <!-- profile for building against Hadoop 1.0.x
+ <!-- profile for building against Hadoop 1.2.x
Activate by not specifying hadoop.profile -->
<profile>
<id>hadoop-1.0</id>
@@ -44,16 +44,11 @@
</activation>
<properties>
<hadoop.version>${hadoop-one.version}</hadoop.version>
+ <httpclient.version>3.0.1</httpclient.version>
+ <slf4j.version>1.4.3</slf4j.version>
</properties>
- <dependencies>
- <dependency>
- <groupId>org.apache.hadoop</groupId>
- <artifactId>hadoop-core</artifactId>
- <version>${hadoop.version}</version>
- </dependency>
- </dependencies>
</profile>
- <!-- profile for building against Hadoop 2.0.x
+ <!-- profile for building against Hadoop 2.1.x
Activate using: mvn -Dhadoop.profile=2.0 -->
<profile>
<id>hadoop-2.0</id>
@@ -65,14 +60,9 @@
</activation>
<properties>
<hadoop.version>${hadoop-two.version}</hadoop.version>
+ <httpclient.version>3.1</httpclient.version>
+ <slf4j.version>1.6.1</slf4j.version>
</properties>
- <dependencies>
- <dependency>
- <groupId>org.apache.hadoop</groupId>
- <artifactId>hadoop-client</artifactId>
- <version>${hadoop.version}</version>
- </dependency>
- </dependencies>
</profile>
<profile>
<id>shell</id>
@@ -159,6 +149,11 @@
<version>${accumulo.version}</version>
</dependency>
<dependency>
+ <groupId>org.apache.hadoop</groupId>
+ <artifactId>hadoop-client</artifactId>
+ <version>${hadoop.version}</version>
+ </dependency>
+ <dependency>
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper</artifactId>
<version>3.3.6</version>
@@ -197,6 +192,16 @@
<artifactId>slf4j-log4j12</artifactId>
<version>${slf4j.version}</version>
</dependency>
+ <dependency>
+ <groupId>commons-cli</groupId>
+ <artifactId>commons-cli</artifactId>
+ <version>1.2</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-httpclient</groupId>
+ <artifactId>commons-httpclient</artifactId>
+ <version>${httpclient.version}</version>
+ </dependency>
</dependencies>
<build>
diff --git a/src/main/resources/archetype-resources/src/main/java/ShellExample.java b/src/main/resources/archetype-resources/src/main/java/ShellExample.java
index 6e96666..7c3406e 100644
--- a/src/main/resources/archetype-resources/src/main/java/ShellExample.java
+++ b/src/main/resources/archetype-resources/src/main/java/ShellExample.java
@@ -50,8 +50,10 @@
} catch (InterruptedException e) {
System.err.println("Error starting MiniAccumuloCluster: " + e.getMessage());
+ System.exit(1);
} catch (IOException e) {
System.err.println("Error starting MiniAccumuloCluster: " + e.getMessage());
+ System.exit(1);
} finally {
if (null != tempDir) {
tempDir.delete();
@@ -62,8 +64,10 @@
mac.stop();
} catch (InterruptedException e) {
System.err.println("Error stopping MiniAccumuloCluster: " + e.getMessage());
+ System.exit(1);
} catch (IOException e) {
System.err.println("Error stopping MiniAccumuloCluster: " + e.getMessage());
+ System.exit(1);
}
}
}
@@ -74,5 +78,7 @@
ShellExample shell = new ShellExample();
shell.run();
+
+ System.exit(0);
}
}
diff --git a/src/main/resources/archetype-resources/src/test/java/ExampleAccumuloUnitTest.java b/src/main/resources/archetype-resources/src/test/java/ExampleAccumuloUnitTest.java
index 4938ab9..697c8b0 100644
--- a/src/main/resources/archetype-resources/src/test/java/ExampleAccumuloUnitTest.java
+++ b/src/main/resources/archetype-resources/src/test/java/ExampleAccumuloUnitTest.java
@@ -33,6 +33,8 @@
import org.apache.accumulo.core.data.Mutation;
import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.minicluster.MiniAccumuloCluster;
+import org.apache.accumulo.minicluster.MiniAccumuloConfig;
+import org.apache.log4j.Logger;
import org.junit.AfterClass;
import org.junit.BeforeClass;
@@ -44,6 +46,7 @@
*/
public class ExampleAccumuloUnitTest {
+ private static final Logger log = Logger.getLogger(ExampleAccumuloUnitTest.class);
public static TemporaryFolder folder = new TemporaryFolder();
@@ -54,7 +57,13 @@
folder.create();
- accumulo = new MiniAccumuloCluster(folder.getRoot(), "superSecret");
+ log.debug("Using " + folder.getRoot());
+
+ MiniAccumuloConfig config = new MiniAccumuloConfig(folder.getRoot(), "superSecret");
+ config.setNumTservers(1);
+
+
+ accumulo = new MiniAccumuloCluster(config);
accumulo.start();
@@ -103,7 +112,7 @@
Scanner scanner = conn.createScanner("foo", Constants.NO_AUTHS);
for (Entry<Key,Value> entry : scanner) {
- System.out.println(entry.getKey() + " " + entry.getValue());
+ log.debug(entry.getKey() + " " + entry.getValue());
}
//TODO use scanner to find common enemy ids between Alice and Bob, then
diff --git a/src/main/resources/archetype-resources/src/test/resources/log4j.properties b/src/main/resources/archetype-resources/src/test/resources/log4j.properties
new file mode 100644
index 0000000..e9f9124
--- /dev/null
+++ b/src/main/resources/archetype-resources/src/test/resources/log4j.properties
@@ -0,0 +1,29 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+
+# 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.
+
+
+log4j.rootLogger=INFO, CA
+log4j.appender.CA=org.apache.log4j.ConsoleAppender
+log4j.appender.CA.layout=org.apache.log4j.PatternLayout
+log4j.appender.CA.layout.ConversionPattern=[%t] %-5p %c %x - %m%n
+
+log4j.logger.org.apache.zookeeper=ERROR,CA
+log4j.logger.org.apache.accumulo.core.client.impl.ServerClient=ERROR,CA
+log4j.logger.org.apache.accumulo.core.util.shell.Shell.audit=WARN,CA
+log4j.logger.org.apache.commons.vfs2.impl.DefaultFileSystemManager=WARN,CA