From commits-return-23509-archive-asf-public=cust-asf.ponee.io@accumulo.apache.org Thu Oct 31 17:11:09 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 264D8180629 for ; Thu, 31 Oct 2019 18:11:09 +0100 (CET) Received: (qmail 39504 invoked by uid 500); 31 Oct 2019 17:11:08 -0000 Mailing-List: contact commits-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@accumulo.apache.org Delivered-To: mailing list commits@accumulo.apache.org Received: (qmail 39495 invoked by uid 99); 31 Oct 2019 17:11:08 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 31 Oct 2019 17:11:08 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id 395CE805E6; Thu, 31 Oct 2019 17:11:08 +0000 (UTC) Date: Thu, 31 Oct 2019 17:11:08 +0000 To: "commits@accumulo.apache.org" Subject: [accumulo-website] branch tour updated: Update for 2.0 (#202) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <157254186813.2056.15245524228349594096@gitbox.apache.org> From: mmiller@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: accumulo-website X-Git-Refname: refs/heads/tour X-Git-Reftype: branch X-Git-Oldrev: 79057881a04ea043d22d843a70ff97e957049aaa X-Git-Newrev: 63ae613c7632c9c29f055dfda9f3b73f0bada2f3 X-Git-Rev: 63ae613c7632c9c29f055dfda9f3b73f0bada2f3 X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated 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 63ae613 Update for 2.0 (#202) 63ae613 is described below commit 63ae613c7632c9c29f055dfda9f3b73f0bada2f3 Author: Mike Miller AuthorDate: Thu Oct 31 13:10:58 2019 -0400 Update for 2.0 (#202) * Update version to 2.0 and maven exec plugin * Use properties to create client --- README.md | 7 ++----- pom.xml | 12 ++++++++---- src/main/java/tour/Main.java | 14 +++++++++++--- 3 files changed, 21 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index b160b04..72c7849 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ go through the tour edit [Main.java] and use the following maven command to run will execute Main.java with all of the correct dependencies on the classpath. ```commandline -mvn -q clean compile exec:java +mvn -q clean compile exec:exec ``` The above command will compile the project and run a MiniAccumuloCluster. @@ -18,10 +18,7 @@ development purposes. Files and logs used by MiniAccumuloCluster can be seen in target/mac######## ``` -The version of Accumulo is defined in pom.xml and the tour should work with the Accumulo versions: -* 1.8.* -* 1.9.* -* 2.0.* +This tour is designed for Accumulo version 2.* Running _mvn clean_ will remove any files created by previous runs. diff --git a/pom.xml b/pom.xml index 3571145..8813d13 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ accumulo-tour - 1.8.1 + 2.0.0 1.8 @@ -29,15 +29,19 @@ org.codehaus.mojo exec-maven-plugin - 1.5.0 + 1.6.0 - tour.Main + java + + -classpath + + tour.Main + false - org.apache.accumulo diff --git a/src/main/java/tour/Main.java b/src/main/java/tour/Main.java index 83ed452..a72ea37 100644 --- a/src/main/java/tour/Main.java +++ b/src/main/java/tour/Main.java @@ -3,12 +3,16 @@ package tour; // Classes you will use along the tour import java.util.Map; import java.util.Map.Entry; +import java.util.Properties; import java.util.Random; import java.util.List; import java.util.ArrayList; import java.util.concurrent.CompletableFuture; import java.util.concurrent.Future; import java.util.function.Function; + +import org.apache.accumulo.core.client.Accumulo; +import org.apache.accumulo.core.client.AccumuloClient; import org.apache.accumulo.core.client.BatchWriter; import org.apache.accumulo.core.client.BatchWriterConfig; import org.apache.accumulo.core.client.Connector; @@ -42,14 +46,18 @@ public class Main { 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"); + MiniAccumuloCluster mac = new MiniAccumuloCluster(tempDir.toFile(), "tourpass"); + Properties properties = mac.getClientProperties(); mac.start(); - exercise(mac); + + try (AccumuloClient client = Accumulo.newClient().from(properties).build()) { + exercise(client); + } mac.stop(); } - static void exercise(MiniAccumuloCluster mac) throws Exception{ + static void exercise(AccumuloClient client) throws Exception{ // start writing your code here }