You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gora.apache.org by bu...@apache.org on 2014/06/04 23:30:00 UTC

svn commit: r911366 - in /websites/staging/gora/trunk/content: ./ current/gora-accumulo.html

Author: buildbot
Date: Wed Jun  4 21:30:00 2014
New Revision: 911366

Log:
Staging update by buildbot for gora

Modified:
    websites/staging/gora/trunk/content/   (props changed)
    websites/staging/gora/trunk/content/current/gora-accumulo.html

Propchange: websites/staging/gora/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Wed Jun  4 21:30:00 2014
@@ -1 +1 @@
-1600406
+1600511

Modified: websites/staging/gora/trunk/content/current/gora-accumulo.html
==============================================================================
--- websites/staging/gora/trunk/content/current/gora-accumulo.html (original)
+++ websites/staging/gora/trunk/content/current/gora-accumulo.html Wed Jun  4 21:30:00 2014
@@ -160,17 +160,53 @@ under the License. 
 enables <a href="http://accumulo.apache.org">Apache Accumulo</a> backend support for Gora. </p>
 <h2 id="goraproperties">gora.properties</h2>
 <ul>
-<li>gora.datastore.default=org.apache.gora.accumulo.store.AccumuloStore - Implementation of the storage class </li>
-<li>gora.accumulo.mapping.file                                          - The XML mapping file to be used </li>
-<li>gora.datastore.accumulo.mock=true                                   - coming soon</li>
-<li>gora.datastore.accumulo.instance=a14                                - coming soon</li>
-<li>gora.datastore.accumulo.zookeepers=localhost                        - coming soon</li>
-<li>gora.datastore.accumulo.user=root                                   - coming soon</li>
-<li>gora.datastore.accumulo.password=secret                             - coming soon</li>
+<li><code>gora.datastore.default</code>=org.apache.gora.accumulo.store.AccumuloStore - Implementation of the storage class </li>
+<li><code>gora.accumulo.mapping.file</code>=gora-accumulo-mapping.xml                - The XML mapping file to be used </li>
+<li><code>gora.datastore.accumulo.mock</code>=true                                   - Mock Accumulo supplies mock implementations for much of the client API. It presently does not enforce users, logins, permissions, etc. It does support Iterators and Combiners. Note that MockAccumulo holds all data in memory, and will not retain any data or settings between runs. </li>
+<li><code>gora.datastore.accumulo.instance</code>=a14                                - An identifier for the Accumulo instance</li>
+<li><code>gora.datastore.accumulo.zookeepers</code>=localhost                        - This value should specify the host:port for a running Zookeeper server or node. In this case the server happens to be running on localhost which is the default server configuration.</li>
+<li><code>gora.datastore.accumulo.user</code>=root                                   - This relates to the name of the client which will be communicating with Accumulo. This is also used for authentication purposes.</li>
+<li><code>gora.datastore.accumulo.password</code>=secret                             - This relates to the password of the client which will be communicating with Accumulo. This is also used for authentication purposes.</li>
 </ul>
 <h2 id="gora-accumulo-mappings">Gora Accumulo mappings</h2>
