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

svn commit: r1600511 - /gora/site/trunk/content/current/gora-accumulo.md

Author: lewismc
Date: Wed Jun  4 21:29:52 2014
New Revision: 1600511

URL: http://svn.apache.org/r1600511
Log:
Update Accumulo docs

Modified:
    gora/site/trunk/content/current/gora-accumulo.md

Modified: gora/site/trunk/content/current/gora-accumulo.md
URL: http://svn.apache.org/viewvc/gora/site/trunk/content/current/gora-accumulo.md?rev=1600511&r1=1600510&r2=1600511&view=diff
==============================================================================
--- gora/site/trunk/content/current/gora-accumulo.md (original)
+++ gora/site/trunk/content/current/gora-accumulo.md Wed Jun  4 21:29:52 2014
@@ -5,13 +5,50 @@ This is the main documentation for the g
 enables [Apache Accumulo](http://accumulo.apache.org) backend support for Gora. 
 
 ##gora.properties 
-* gora.datastore.default=org.apache.gora.accumulo.store.AccumuloStore - Implementation of the storage class 
-* gora.accumulo.mapping.file                                          - The XML mapping file to be used 
-* gora.datastore.accumulo.mock=true                                   - coming soon
-* gora.datastore.accumulo.instance=a14                                - coming soon
-* gora.datastore.accumulo.zookeepers=localhost                        - coming soon
-* gora.datastore.accumulo.user=root                                   - coming soon
-* gora.datastore.accumulo.password=secret                             - coming soon
+* <code>gora.datastore.default</code>=org.apache.gora.accumulo.store.AccumuloStore - Implementation of the storage class 
+* <code>gora.accumulo.mapping.file</code>=gora-accumulo-mapping.xml                - The XML mapping file to be used 
+* <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. 
+* <code>gora.datastore.accumulo.instance</code>=a14                                - An identifier for the Accumulo instance
+* <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.
+* <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.
+* <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.
 
 ##Gora Accumulo mappings 
-* coming soon
+Say we wished to map some Employee data and store it into the AccumuloStore.
+
+    <gora-orm>
+      <table name="Employee">
+        <family name="info" 
+            config="$$$"/>
+      </table>
+
+      <class name="org.apache.gora.examples.generated.Employee" keyClass="java.lang.String" table="Employee" 
+          encoder="org.apache.gora.accumulo.encoders.BinaryEncoder">
+        <field name="name" family="info" qualifier="nm"/>
+        <field name="dateOfBirth" family="info" qualifier="db"/>
+        <field name="ssn" family="info" qualifier="sn"/>
+        <field name="salary" family="info" qualifier="sl"/>
+        <field name="boss" family="info" qualifier="bs"/>
+        <field name="webpage" family="info" qualifier="wp"/>
+      </class>
+    </gora-orm>
+
+Here you can see that we require the definition of two child elements within the gora-orm mapping configuration, namely;
+
+The **table** element; where we specify:
+
+* a parameter relating to the Accumulo table name (String) e.g. name="Employee",
+* a nested element containing the type and definition of any families we wish to create within Accumulo. In this case we create one family *info* which could have a combination of any of the following parameters;
+  * name (String): family name e.g. info
+  * config (String): ...
+
+The **class** element where we specify of persistent fields which values should map to. This contains;
+
+* a parameter containing the Persistent class name e.g. <code>org.apache.gora.examples.generated.Employee</code>,
+* a parameter containing the keyClass e.g. <code>java.lang.String</code> which specifies the keys which map to the field values,
+* a parameter containing the Table name e.g. <code>Employee</code> which matches to the above Table definition,
+* a parameter containing the Encoder to be used e.g. <code>org.apache.gora.accumulo.encoders.BinaryEncoder</code> which defines an appropriate [encoder](https://github.com/apache/gora/tree/master/gora-accumulo/src/main/java/org/apache/gora/accumulo/encoders) for for object field values. 
+* finally nested child element(s) mapping fields which are to be persisted into Accumulo. These fields need to be configured such that they receive;
+ * a parameter containing the name e.g. (name, dateOfBirth, ssn and salary respectively),
+ * a parameter containing the column family to which they belong e.g. (all info in this case),
+ * an optional parameter qualifier, which enables more granular control over the data to be persisted into HBase.