Overview

This is the main documentation for the gora-accumulo module which enables Apache Accumulo backend support for Gora.

gora.properties

Gora Accumulo mappings

Say we wished to map some Employee data and store it into the AccumuloStore.

<gora-otd>
  <table name="Employee">
    <family name="info" />
    <config key="table.file.compress.blocksize" value="32K"/>
  </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-otd>

Here you can see that we require the definition of two child elements within the gora-otd mapping configuration, namely;

The table element; where we specify:

  1. a parameter relating to the Accumulo table name (String) e.g. name="Employee",

  2. 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;

    a name (String): family name e.g. info

    a config (key:value): which is a typical key/value-type configuration for Accumulo runtime configuration. A fully comprehensive list of options can be found here

The class element where we specify of persistent fields which values should map to. This contains;

  1. a parameter containing the Persistent class name e.g. org.apache.gora.examples.generated.Employee,

  2. a parameter containing the keyClass e.g. java.lang.String which specifies the keys which map to the field values,

  3. a parameter containing the Table name e.g. Employee which matches to the above Table definition,

  4. a parameter containing the Encoder to be used e.g. org.apache.gora.accumulo.encoders.BinaryEncoder which defines an appropriate encoder for for object field values.

  5. 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.