accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mwa...@apache.org
Subject [accumulo-website] branch asf-site updated: Jekyll build from master:77812b4
Date Tue, 29 Jan 2019 21:36:49 GMT
This is an automated email from the ASF dual-hosted git repository.

mwalch pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/accumulo-website.git


The following commit(s) were added to refs/heads/asf-site by this push:
     new ead7d43  Jekyll build from master:77812b4
ead7d43 is described below

commit ead7d43263d1dbef828ff075968f27c931186535
Author: Mike Walch <mwalch@apache.org>
AuthorDate: Tue Jan 29 16:36:08 2019 -0500

    Jekyll build from master:77812b4
    
    Update client documentation (#144)
---
 docs/2.x/getting-started/clients.html | 72 +++++++++++++++++++----------------
 feed.xml                              |  4 +-
 search_data.json                      |  2 +-
 3 files changed, 42 insertions(+), 36 deletions(-)

diff --git a/docs/2.x/getting-started/clients.html b/docs/2.x/getting-started/clients.html
index 3a08bc0..3afc323 100644
--- a/docs/2.x/getting-started/clients.html
+++ b/docs/2.x/getting-started/clients.html
@@ -566,18 +566,11 @@ changes to the columns of a single row. The changes are made atomically
in the
 TabletServer. Clients then add Mutations to a <a href="https://static.javadoc.io/org.apache.accumulo/accumulo-core/2.0.0-alpha-1/org/apache/accumulo/core/client/BatchWriter.html">BatchWriter</a>
which submits them to
 the appropriate TabletServers.</p>
 
-<p>Mutations can be created thus:</p>
+<p>The code below shows how a Mutation is created.</p>
 
-<div class="language-java highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span
class="n">Text</span> <span class="n">rowID</span> <span class="o">=</span>
<span class="k">new</span> <span class="n">Text</span><span class="o">(</span><span
class="s">"row1"</span><span class="o">);</span>
-<span class="n">Text</span> <span class="n">colFam</span> <span
class="o">=</span> <span class="k">new</span> <span class="n">Text</span><span
class="o">(</span><span class="s">"myColFam"</span><span class="o">);</span>
-<span class="n">Text</span> <span class="n">colQual</span> <span
class="o">=</span> <span class="k">new</span> <span class="n">Text</span><span
class="o">(</span><span class="s">"myColQual"</span><span class="o">);</span>
-<span class="n">ColumnVisibility</span> <span class="n">colVis</span>
<span class="o">=</span> <span class="k">new</span> <span class="n">ColumnVisibility</span><span
class="o">(</span><span class="s">"public"</span><span class="o">);</span>
-<span class="kt">long</span> <span class="n">timestamp</span> <span
class="o">=</span> <span class="n">System</span><span class="o">.</span><span
class="na">currentTimeMillis</span><span class="o">();</span>
-
-<span class="n">Value</span> <span class="n">value</span> <span
class="o">=</span> <span class="k">new</span> <span class="n">Value</span><span
class="o">(</span><span class="s">"myValue"</span><span class="o">.</span><span
class="na">getBytes</span><span class="o">());</span>
-
-<span class="n">Mutation</span> <span class="n">mutation</span> <span
class="o">=</span> <span class="k">new</span> <span class="n">Mutation</span><span
class="o">(</span><span class="n">rowID</span><span class="o">);</span>
-<span class="n">mutation</span><span class="o">.</span><span class="na">put</span><span
class="o">(</span><span class="n">colFam</span><span class="o">,</span>
<span class="n">colQual</span><span class="o">,</span> <span class="n">colVis</span><span
class="o">,</span> <span class="n">timestamp</span><span class="o">,</span>
<span class="n">value</span><span class="o">);</span>
+<div class="language-java highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span
class="n">Mutation</span> <span class="n">mutation</span> <span class="o">=</span>
<span class="k">new</span> <span class="n">Mutation</span><span
class="o">(</span><span class="s">"row1"</span><span class="o">);</span>
+<span class="n">mutation</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">"myColFam1"</span><span class="o">).</span><span class="na">qualifier</span><span
class="o">(</span><span class="s">"myColQual1"</span><span class="o">).</span><span
class="na">visibility</span><span class="o">(</span><span class="s">"public"</span><span
class="o">).</span><span class="na">put</span><span class="o [...]
+<span class="n">mutation</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">"myColFam2"</span><span class="o">).</span><span class="na">qualifier</span><span
class="o">(</span><span class="s">"myColQual2"</span><span class="o">).</span><span
class="na">visibility</span><span class="o">(</span><span class="s">"public"</span><span
class="o">).</span><span class="na">put</span><span class="o [...]
 </code></pre></div></div>
 
 <h3 id="batchwriter">BatchWriter</h3>
@@ -588,15 +581,13 @@ amortize network overhead. Care must be taken to avoid changing the
contents of
 any Object passed to the BatchWriter since it keeps objects in memory while
 batching.</p>
 
-<p>Mutations are added to a BatchWriter thus:</p>
-
-<div class="language-java highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span
class="c1">// BatchWriterConfig has reasonable defaults</span>
-<span class="n">BatchWriterConfig</span> <span class="n">config</span>
<span class="o">=</span> <span class="k">new</span> <span class="n">BatchWriterConfig</span><span
class="o">();</span>
-<span class="n">config</span><span class="o">.</span><span class="na">setMaxMemory</span><span
class="o">(</span><span class="mi">10000000L</span><span class="o">);</span>
<span class="c1">// bytes available to batchwriter for buffering mutations</span>
+<p>The code below shows how a Mutation is added to a BatchWriter:</p>
 
-<span class="n">BatchWriter</span> <span class="n">writer</span>
<span class="o">=</span> <span class="n">client</span><span class="o">.</span><span
class="na">createBatchWriter</span><span class="o">(</span><span class="s">"table"</span><span
class="o">,</span> <span class="n">config</span><span class="o">)</span>
-<span class="n">writer</span><span class="o">.</span><span class="na">addMutation</span><span
class="o">(</span><span class="n">mutation</span><span class="o">);</span>
-<span class="n">writer</span><span class="o">.</span><span class="na">close</span><span
class="o">();</span>
+<div class="language-java highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span
class="k">try</span> <span class="o">(</span><span class="n">BatchWriter</span>
<span class="n">writer</span> <span class="o">=</span> <span class="n">client</span><span
class="o">.</span><span class="na">createBatchWriter</span><span class="o">(</span><span
class="s">"mytable"</span><span class="o">))</span> <span class="o">{</span>
+  <span class="n">Mutation</span> <span class="n">m</span> <span
class="o">=</span> <span class="k">new</span> <span class="n">Mutation</span><span
class="o">(</span><span class="s">"row1"</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">"myfam"</span><span class="o">).</span><span class="na">qualifier</span><span
class="o">(</span><span class="s">"myqual"</span><span class="o">).</span><span
class="na">visibility</span><span class="o">(</span><span class="s">"public"</span><span
class="o">).</span><span class="na">put</span><span class="o">(</span><sp
[...]
+  <span class="n">writer</span><span class="o">.</span><span class="na">addMutation</span><span
class="o">(</span><span class="n">m</span><span class="o">);</span>
+<span class="o">}</span>
 </code></pre></div></div>
 
 <p>For more example code, see the <a href="https://github.com/apache/accumulo-examples/blob/master/docs/batch.md">batch
writing and scanning example</a>.</p>
@@ -678,20 +669,34 @@ to efficiently return ranges of consecutive keys and their associated
values.</p
 
 <h3 id="scanner">Scanner</h3>
 
-<p>To retrieve data, Clients use a <a href="https://static.javadoc.io/org.apache.accumulo/accumulo-core/2.0.0-alpha-1/org/apache/accumulo/core/client/Scanner.html">Scanner</a>,
which acts like an Iterator over
-keys and values. Scanners can be configured to start and stop at particular keys, and
+<p>To retrieve data, create a <a href="https://static.javadoc.io/org.apache.accumulo/accumulo-core/2.0.0-alpha-1/org/apache/accumulo/core/client/Scanner.html">Scanner</a>
using <a href="https://static.javadoc.io/org.apache.accumulo/accumulo-core/2.0.0-alpha-1/org/apache/accumulo/core/client/AccumuloClient.html">AccumuloClient</a>.
A Scanner acts like an Iterator over
+keys and values in the table.</p>
+
+<p>If a <a href="https://static.javadoc.io/org.apache.accumulo/accumulo-core/2.0.0-alpha-1/org/apache/accumulo/core/client/Scanner.html">Scanner</a>
is created without <a href="https://static.javadoc.io/org.apache.accumulo/accumulo-core/2.0.0-alpha-1/org/apache/accumulo/core/security/Authorizations.html">Authorizations</a>,
it uses all <a href="https://static.javadoc.io/org.apache.accumulo/accumulo-core/2.0.0-alpha-1/org/apache/accumulo/core/security/Authorizations.html">Authorizations</
[...]
+to the user that created the <a href="https://static.javadoc.io/org.apache.accumulo/accumulo-core/2.0.0-alpha-1/org/apache/accumulo/core/client/AccumuloClient.html">AccumuloClient</a>:</p>
+
+<div class="language-java highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span
class="n">Scanner</span> <span class="n">s</span> <span class="o">=</span>
<span class="n">client</span><span class="o">.</span><span class="na">createScanner</span><span
class="o">(</span><span class="s">"table"</span><span class="o">);</span>
+</code></pre></div></div>
+
+<p>A scanner can also be created to only use a subset of a user’s <a href="https://static.javadoc.io/org.apache.accumulo/accumulo-core/2.0.0-alpha-1/org/apache/accumulo/core/security/Authorizations.html">Authorizations</a>.</p>
+
+<div class="language-java highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span
class="n">Scanner</span> <span class="n">s</span> <span class="o">=</span>
<span class="n">client</span><span class="o">.</span><span class="na">createScanner</span><span
class="o">(</span><span class="s">"table"</span><span class="o">,</span>
<span class="k">new</span> <span class="n">Authorizations</span><span
class="o">(</span><span class="s">"public"</span><span class="o">));</span>
+</code></pre></div></div>
+
+<p>Scanners can be configured to start and stop at particular keys, and
 to return a subset of the columns available.</p>
 
-<div class="language-java highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span
class="c1">// specify which visibilities we are allowed to see</span>
+<div class="language-java highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span
class="c1">// return data with visibilities that match specified auths</span>
 <span class="n">Authorizations</span> <span class="n">auths</span>
<span class="o">=</span> <span class="k">new</span> <span class="n">Authorizations</span><span
class="o">(</span><span class="s">"public"</span><span class="o">);</span>
 
-<span class="n">Scanner</span> <span class="n">scan</span> <span
class="o">=</span> <span class="n">client</span><span class="o">.</span><span
class="na">createScanner</span><span class="o">(</span><span class="s">"table"</span><span
class="o">,</span> <span class="n">auths</span><span class="o">);</span>
-<span class="n">scan</span><span class="o">.</span><span class="na">setRange</span><span
class="o">(</span><span class="k">new</span> <span class="n">Range</span><span
class="o">(</span><span class="s">"harry"</span><span class="o">,</span><span
class="s">"john"</span><span class="o">));</span>
-<span class="n">scan</span><span class="o">.</span><span class="na">fetchColumnFamily</span><span
class="o">(</span><span class="k">new</span> <span class="n">Text</span><span
class="o">(</span><span class="s">"attributes"</span><span class="o">));</span>
+<span class="k">try</span> <span class="o">(</span><span class="n">Scanner</span>
<span class="n">scan</span> <span class="o">=</span> <span class="n">client</span><span
class="o">.</span><span class="na">createScanner</span><span class="o">(</span><span
class="s">"table"</span><span class="o">,</span> <span class="n">auths</span><span
class="o">))</span> <span class="o">{</span>
+  <span class="n">scan</span><span class="o">.</span><span class="na">setRange</span><span
class="o">(</span><span class="k">new</span> <span class="n">Range</span><span
class="o">(</span><span class="s">"harry"</span><span class="o">,</span><span
class="s">"john"</span><span class="o">));</span>
+  <span class="n">scan</span><span class="o">.</span><span class="na">fetchColumnFamily</span><span
class="o">(</span><span class="k">new</span> <span class="n">Text</span><span
class="o">(</span><span class="s">"attributes"</span><span class="o">));</span>
 
-<span class="k">for</span> <span class="o">(</span><span class="n">Entry</span><span
class="o">&lt;</span><span class="n">Key</span><span class="o">,</span><span
class="n">Value</span><span class="o">&gt;</span> <span class="n">entry</span>
<span class="o">:</span> <span class="n">scan</span><span class="o">)</span>
<span class="o">{</span>
-  <span class="n">Text</span> <span class="n">row</span> <span
class="o">=</span> <span class="n">entry</span><span class="o">.</span><span
class="na">getKey</span><span class="o">().</span><span class="na">getRow</span><span
class="o">();</span>
-  <span class="n">Value</span> <span class="n">value</span> <span
class="o">=</span> <span class="n">entry</span><span class="o">.</span><span
class="na">getValue</span><span class="o">();</span>
+  <span class="k">for</span> <span class="o">(</span><span class="n">Entry</span><span
class="o">&lt;</span><span class="n">Key</span><span class="o">,</span><span
class="n">Value</span><span class="o">&gt;</span> <span class="n">entry</span>
<span class="o">:</span> <span class="n">scan</span><span class="o">)</span>
<span class="o">{</span>
+    <span class="n">Text</span> <span class="n">row</span> <span
class="o">=</span> <span class="n">entry</span><span class="o">.</span><span
class="na">getKey</span><span class="o">().</span><span class="na">getRow</span><span
class="o">();</span>
+    <span class="n">Value</span> <span class="n">value</span> <span
class="o">=</span> <span class="n">entry</span><span class="o">.</span><span
class="na">getValue</span><span class="o">();</span>
+  <span class="o">}</span>
 <span class="o">}</span>
 </code></pre></div></div>
 
@@ -735,12 +740,13 @@ TabletServers in parallel.</p>
 <div class="language-java highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span
class="n">ArrayList</span><span class="o">&lt;</span><span class="n">Range</span><span
class="o">&gt;</span> <span class="n">ranges</span> <span class="o">=</span>
<span class="k">new</span> <span class="n">ArrayList</span><span
class="o">&lt;</span><span class="n">Range</span><span class="o">&gt;();</span>
 <span class="c1">// populate list of ranges ...</span>
 
-<span class="n">BatchScanner</span> <span class="n">bscan</span>
<span class="o">=</span> <span class="n">client</span><span class="o">.</span><span
class="na">createBatchScanner</span><span class="o">(</span><span
class="s">"table"</span><span class="o">,</span> <span class="n">auths</span><span
class="o">,</span> <span class="mi">10</span><span class="o">);</span>
-<span class="n">bscan</span><span class="o">.</span><span class="na">setRanges</span><span
class="o">(</span><span class="n">ranges</span><span class="o">);</span>
-<span class="n">bscan</span><span class="o">.</span><span class="na">fetchColumnFamily</span><span
class="o">(</span><span class="s">"attributes"</span><span class="o">);</span>
+<span class="k">try</span> <span class="o">(</span><span class="n">BatchScanner</span>
<span class="n">bscan</span> <span class="o">=</span> <span class="n">client</span><span
class="o">.</span><span class="na">createBatchScanner</span><span
class="o">(</span><span class="s">"table"</span><span class="o">,</span>
<span class="n">auths</span><span class="o">,</span> <span class="mi">10</span><span
class="o">))</span> <span class="o">{</span>
+  <span class="n">bscan</span><span class="o">.</span><span class="na">setRanges</span><span
class="o">(</span><span class="n">ranges</span><span class="o">);</span>
+  <span class="n">bscan</span><span class="o">.</span><span class="na">fetchColumnFamily</span><span
class="o">(</span><span class="s">"attributes"</span><span class="o">);</span>
 
-<span class="k">for</span> <span class="o">(</span><span class="n">Entry</span><span
class="o">&lt;</span><span class="n">Key</span><span class="o">,</span><span
class="n">Value</span><span class="o">&gt;</span> <span class="n">entry</span>
<span class="o">:</span> <span class="n">bscan</span><span class="o">)</span>
<span class="o">{</span>
-  <span class="n">System</span><span class="o">.</span><span class="na">out</span><span
class="o">.</span><span class="na">println</span><span class="o">(</span><span
class="n">entry</span><span class="o">.</span><span class="na">getValue</span><span
class="o">());</span>
+  <span class="k">for</span> <span class="o">(</span><span class="n">Entry</span><span
class="o">&lt;</span><span class="n">Key</span><span class="o">,</span><span
class="n">Value</span><span class="o">&gt;</span> <span class="n">entry</span>
<span class="o">:</span> <span class="n">bscan</span><span class="o">)</span>
<span class="o">{</span>
+    <span class="n">System</span><span class="o">.</span><span
class="na">out</span><span class="o">.</span><span class="na">println</span><span
class="o">(</span><span class="n">entry</span><span class="o">.</span><span
class="na">getValue</span><span class="o">());</span>
+  <span class="o">}</span>
 <span class="o">}</span>
 </code></pre></div></div>
 
diff --git a/feed.xml b/feed.xml
index 1609ad2..5e8ccc4 100644
--- a/feed.xml
+++ b/feed.xml
@@ -6,8 +6,8 @@
 </description>
     <link>https://accumulo.apache.org/</link>
     <atom:link href="https://accumulo.apache.org/feed.xml" rel="self" type="application/rss+xml"/>
-    <pubDate>Mon, 28 Jan 2019 10:52:00 -0500</pubDate>
-    <lastBuildDate>Mon, 28 Jan 2019 10:52:00 -0500</lastBuildDate>
+    <pubDate>Tue, 29 Jan 2019 16:35:58 -0500</pubDate>
+    <lastBuildDate>Tue, 29 Jan 2019 16:35:58 -0500</lastBuildDate>
     <generator>Jekyll v3.7.3</generator>
     
     
diff --git a/search_data.json b/search_data.json
index 4d19868..53c1166 100644
--- a/search_data.json
+++ b/search_data.json
@@ -135,7 +135,7 @@
   
     "docs-2-x-getting-started-clients": {
       "title": "Accumulo Clients",
-      "content"	 : "Creating Client CodeIf you are using Maven to create Accumulo client
code, add the following dependency to your pom:&amp;lt;dependency&amp;gt;  &amp;lt;groupId&amp;gt;org.apache.accumulo&amp;lt;/groupId&amp;gt;
 &amp;lt;artifactId&amp;gt;accumulo-core&amp;lt;/artifactId&amp;gt;  &amp;lt;version&amp;gt;2.0.0-alpha-1&amp;lt;/version&amp;gt;&amp;lt;/dependency&amp;gt;When
writing code that uses Accumulo, only use the Accumulo Public API.The accumulo-core artifact
include [...]
+      "content"	 : "Creating Client CodeIf you are using Maven to create Accumulo client
code, add the following dependency to your pom:&amp;lt;dependency&amp;gt;  &amp;lt;groupId&amp;gt;org.apache.accumulo&amp;lt;/groupId&amp;gt;
 &amp;lt;artifactId&amp;gt;accumulo-core&amp;lt;/artifactId&amp;gt;  &amp;lt;version&amp;gt;2.0.0-alpha-1&amp;lt;/version&amp;gt;&amp;lt;/dependency&amp;gt;When
writing code that uses Accumulo, only use the Accumulo Public API.The accumulo-core artifact
include [...]
       "url": " /docs/2.x/getting-started/clients",
       "categories": "getting-started"
     },


Mime
View raw message