Author: buildbot
Date: Wed Feb 12 13:54:44 2014
New Revision: 897617

Log:
Staging update by buildbot for gora

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

Propchange: websites/staging/gora/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Wed Feb 12 13:54:44 2014
@@ -1 +1 @@
-1567614
+1567625

Modified: websites/staging/gora/trunk/content/current/gora-hbase.html
==============================================================================
--- websites/staging/gora/trunk/content/current/gora-hbase.html (original)
+++ websites/staging/gora/trunk/content/current/gora-hbase.html Wed Feb 12 
13:54:44 2014
@@ -137,11 +137,50 @@ module enables <a href="http://hbase.apa
 <ul>
 <li>gora.datastore.default=org.apache.gora.hbase.store.HBaseStore - 
Implementation of the storage class </li>
 <li>gora.datastore.autocreateschema=true - Create the table if doesn't 
exist</li>
+<li>gora.datastore.scanner.caching=1000 - HBase client cache that improves the 
scan in HBase (default 0) <b>n.b.</b> Coming in 0.4 (/trunk)</li>
 </ul>
-<p>Coming in 0.4 (/trunk):
-* gora.datastore.scanner.caching=1000 - HBase client cache that improves the 
scan in HBase (default 0)</p>
 <h2 id="gora-hbase-mappings">Gora HBase mappings</h2>
-<p>Coming soon</p>
+<p>Say we wished to map some Employee data and store it into the 
HBaseStore.</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="nt">/&gt;</span> <span 
class="c">&lt;!-- This can also have params like compression, bloom filters, 
etc. Please see below --&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="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 
+<code>gora-orm</code> mapping configuration, namely;
+1. The table element; where we specify: 
+    the HBase table name e.g. <b>Employee</b>, 
+    the type and definition of families we wish to create within HBase. 
+In this case we create one family which could have a combination of any of the 
following characteristics;
+    <b>name</b>: family name e.g. info
+    <b>compression</b>: the compression option to use in HBase. Please see <a 
href="http://hbase.apache.org/book/compression.html";>HBase documentation</a>.
+    <b>blockCache</b>:  an LRU cache that contains three levels of block 
priority to allow for scan-resistance and in-memory ColumnFamilies. Please see 
<a 
href="https://hbase.apache.org/book/regionserver.arch.html#block.cache";>HBase 
documentation</a>.
+    <b>blockSize</b>: The blocksize can be configured for each ColumnFamily in 
a table, and this defaults to 64k. Larger cell values require larger 
blocksizes. There is an inverse relationship between blocksize and the 
resulting StoreFile indexes (i.e., if the blocksize is doubled then the 
resulting indexes should be roughly halved). Please see <a 
href="http://hbase.apache.org/book/perf.schema.html#schema.cf.blocksize";>HBase 
documentation</a>. 
+    <b>bloomFilter</b>: Bloom Filters can be enabled per-ColumnFamily. We use 
<code>HColumnDescriptor.setBloomFilterType(NONE | ROW | ROWCOL)</code> to 
enable blooms per Column Family. Default = NONE for no bloom filters. If ROW, 
the hash of the row will be added to the bloom on each insert. If ROWCOL, the 
hash of the row + column family name + column family qualifier will be added to 
the bloom on each key insert. Please see <a 
href="http://hbase.apache.org/book/perf.schema.html#schema.bloom";>HBase 
documentation</a>.
+    <b>maxVersions</b>: The maximum number of row versions to store is 
configured per column family via <code>HColumnDescriptor</code>. The default 
for max versions is <b>3</b>. This is an important parameter because HBase does 
not overwrite row values, but rather stores different values per row by time 
(and qualifier). Excess versions are removed during major compaction's. The 
number of max versions may need to be increased or decreased depending on 
application needs. Please see <a 
href="http://hbase.apache.org/book/schema.versions.html";>HBase 
documentation</a>.
+    <b>timeToLive</b>: ColumnFamilies can set a TTL length in seconds, and 
HBase will automatically delete rows once the expiration time is reached. This 
applies to all versions of a row - even the current one. The TTL time encoded 
in the HBase for the row is specified in UTC. Please see <a 
href="https://hbase.apache.org/book/ttl.html";>HBase documentation</a>.
+    <b>inMemory</b>: ColumnFamilies can optionally be defined as in-memory. 
Data is still persisted to disk, just like any other ColumnFamily. In-memory 
blocks have the highest priority in the Block Cache, but it is not a guarantee 
that the entire table will be in memory. Please see <a 
href="http://hbase.apache.org/book/perf.schema.html#cf.in.memory";>HBase 
documentation</a>.
+2. Specification of persistent fields which values should map to; 
+    the Persistent class name e.g. 
<b>org.apache.gora.examples.generated.Employee</b>, 
+    the keyClass e.g. <b>java.lang.String</b> which specifies the keys which 
map to the field 
+values, 
+    the Table e.g. <b>Employee</b> which matches to the above Table definition,
+    finally fields which are to be persisted into HBase need to be configured 
such that they 
+receive a <b>name</b> e.g. (name, dateOfBirth, ssn and salary respectively), 
the column <b>family</b> 
+to which they belong e.g. (all info in this case) and an additional 
<b>qualifier</b>, which enables 
+more granular control over the data to be persisted into HBase.</p>
 
   </div> <!-- /container (main block) -->
 


Reply via email to