+<p>Say we wished to map some Employee data and store it into the AccumuloStore.</p>
+<div class="codehilite"><pre><span class="nt">&lt;gora-orm&gt;</span>
+  <span class="nt">&lt;table</span> <span class="na">name=</span><span class="s">&quot;Employee&quot;</span><span class="nt">&gt;</span>
+    <span class="nt">&lt;family</span> <span class="na">name=</span><span class="s">&quot;info&quot;</span> 
+        <span class="na">config=</span><span class="s">&quot;$$$&quot;</span><span class="nt">/&gt;</span>
+  <span class="nt">&lt;/table&gt;</span>
+
+  <span class="nt">&lt;class</span> <span class="na">name=</span><span class="s">&quot;org.apache.gora.examples.generated.Employee&quot;</span> <span class="na">keyClass=</span><span class="s">&quot;java.lang.String&quot;</span> <span class="na">table=</span><span class="s">&quot;Employee&quot;</span> 
+      <span class="na">encoder=</span><span class="s">&quot;org.apache.gora.accumulo.encoders.BinaryEncoder&quot;</span><span class="nt">&gt;</span>
+    <span class="nt">&lt;field</span> <span class="na">name=</span><span class="s">&quot;name&quot;</span> <span class="na">family=</span><span class="s">&quot;info&quot;</span> <span class="na">qualifier=</span><span class="s">&quot;nm&quot;</span><span class="nt">/&gt;</span>
+    <span class="nt">&lt;field</span> <span class="na">name=</span><span class="s">&quot;dateOfBirth&quot;</span> <span class="na">family=</span><span class="s">&quot;info&quot;</span> <span class="na">qualifier=</span><span class="s">&quot;db&quot;</span><span class="nt">/&gt;</span>
+    <span class="nt">&lt;field</span> <span class="na">name=</span><span class="s">&quot;ssn&quot;</span> <span class="na">family=</span><span class="s">&quot;info&quot;</span> <span class="na">qualifier=</span><span class="s">&quot;sn&quot;</span><span class="nt">/&gt;</span>
+    <span class="nt">&lt;field</span> <span class="na">name=</span><span class="s">&quot;salary&quot;</span> <span class="na">family=</span><span class="s">&quot;info&quot;</span> <span class="na">qualifier=</span><span class="s">&quot;sl&quot;</span><span class="nt">/&gt;</span>
+    <span class="nt">&lt;field</span> <span class="na">name=</span><span class="s">&quot;boss&quot;</span> <span class="na">family=</span><span class="s">&quot;info&quot;</span> <span class="na">qualifier=</span><span class="s">&quot;bs&quot;</span><span class="nt">/&gt;</span>
+    <span class="nt">&lt;field</span> <span class="na">name=</span><span class="s">&quot;webpage&quot;</span> <span class="na">family=</span><span class="s">&quot;info&quot;</span> <span class="na">qualifier=</span><span class="s">&quot;wp&quot;</span><span class="nt">/&gt;</span>
+  <span class="nt">&lt;/class&gt;</span>
+<span class="nt">&lt;/gora-orm&gt;</span>
+</pre></div>
+
+
+<p>Here you can see that we require the definition of two child elements within the gora-orm mapping configuration, namely;</p>
+<p>The <strong>table</strong> element; where we specify:</p>
+<ul>
+<li>a parameter relating to the Accumulo table name (String) e.g. name="Employee",</li>
+<li>a nested element containing the type and definition of any families we wish to create within Accumulo. In this case we create one family <em>info</em> which could have a combination of any of the following parameters;</li>
+<li>name (String): family name e.g. info</li>
+<li>config (String): ...</li>
+</ul>
+<p>The <strong>class</strong> element where we specify of persistent fields which values should map to. This contains;</p>
 <ul>
-<li>coming soon</li>
+<li>a parameter containing the Persistent class name e.g. <code>org.apache.gora.examples.generated.Employee</code>,</li>
+<li>a parameter containing the keyClass e.g. <code>java.lang.String</code> which specifies the keys which map to the field values,</li>
+<li>a parameter containing the Table name e.g. <code>Employee</code> which matches to the above Table definition,</li>
+<li>a parameter containing the Encoder to be used e.g. <code>org.apache.gora.accumulo.encoders.BinaryEncoder</code> which defines an appropriate <a href="https://github.com/apache/gora/tree/master/gora-accumulo/src/main/java/org/apache/gora/accumulo/encoders">encoder</a> for for object field values. </li>
+<li>finally nested child element(s) mapping fields which are to be persisted into Accumulo. These fields need to be configured such that they receive;</li>
+<li>a parameter containing the name e.g. (name, dateOfBirth, ssn and salary respectively),</li>
+<li>a parameter containing the column family to which they belong e.g. (all info in this case),</li>
+<li>an optional parameter qualifier, which enables more granular control over the data to be persisted into HBase.</li>
 </ul>
 
   </div> <!-- /container (main block) -->