You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by mm...@apache.org on 2017/11/02 21:34:41 UTC
[accumulo-website] branch tour updated: ACCUMULO-4734 Set up MAC
This is an automated email from the ASF dual-hosted git repository.
mmiller pushed a commit to branch tour
in repository https://gitbox.apache.org/repos/asf/accumulo-website.git
The following commit(s) were added to refs/heads/tour by this push:
new eae7bec ACCUMULO-4734 Set up MAC
eae7bec is described below
commit eae7bec9c4a330e093d58297ff19ca4383e97bc4
Author: Mike Miller <mm...@apache.org>
AuthorDate: Thu Nov 2 17:33:30 2017 -0400
ACCUMULO-4734 Set up MAC
---
README.md | 16 ++++++++++++----
pom.xml | 11 ++++++++++-
src/main/java/tour/Main.java | 19 ++++++++++++++++++-
src/main/resources/log4j.properties | 9 +++++++++
4 files changed, 49 insertions(+), 6 deletions(-)
diff --git a/README.md b/README.md
index a410739..f5b0913 100644
--- a/README.md
+++ b/README.md
@@ -5,12 +5,20 @@ This git repository provides a barebones Maven+Java environment for the [Accumul
go through the tour edit [Main.java] and use the following maven command to run your code. This command
will execute Main.java with all of the correct dependencies on the classpath.
-```bash
+```commandline
mvn -q clean compile exec:java
```
-The command takes a bit to run because it starts a MiniAccumulo each time.
+The command takes a bit to run because it starts a MiniAccumuloCluster each time.
-[tour]: https://fluo.apache.org/tour
-[Main.java]: src/main/java/tour/Main.java
+MiniAccumuloCluster is a mini version of Accumulo that runs on your local filesystem. It should only be used for
+development purposes. Files and logs used by MiniAccumuloCluster can be seen in the generated directory:
+
+```commandline
+target/mac########
+```
+Running _mvn clean_ will remove any files created by previous runs.
+
+[tour]: https://fluo.apache.org/tour
+[Main.java]: src/main/java/tour/Main.java
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 36ff99e..c94719e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -13,7 +13,8 @@
<url></url>
<properties>
-
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <accumulo.version>1.8.1</accumulo.version>
</properties>
<build>
@@ -40,5 +41,13 @@
</plugins>
</build>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.accumulo</groupId>
+ <artifactId>accumulo-minicluster</artifactId>
+ <version>${accumulo.version}</version>
+ </dependency>
+ </dependencies>
+
</project>
diff --git a/src/main/java/tour/Main.java b/src/main/java/tour/Main.java
index 4ec8f8c..10ac577 100644
--- a/src/main/java/tour/Main.java
+++ b/src/main/java/tour/Main.java
@@ -1,9 +1,26 @@
package tour;
+import org.apache.accumulo.minicluster.MiniAccumuloCluster;
+
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+
public class Main {
- public static void main(String[] args) {
+ public static void main(String[] args) throws Exception {
System.out.println("Running the Accumulo tour. Having fun yet?");
+
+ Path tempDir = Files.createTempDirectory(Paths.get("target"), "mac");
+ MiniAccumuloCluster mac = new MiniAccumuloCluster(tempDir.toFile(), "tourguide");
+
+ mac.start();
+ exercise(mac);
+ mac.stop();
+ }
+
+ static void exercise(MiniAccumuloCluster mac) {
+ // start writing your code here
}
}
diff --git a/src/main/resources/log4j.properties b/src/main/resources/log4j.properties
new file mode 100644
index 0000000..05f649f
--- /dev/null
+++ b/src/main/resources/log4j.properties
@@ -0,0 +1,9 @@
+log4j.rootLogger=INFO, CA
+log4j.appender.CA=org.apache.log4j.ConsoleAppender
+log4j.appender.CA.layout=org.apache.log4j.PatternLayout
+log4j.appender.CA.layout.ConversionPattern=%d{ISO8601} [%c{2}] %-5p: %m%n
+
+log4j.logger.org.apache.zookeeper.ClientCnxn=FATAL
+log4j.logger.org.apache.zookeeper.ZooKeeper=WARN
+log4j.logger.org.apache.curator=WARN
+log4j.logger.org.apache.accumulo=INFO
--
To stop receiving notification emails like this one, please contact
['"commits@accumulo.apache.org" <co...@accumulo.apache.org>'].