This is an automated email from the ASF dual-hosted git repository. git-site-role pushed a commit to branch asf-staging in repository https://gitbox.apache.org/repos/asf/accumulo-website.git
The following commit(s) were added to refs/heads/asf-staging by this push: new 21fadb0 Automatic Site Publish by Buildbot 21fadb0 is described below commit 21fadb0199dc1b746592d045ed438ce14ddf5c84 Author: buildbot <us...@infra.apache.org> AuthorDate: Wed May 5 19:46:32 2021 +0000 Automatic Site Publish by Buildbot --- .../blog/2021/04/21/jshell-accumulo-feature.html | 318 +++++++++++++++++++++ output/feed.xml | 299 ++++++++++--------- output/index.html | 14 +- output/news/index.html | 13 +- output/search_data.json | 8 + 5 files changed, 501 insertions(+), 151 deletions(-) diff --git a/output/blog/2021/04/21/jshell-accumulo-feature.html b/output/blog/2021/04/21/jshell-accumulo-feature.html new file mode 100644 index 0000000..b42ab8f --- /dev/null +++ b/output/blog/2021/04/21/jshell-accumulo-feature.html @@ -0,0 +1,318 @@ +<!DOCTYPE html> +<html lang="en"> +<head> +<!-- + 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. +--> +<meta charset="utf-8"> +<meta http-equiv="X-UA-Compatible" content="IE=edge"> +<meta name="viewport" content="width=device-width, initial-scale=1"> +<link href="https://maxcdn.bootstrapcdn.com/bootswatch/3.3.7/paper/bootstrap.min.css" rel="stylesheet" integrity="sha384-awusxf8AUojygHf2+joICySzB780jVvQaVCAt1clU3QsyAitLGul28Qxb2r1e5g+" crossorigin="anonymous"> +<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet"> +<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/bs/jq-2.2.3/dt-1.10.12/datatables.min.css"> +<link href="/css/accumulo.css" rel="stylesheet" type="text/css"> + +<title>Jshell Accumulo Feature</title> + +<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.4/jquery.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script> +<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script> +<script type="text/javascript" src="https://cdn.datatables.net/v/bs/jq-2.2.3/dt-1.10.12/datatables.min.js"></script> +<script type="text/javascript" src="https://www.apachecon.com/event-images/snippet.js"></script> +<script> + // show location of canonical site if not currently on the canonical site + $(function() { + var host = window.location.host; + if (typeof host !== 'undefined' && host !== 'accumulo.apache.org') { + $('#non-canonical').show(); + } + }); + + $(function() { + // decorate section headers with anchors + return $("h2, h3, h4, h5, h6").each(function(i, el) { + var $el, icon, id; + $el = $(el); + id = $el.attr('id'); + icon = '<i class="fa fa-link"></i>'; + if (id) { + return $el.append($("<a />").addClass("header-link").attr("href", "#" + id).html(icon)); + } + }); + }); + + // fix sidebar width in documentation + $(function() { + var $affixElement = $('div[data-spy="affix"]'); + $affixElement.width($affixElement.parent().width()); + }); +</script> + +</head> +<body style="padding-top: 100px"> + + <nav class="navbar navbar-default navbar-fixed-top"> + <div class="container"> + <div class="navbar-header"> + <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-items"> + <span class="sr-only">Toggle navigation</span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </button> + <a href="/"><img id="nav-logo" alt="Apache Accumulo" class="img-responsive" src="/images/accumulo-logo.png" width="200" + /></a> + </div> + <div class="collapse navbar-collapse" id="navbar-items"> + <ul class="nav navbar-nav"> + <li class="nav-link"><a href="/downloads">Download</a></li> + <li class="nav-link"><a href="/tour">Tour</a></li> + <li class="dropdown"> + <a class="dropdown-toggle" data-toggle="dropdown" href="#">Releases<span class="caret"></span></a> + <ul class="dropdown-menu"> + <li><a href="/release/accumulo-2.0.1/">2.0.1 (Latest)</a></li> + <li><a href="/release/accumulo-1.10.1/">1.10.1</a></li> + <li><a href="/release/">Archive</a></li> + </ul> + </li> + <li class="dropdown"> + <a class="dropdown-toggle" data-toggle="dropdown" href="#">Documentation<span class="caret"></span></a> + <ul class="dropdown-menu"> + <li><a href="/docs/2.x">User Manual (2.x)</a></li> + <li><a href="/docs/2.x/apidocs">Javadocs (2.0)</a></li> + <li><a href="/api">Public API</a></li> + <li><a href="/quickstart-1.x">Quickstart (1.x)</a></li> + <li><a href="/accumulo2-maven-plugin">Accumulo Maven Plugin</a></li> + <li><a href="/1.10/accumulo_user_manual.html">User Manual (1.10)</a></li> + <li><a href="/1.10/apidocs">Javadocs (1.10)</a></li> + <li><a href="/external-docs">External Docs</a></li> + <li><a href="/docs-archive/">Archive</a></li> + </ul> + </li> + <li class="dropdown"> + <a class="dropdown-toggle" data-toggle="dropdown" href="#">Community<span class="caret"></span></a> + <ul class="dropdown-menu"> + <li><a href="/contact-us">Contact Us</a></li> + <li><a href="/how-to-contribute">How To Contribute</a></li> + <li><a href="/people">People</a></li> + <li><a href="/related-projects">Related Projects</a></li> + </ul> + </li> + <li class="nav-link"><a href="/search">Search</a></li> + </ul> + <ul class="nav navbar-nav navbar-right"> + <li class="dropdown"> + <a class="dropdown-toggle" data-toggle="dropdown" href="#"><img alt="Apache Software Foundation" src="https://www.apache.org/foundation/press/kit/feather.svg" width="15"/><span class="caret"></span></a> + <ul class="dropdown-menu"> + <li><a href="https://www.apache.org">Apache Homepage <i class="fa fa-external-link"></i></a></li> + <li><a href="https://www.apache.org/licenses/">License <i class="fa fa-external-link"></i></a></li> + <li><a href="https://www.apache.org/foundation/sponsorship">Sponsorship <i class="fa fa-external-link"></i></a></li> + <li><a href="https://www.apache.org/security">Security <i class="fa fa-external-link"></i></a></li> + <li><a href="https://www.apache.org/foundation/thanks">Thanks <i class="fa fa-external-link"></i></a></li> + <li><a href="https://www.apache.org/foundation/policies/conduct">Code of Conduct <i class="fa fa-external-link"></i></a></li> + <li><a href="https://www.apache.org/events/current-event.html">Current Event <i class="fa fa-external-link"></i></a></li> + </ul> + </li> + </ul> + </div> + </div> +</nav> + + + <div class="container"> + <div class="row"> + <div class="col-md-12"> + + <div id="non-canonical" style="display: none; background-color: #F0E68C; padding-left: 1em;"> + Visit the official site at: <a href="https://accumulo.apache.org">https://accumulo.apache.org</a> + </div> + <div id="content"> + + <h1 class="title">Jshell Accumulo Feature</h1> + + <p> + +<b>Date: </b> 21 Apr 2021<br> + +</p> + +<h2 id="overview">Overview</h2> + +<p>First introduced in Java 9, <a href="https://docs.oracle.com/javase/9/jshell/introduction-jshell.htm#JSHEL-GUID-630F27C8-1195-4989-9F6B-2C51D46F52C8">JShell</a> is an interactive Read-Evaluate-Print-Loop (REPL) +Java tool that interprets user’s input and outputs the results. This tool provides a convenient +way to test out and execute quick tasks with Accumulo in the terminal. This feature is a part +of the upcoming Accumulo 2.1 release. If you’re a developer and want to get involved in testing, +<a href="https://accumulo.apache.org/contact-us/">contact us</a> or review our <a href="https://accumulo.apache.org/how-to-contribute/">contributing guide</a>.</p> + +<h2 id="major-features">Major Features</h2> +<ul> + <li> + <p>Default JShell script provides initial imports for interacting with Accumulo’s API and +provided in Accumulo’s binary distribution tarball</p> + </li> + <li> + <p>On startup, JShell Accumulo will automatically import the <code class="language-plaintext highlighter-rouge">CLASSPATH</code>, load in a configured +environment from user’s <code class="language-plaintext highlighter-rouge">conf/accumulo-env.sh</code>, and invoke <code class="language-plaintext highlighter-rouge">conf/jshell-init.jsh</code> +to allow rapid Accumulo task executions</p> + </li> + <li> + <p>JShell Accumulo can startup using default/custom JShell script and users can append any JShell +command-line <a href="https://docs.oracle.com/javase/9/tools/jshell.htm#JSWOR-GUID-C337353B-074A-431C-993F-60C226163F00">options</a> to the startup command</p> + </li> +</ul> + +<h2 id="booting-up-jshell-accumulo">Booting Up JShell Accumulo</h2> +<p>1) Open up a terminal and navigate to Accumulo’s installation directory</p> + +<p>2) To startup JShell with <strong>default script</strong> use this command:</p> + +<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">$ </span>bin/accumulo jshell +</code></pre></div></div> +<p>3) To startup JShell with <strong>custom script</strong> use this command:</p> + +<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">$ </span>bin/accumulo jshell <span class="nt">--startup</span> file/path/to/custom_script.jsh +</code></pre></div></div> +<p><strong>Note:</strong> One can execute the <code class="language-plaintext highlighter-rouge">jshell</code> command to startup JShell. However, doing so will require +manually importing the <code class="language-plaintext highlighter-rouge">CLASSPATH</code> and the configured environment from <code class="language-plaintext highlighter-rouge">conf/accumulo-env.sh</code> +and manually specifying the startup file for <code class="language-plaintext highlighter-rouge">conf/jshell-init.jsh</code> before any Accumulo tasks +can be performed. Using one of the startup commands above will automate that process +for convenience.</p> + +<h2 id="jshell-accumulo-default-script">JShell Accumulo Default Script</h2> +<p>The auto-generated <code class="language-plaintext highlighter-rouge">jshell-init.jsh</code> is a customizable file located in Accumulo’s installation +<code class="language-plaintext highlighter-rouge">conf/</code> directory. Inside, <code class="language-plaintext highlighter-rouge">jshell-init.jsh</code> contains <a href="https://accumulo.apache.org/api/">Accumulo Java APIs</a> +formatted as import statements and <a href="https://www.javadoc.io/doc/org.apache.accumulo/accumulo-core/latest/org/apache/accumulo/core/client/AccumuloClient.html">AccumuloClient</a> build implementation. On startup, +the script automatically loads in the APIs and attempts to construct a client. Should additional +APIs and/or code implementations be needed, simply append them to <code class="language-plaintext highlighter-rouge">jshell-init.jsh</code>. +Alternatively, you can create a separate JShell script and specify the custom script’s file path +on startup.</p> + +<p>To construct an <a href="https://www.javadoc.io/doc/org.apache.accumulo/accumulo-core/latest/org/apache/accumulo/core/client/AccumuloClient.html">AccumuloClient</a>, the provided <code class="language-plaintext highlighter-rouge">conf/jshell-init.jsh</code> script finds +and uses <code class="language-plaintext highlighter-rouge">accumulo-client.properties</code> in Accumulo’s class path, and assigns the result +to a variable called <strong>client</strong>.</p> + +<p>If <code class="language-plaintext highlighter-rouge">accumulo-client.properties</code> is found, a similar result will be produced below:</p> + +<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Preparing JShell for Apache Accumulo + +Building Accumulo client using 'jar:file:/home/accumulo/lib/accumulo-client.jar!/accumulo-client.properties' + +Use 'client' to interact with Accumulo + +| Welcome to JShell -- Version 11.0.10 +| For an introduction type: /help intro + +jshell> +</code></pre></div></div> + +<p>If <code class="language-plaintext highlighter-rouge">accumulo-client.properties</code> is not found, an <a href="https://www.javadoc.io/doc/org.apache.accumulo/accumulo-core/latest/org/apache/accumulo/core/client/AccumuloClient.html">AccumuloClient</a> will not +auto-generate and will produce the following result below:</p> + +<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Preparing JShell for Apache Accumulo + +'accumulo-client.properties' was not found on the classpath + +| Welcome to JShell -- Version 11.0.10 +| For an introduction type: /help intro + +jshell> +</code></pre></div></div> + +<h2 id="jshell-accumulo-example">JShell Accumulo Example</h2> +<p>1) Booting up JShell Accumulo using default script</p> + +<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Preparing JShell for Apache Accumulo + +Building Accumulo client using 'file:/home/accumulo/conf/accumulo-client.properties' + +Use 'client' to interact with Accumulo + +| Welcome to JShell -- Version 11.0.10 +| For an introduction type: /help intro + +jshell> +</code></pre></div></div> + +<p>2) Providing JShell with an Accumulo task</p> + +<pre><code class="language-Java"> // Create a table called "GothamPD". + client.tableOperations().create("GothamPD"); + + // Create a Mutation object to hold all changes to a row in a table. + // Each row has a unique row ID. + Mutation mutation = new Mutation("id0001"); + + // Create key/value pairs for Batman. Put them in the "hero" family. + mutation.put("hero", "alias", "Batman"); + mutation.put("hero", "name", "Bruce Wayne"); + mutation.put("hero", "wearsCape?", "true"); + + // Create a BatchWriter to the GothamPD table and add your mutation to it. + // Try w/ resources will close for us. + try (BatchWriter writer = client.createBatchWriter("GothamPD")) { + writer.addMutation(mutation); + } + + // Read and print all rows of the "GothamPD" table. + // Try w/ resources will close for us. + try (ScannerBase scan = client.createScanner("GothamPD", Authorizations.EMPTY)) { + System.out.println("Gotham Police Department Persons of Interest:"); + + // A Scanner is an extension of java.lang.Iterable so behaves just like one. + scan.forEach((k, v) -> System.out.printf("Key : %-50s Value : %s\n", k, v)); + } +</code></pre> + +<p><strong>Note:</strong> The fully-qualified class name for Accumulo Scanner or +<code class="language-plaintext highlighter-rouge">org.apache.accumulo.core.client.Scanner</code> needs to be used due to conflicting issues with +Java’s built-in java.util.Scanner. However, to shorten the Accumulo Scanner’s declaration, assign +scan to <code class="language-plaintext highlighter-rouge">ScannerBase</code> type instead.</p> + +<p>3) Executing the Accumulo task above outputs:</p> + +<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>mutation ==> org.apache.accumulo.core.data.Mutation@1 +Gotham Police Department Persons of Interest: +Key : id0001 hero:alias [] 1618926204602 false Value : Batman +Key : id0001 hero:name [] 1618926204602 false Value : Bruce Wayne +Key : id0001 hero:wearsCape? [] 1618926204602 false Value : true + +jshell> +</code></pre></div></div> + + +<p><strong>View all posts in the <a href="/news">news archive</a></strong></p> + + </div> + + +<footer> + + <p><a href="https://www.apache.org/foundation/contributing"><img src="https://www.apache.org/images/SupportApache-small.png" alt="Support the ASF" id="asf-logo" height="100" /></a></p> + + <p>Copyright © 2011-2021 <a href="https://www.apache.org">The Apache Software Foundation</a>. +Licensed under the <a href="https://www.apache.org/licenses/">Apache License, Version 2.0</a>.</p> + + <p>Apache®, the names of Apache projects and their logos, and the multicolor feather +logo are registered trademarks or trademarks of The Apache Software Foundation +in the United States and/or other countries.</p> + +</footer> + + + </div> + </div> + </div> +</body> +</html> diff --git a/output/feed.xml b/output/feed.xml index 30626fb..e8a1c50 100644 --- a/output/feed.xml +++ b/output/feed.xml @@ -6,12 +6,166 @@ </description> <link>https://accumulo.apache.org/</link> <atom:link href="https://accumulo.apache.org/feed.xml" rel="self" type="application/rss+xml"/> - <pubDate>Wed, 05 May 2021 17:10:04 +0000</pubDate> - <lastBuildDate>Wed, 05 May 2021 17:10:04 +0000</lastBuildDate> + <pubDate>Wed, 05 May 2021 19:46:27 +0000</pubDate> + <lastBuildDate>Wed, 05 May 2021 19:46:27 +0000</lastBuildDate> <generator>Jekyll v4.2.0</generator> <item> + <title>Jshell Accumulo Feature</title> + <description><h2 id="overview">Overview</h2> + +<p>First introduced in Java 9, <a href="https://docs.oracle.com/javase/9/jshell/introduction-jshell.htm#JSHEL-GUID-630F27C8-1195-4989-9F6B-2C51D46F52C8">JShell</a> is an interactive Read-Evaluate-Print-Loop (REPL) +Java tool that interprets user’s input and outputs the results. This tool provides a convenient +way to test out and execute quick tasks with Accumulo in the terminal. This feature is a part +of the upcoming Accumulo 2.1 release. If you’re a developer and want to get involved in testing, +<a href="https://accumulo.apache.org/contact-us/">contact us</a> or review our <a href="https://accumulo.apache.org/how-to-contribute/">contributing guide</a>.</p> + +<h2 id="major-features">Major Features</h2> +<ul> + <li> + <p>Default JShell script provides initial imports for interacting with Accumulo’s API and +provided in Accumulo’s binary distribution tarball</p> + </li> + <li> + <p>On startup, JShell Accumulo will automatically import the <code class="language-plaintext highlighter-rouge">CLASSPATH</code>, load in a configured +environment from user’s <code class="language-plaintext highlighter-rouge">conf/accumulo-env.sh</code>, and invoke <code class="language-plaintext highlighter-rouge">conf/jshell-init.jsh</code> +to allow rapid Accumulo task executions</p> + </li> + <li> + <p>JShell Accumulo can startup using default/custom JShell script and users can append any JShell +command-line <a href="https://docs.oracle.com/javase/9/tools/jshell.htm#JSWOR-GUID-C337353B-074A-431C-993F-60C226163F00">options</a> to the startup command</p> + </li> +</ul> + +<h2 id="booting-up-jshell-accumulo">Booting Up JShell Accumulo</h2> +<p>1) Open up a terminal and navigate to Accumulo’s installation directory</p> + +<p>2) To startup JShell with <strong>default script</strong> use this command:</p> + +<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">$ </span>bin/accumulo jshell +</code></pre></div></div> +<p>3) To startup JShell with <strong>custom script</strong> use this command:</p> + +<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">$ </span>bin/accumulo jshell <span class="nt">--startup</span> file/path/to/custom_script.jsh +</code></pre></div></div> +<p><strong>Note:</strong> One can execute the <code class="language-plaintext highlighter-rouge">jshell</code> command to startup JShell. However, doing so will require +manually importing the <code class="language-plaintext highlighter-rouge">CLASSPATH</code> and the configured environment from <code class="language-plaintext highlighter-rouge">conf/accumulo-env.sh</code> +and manually specifying the startup file for <code class="language-plaintext highlighter-rouge">conf/jshell-init.jsh</code> before any Accumulo tasks +can be performed. Using one of the startup commands above will automate that process +for convenience.</p> + +<h2 id="jshell-accumulo-default-script">JShell Accumulo Default Script</h2> +<p>The auto-generated <code class="language-plaintext highlighter-rouge">jshell-init.jsh</code> is a customizable file located in Accumulo’s installation +<code class="language-plaintext highlighter-rouge">conf/</code> directory. Inside, <code class="language-plaintext highlighter-rouge">jshell-init.jsh</code> contains <a href="https://accumulo.apache.org/api/">Accumulo Java APIs</a> +formatted as import statements and <a href="https://www.javadoc.io/doc/org.apache.accumulo/accumulo-core/latest/org/apache/accumulo/core/client/AccumuloClient.html">AccumuloClient</a> build implementation. On startup, +the script automatically loads in the APIs and attempts to construct a client. Should additional +APIs and/or code implementations be needed, simply append them to <code class="language-plaintext highlighter-rouge">jshell-init.jsh</code>. +Alternatively, you can create a separate JShell script and specify the custom script’s file path +on startup.</p> + +<p>To construct an <a href="https://www.javadoc.io/doc/org.apache.accumulo/accumulo-core/latest/org/apache/accumulo/core/client/AccumuloClient.html">AccumuloClient</a>, the provided <code class="language-plaintext highlighter-rouge">conf/jshell-init.jsh</code> script finds +and uses <code class="language-plaintext highlighter-rouge">accumulo-client.properties</code> in Accumulo’s class path, and assigns the result +to a variable called <strong>client</strong>.</p> + +<p>If <code class="language-plaintext highlighter-rouge">accumulo-client.properties</code> is found, a similar result will be produced below:</p> + +<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Preparing JShell for Apache Accumulo + +Building Accumulo client using 'jar:file:/home/accumulo/lib/accumulo-client.jar!/accumulo-client.properties' + +Use 'client' to interact with Accumulo + +| Welcome to JShell -- Version 11.0.10 +| For an introduction type: /help intro + +jshell&gt; +</code></pre></div></div> + +<p>If <code class="language-plaintext highlighter-rouge">accumulo-client.properties</code> is not found, an <a href="https://www.javadoc.io/doc/org.apache.accumulo/accumulo-core/latest/org/apache/accumulo/core/client/AccumuloClient.html">AccumuloClient</a> will not +auto-generate and will produce the following result below:</p> + +<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Preparing JShell for Apache Accumulo + +'accumulo-client.properties' was not found on the classpath + +| Welcome to JShell -- Version 11.0.10 +| For an introduction type: /help intro + +jshell&gt; +</code></pre></div></div> + +<h2 id="jshell-accumulo-example">JShell Accumulo Example</h2> +<p>1) Booting up JShell Accumulo using default script</p> + +<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Preparing JShell for Apache Accumulo + +Building Accumulo client using 'file:/home/accumulo/conf/accumulo-client.properties' + +Use 'client' to interact with Accumulo + +| Welcome to JShell -- Version 11.0.10 +| For an introduction type: /help intro + +jshell&gt; +</code></pre></div></div> + +<p>2) Providing JShell with an Accumulo task</p> + +<pre><code class="language-Java"> // Create a table called "GothamPD". + client.tableOperations().create("GothamPD"); + + // Create a Mutation object to hold all changes to a row in a table. + // Each row has a unique row ID. + Mutation mutation = new Mutation("id0001"); + + // Create key/value pairs for Batman. Put them in the "hero" family. + mutation.put("hero", "alias", "Batman"); + mutation.put("hero", "name", "Bruce Wayne"); + mutation.put("hero", "wearsCape?", "true"); + + // Create a BatchWriter to the GothamPD table and add your mutation to it. + // Try w/ resources will close for us. + try (BatchWriter writer = client.createBatchWriter("GothamPD")) { + writer.addMutation(mutation); + } + + // Read and print all rows of the "GothamPD" table. + // Try w/ resources will close for us. + try (ScannerBase scan = client.createScanner("GothamPD", Authorizations.EMPTY)) { + System.out.println("Gotham Police Department Persons of Interest:"); + + // A Scanner is an extension of java.lang.Iterable so behaves just like one. + scan.forEach((k, v) -&gt; System.out.printf("Key : %-50s Value : %s\n", k, v)); + } +</code></pre> + +<p><strong>Note:</strong> The fully-qualified class name for Accumulo Scanner or +<code class="language-plaintext highlighter-rouge">org.apache.accumulo.core.client.Scanner</code> needs to be used due to conflicting issues with +Java’s built-in java.util.Scanner. However, to shorten the Accumulo Scanner’s declaration, assign +scan to <code class="language-plaintext highlighter-rouge">ScannerBase</code> type instead.</p> + +<p>3) Executing the Accumulo task above outputs:</p> + +<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>mutation ==&gt; org.apache.accumulo.core.data.Mutation@1 +Gotham Police Department Persons of Interest: +Key : id0001 hero:alias [] 1618926204602 false Value : Batman +Key : id0001 hero:name [] 1618926204602 false Value : Bruce Wayne +Key : id0001 hero:wearsCape? [] 1618926204602 false Value : true + +jshell&gt; +</code></pre></div></div> +</description> + <pubDate>Wed, 21 Apr 2021 00:00:00 +0000</pubDate> + <link>https://accumulo.apache.org/blog/2021/04/21/jshell-accumulo-feature.html</link> + <guid isPermaLink="true">https://accumulo.apache.org/blog/2021/04/21/jshell-accumulo-feature.html</guid> + + + <category>blog</category> + + </item> + + <item> <title>Apache Accumulo 2.0.1</title> <description><p>Apache Accumulo 2.0.1 contains bug fixes for 2.0.0.</p> @@ -1415,146 +1569,5 @@ stored in HDFS.</p> </item> - <item> - <title>Top 10 Reasons to Upgrade</title> - <description><p>Accumulo 2.0 has been in development for quite some time now and is packed with new features, bug -fixes, performance improvements and redesigned components. All of these changes bring challenges -when upgrading your production cluster so you may be wondering… why should I upgrade?</p> - -<p>My top 10 reasons to upgrade. For all changes see the <a href="/release/accumulo-2.0.0/">release notes</a></p> - -<ul> - <li><a href="#summaries">Summaries</a></li> - <li><a href="#new-bulk-import">New Bulk Import</a></li> - <li><a href="#simplified-scripts-and-config">Simplified Scripts and Config</a></li> - <li><a href="#new-monitor">New Monitor</a></li> - <li><a href="#new-apis">New APIs</a></li> - <li><a href="#offline-creation">Offline creation</a></li> - <li><a href="#search-documentation">Search Documentation</a></li> - <li><a href="#new-crypto">On disk encryption</a></li> - <li><a href="#zstandard-compression">ZStandard Compression</a></li> - <li><a href="#new-scan-executors">New Scan Executors</a></li> -</ul> - -<h3 id="summaries">Summaries</h3> - -<p>This feature allows detailed stats about Tables to be written directly into Accumulo files (R-Files). -Summaries can be used to make precise decisions about your data. Once configured, summaries become a -part of your Tables, so they won’t impact ingest or query performance of your cluster.</p> - -<p>Here are some example use cases:</p> - -<ul> - <li>A compaction could automatically run if deletes compose more than 25% of the data</li> - <li>An admin could optimize compactions by configuring specific age off of data</li> - <li>An admin could analyze R-File summaries for better performance tuning of a cluster</li> -</ul> - -<p>For more info check out the <a href="/docs/2.x//development/summaries">summary docs for 2.0</a></p> - -<h3 id="new-bulk-import">New Bulk Import</h3> - -<p>Bulk Ingest was completely redone for 2.0. Previously, Bulk Ingest relied on expensive inspections of -R-Files across multiple Tablet Servers. With enough data, an old Bulk Ingest operation could easily -hold up simpler Table operations and critical compactions of files.</p> - -<p>The new Bulk Ingest gives the user control over the R-File inspection, allows for offline bulk -ingesting and provides performance <a href="/release/accumulo-2.0.0/#new-bulk-import-api">improvements</a>.</p> - -<h2 id="simplified-scripts-and-config">Simplified Scripts and Config</h2> - -<p>Many improvements were done to the scripts and configuration. See Mike’s description of the <a href="/blog/2016/11/16/simpler-scripts-and-config.html">improvements.</a></p> - -<h2 id="new-monitor">New Monitor</h2> - -<p>The Monitor has been re-written using REST, Javascript and more modern Web Tech. It is faster, -cleaner and more maintainable than the previous version. Here is a screen shot:</p> - -<p><img src="/images/accumulo-monitor-1.png" width="50%" /></p> - -<h2 id="new-apis">New APIs</h2> - -<p>Connecting to Accumulo is now easier with a single point of entry for clients. It can now be done with -a fluent API, 2 imports and using minimal code:</p> - -<div class="language-java highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kn">import</span> <span class="nn">org.apache.accumulo.core.client.Accumulo</span><span class="o">;</span> -<span class="kn">import</span> <span class="nn">org.apache.accumulo.core.client.AccumuloClient</span><span class="o">;</span> - -<span class="k">try</span> <span class="o">(</span><span class="nc">AccumuloClient</span> <span class="n">client</span> <span class="o">=</span> <span class="nc">Accumulo</span><span class="o">.</span><span class="na">newClient</span><span class="o">()</span> - <span class="o">.</span><span class="na">to</span><span class="o">(</span><span class="s">"instance"</span><span class="o">,</span> <span class="s">"zk"</span><span class="o">)</span> - <span class="o">.</span><span class="na">as</span><span class="o">(</span><span class="s">"user"</span><span class="o">,</span> <span class="s">"pass"</span><span class="o">).</span><span class="na">build</span><span class="o">())</span> <span class="o&quo [...] - <span class="c1">// use the client</span> - <span class="n">client</span><span class="o">.</span><span class="na">tableOperations</span><span class="o">().</span><span class="na">create</span><span class="o">(</span><span class="s">"newTable"</span><span class="o">);</span> - <span class="o">}</span> -</code></pre></div></div> - -<p>As you can see the client is also closable, which gives developers more control over resources. -See the <a href="https://static.javadoc.io/org.apache.accumulo/accumulo-core/2.0.1/org/apache/accumulo/core/client/Accumulo.html">Accumulo entry point javadoc</a>.</p> - -<p>Key and Mutation have new fluent APIs, which now allow mixing of <code class="language-plaintext highlighter-rouge">String</code> and <code class="language-plaintext highlighter-rouge">byte[]</code> types.</p> - -<div class="language-java highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nc">Key</span> <span class="n">newKey</span> <span class="o">=</span> <span class="nc">Key</span><span class="o">.</span><span class="na">builder</span><span class="o">().</span [...] - -<span class="nc">Mutation</span> <span class="n">m</span> <span class="o">=</span> <span class="k">new</span> <span class="nc">Mutation</span><span class="o">(</span><span class="s">"row0017"</span><span class="o">);</span> -<span class="n">m</span><span class="o">.</span><span class="na">at</span><span class="o">().</span><span class="na">family</span><span class="o">(</span><span class="s">"001"</span><span class="o">).</span><span class="na">qualifier</span><span class="o">(</span&g [...] -<span class="n">m</span><span class="o">.</span><span class="na">at</span><span class="o">().</span><span class="na">family</span><span class="o">(</span><span class="s">"002"</span><span class="o">).</span><span class="na">qualifier</span><span class="o">(</span&g [...] -</code></pre></div></div> - -<p>More examples for <a href="https://github.com/apache/accumulo/blob/main/core/src/test/java/org/apache/accumulo/core/data/KeyBuilderTest.java">Key</a> and <a href="https://static.javadoc.io/org.apache.accumulo/accumulo-core/2.0.0/org/apache/accumulo/core/data/Mutation.html#at()">Mutation</a>.</p> - -<h2 id="table-creation-options">Table creation options</h2> - -<p>Tables can now be created with splits, which is much faster than creating a -table and then adding splits. Tables can also be created in an offline state -now. The new bulk import API supports offline tables. This enables the -following method of getting a lot of data into a new table very quickly.</p> - -<ul> - <li>Create offline table with splits</li> - <li>Bulk import into new offline table</li> - <li>Bring table online</li> -</ul> - -<p>See the javadoc for <a href="https://static.javadoc.io/org.apache.accumulo/accumulo-core/2.0.1/org/apache/accumulo/core/client/admin/NewTableConfiguration.html">NewTableConfiguration</a> and search for methods introduced in 2.0.0 for more information.</p> - -<h2 id="search-documentation">Search Documentation</h2> - -<p>New ability to quickly search documentation on the website. The user manual was completely redone -for 2.0. Check it out <a href="/docs/2.x//getting-started/quickstart">here</a>. Users can now quickly <a href="/search/">search</a> the website across all 2.x documentation.</p> - -<h2 id="new-crypto">New Crypto</h2> - -<p>On disk encryption was redone to be more secure and flexible. For an in depth description of how Accumulo -does on disk encryption, see the <a href="/docs/2.x//security/on-disk-encryption">user manual</a>. NOTE: This is currently an experimental feature. -An experimental feature is considered a work in progress or incomplete and could change.</p> - -<h2 id="zstandard-compression">Zstandard compression</h2> - -<p>Support for Zstandard compression was added in 2.0. It has been measured to perform better than -gzip (better compression ratio and speed) and snappy (better compression ratio). Checkout Facebook’s <a href="https://facebook.github.io/zstd/">github</a> for Zstandard and -the <a href="/docs/2.x//configuration/server-properties">table.file.compress.type</a> property for configuring Accumulo.</p> - -<h2 id="new-scan-executors">New Scan Executors</h2> - -<p>Users now have more control over scans with the new scan executors. Tables can be configured to utilize these -powerful new mechanisms using just a few properties, giving user control over things like scan prioritization and -better cluster resource utilization.</p> - -<p>For example, a cluster has a bunch of long running scans and one really fast scan. The long running scans will eat up -a majority of the server resources causing the one really fast scan to be delayed. Scan executors allow an admin -to configure the cluster in a way that allows the one fast scan to be prioritized and not have to wait.</p> - -<p>Checkout some examples in the <a href="/docs/2.x//administration/scan-executors">user guide</a>.</p> - -</description> - <pubDate>Mon, 12 Aug 2019 00:00:00 +0000</pubDate> - <link>https://accumulo.apache.org/blog/2019/08/12/why-upgrade.html</link> - <guid isPermaLink="true">https://accumulo.apache.org/blog/2019/08/12/why-upgrade.html</guid> - - - <category>blog</category> - - </item> - </channel> </rss> diff --git a/output/index.html b/output/index.html index 7b731fe..38942ca 100644 --- a/output/index.html +++ b/output/index.html @@ -181,6 +181,13 @@ <div class="row latest-news-item"> <div class="col-sm-12" style="margin-bottom: 5px"> + <span style="font-size: 12px; margin-right: 5px;">Apr 2021</span> + <a href="/blog/2021/04/21/jshell-accumulo-feature.html">Jshell Accumulo Feature</a> + </div> + </div> + + <div class="row latest-news-item"> + <div class="col-sm-12" style="margin-bottom: 5px"> <span style="font-size: 12px; margin-right: 5px;">Dec 2020</span> <a href="/release/accumulo-2.0.1/">Apache Accumulo 2.0.1</a> </div> @@ -207,13 +214,6 @@ </div> </div> - <div class="row latest-news-item"> - <div class="col-sm-12" style="margin-bottom: 5px"> - <span style="font-size: 12px; margin-right: 5px;">Dec 2019</span> - <a href="/blog/2019/12/16/accumulo-proxy.html">Accumulo Clients in Other Programming Languages</a> - </div> - </div> - <div id="news-archive-link"> <p>View all posts in the <a href="/news">news archive</a></p> </div> diff --git a/output/news/index.html b/output/news/index.html index 5d0962d..a7fb684 100644 --- a/output/news/index.html +++ b/output/news/index.html @@ -145,11 +145,22 @@ <div> -<h3>2020</h3> +<h3>2021</h3> <div class="row" style="margin-top: 15px"> + <div class="col-md-1">Apr 21</div> + <div class="col-md-10"><a href="/blog/2021/04/21/jshell-accumulo-feature.html">Jshell Accumulo Feature</a></div> + </div> + + + + + <hr /> + <h3>2020</h3> + + <div class="row" style="margin-top: 15px"> <div class="col-md-1">Dec 24</div> <div class="col-md-10"><a href="/release/accumulo-2.0.1/">Apache Accumulo 2.0.1</a></div> </div> diff --git a/output/search_data.json b/output/search_data.json index 473e08b..39745fc 100644 --- a/output/search_data.json +++ b/output/search_data.json @@ -302,6 +302,14 @@ }, + "blog-2021-04-21-jshell-accumulo-feature-html": { + "title": "Jshell Accumulo Feature", + "content" : "OverviewFirst introduced in Java 9, JShell is an interactive Read-Evaluate-Print-Loop (REPL) Java tool that interprets user’s input and outputs the results. This tool provides a convenient way to test out and execute quick tasks with Accumulo in the terminal. This feature is a part of the upcoming Accumulo 2.1 release. If you’re a developer and want to get involved in testing, contact us or review our contributing guide.Major Features Default JShell script provid [...] + "url": " /blog/2021/04/21/jshell-accumulo-feature.html", + "categories": "blog" + } + , + "release-accumulo-2-0-1": { "title": "Apache Accumulo 2.0.1", "content" : "Apache Accumulo 2.0.1 contains bug fixes for 2.0.0.Since 2.0 is a non-LTM release line, and since an LTM release line has not yetbeen made available for 2.x, this patch backports critical bug fixes to 2.0 toaddress security bug CVE-2020-17533 that could affect any existing 2.0.0users. Users that have already migrated to 2.0.0 are urged to upgrade to 2.0.1as soon as possible, and users of 1.10 who wish to upgrade to 2.0 shouldupgrade directly to 2.0.1, bypassing 2.0.0. [...]