This is the main documentation for the gora-ignite module. gora-ignite module enables Apache Ignite backend support for Gora.
gora.datastore.default=org.apache.gora.ignite.store.IgniteStore
- Implementation of the persistent Java storage class for Ignitegora.datastore.ignite.schema=PUBLIC
- Property pointing to the Schema of the Ignite instancegora.datastore.ignite.host=localhost
- Property pointing to the host where the server is runninggora.datastore.ignite.port=10800
- Property pointing to the port where the server is runninggora.datastore.ignite.user=username
- An optional property defining the username of the server if availablegora.datastore.ignite.password=password
- An optional property defining the password of the server if availablegora.datastore.ignite.additionalConfigurations=
- An optional property defining additional configurations for the Ignite connection, format and available parameters: Ignite JDBC ParametersYou should then create a gora-ignite-mapping.xml which will describe how you want to store each of your Gora persistent objects and which primary keys you want to use:
<gora-otd>
<class name="org.apache.gora.examples.generated.Employee" keyClass="java.lang.String" table="Employee">
<primarykey column="pkssn" type="VARCHAR" />
<field name="ssn" column="ssn" type="VARCHAR"/>
<field name="name" column="name" type="VARCHAR"/>
<field name="dateOfBirth" column="dateOfBirth" type="BIGINT"/>
<field name="salary" column="salary" type="INT"/>
<field name="boss" column="boss" type="BINARY"/>
<field name="webpage" column="webpage" type="BINARY"/>
</class>
</gora-otd>
Here you can see that we require the definition of child elements within the gora-otd
mapping configuration.
Each class element should contain the following elements;
a parameter defining the Persistent class name e.g. org.apache.gora.examples.generated.Employee,
a parameter defining the keyClass e.g. java.lang.String which specifies the key which maps to the field values,
a parameter defining the table e.g. Employee which will be used to persist each Gora object
In addition, within the class element we should define two type of child elements: a primary key (primarykey tag) and some fields (field tag).
The primary key element defines which column is used by Ignite to identify the records stored in the DataStore. It has two costumizable parameters: column which defines the column's name of the table to be used as identifier for the records. And type which defines the data type of the aforementioned column.
The fields elements define the actual mapping between persistent object's attributes and the table's columns. These mapping have three customizable parameters: name which correspond to the object attribute's name. column which defines the column's name of the table to be assosiated with the attribute. And type which defines the data type of that column.
Notice that complex structures such 3-union fields are mapped using Binary fields through Avro serialization.
Description of supported type values:
Type value | Description |
---|---|
BINARY | Store as Byte[] |
BOOLEAN | Store as Boolean |
INT | Store as Integer |
TINYINT | Store as Byte |
SMALLINT | Store as Short |
BIGINT | Store as Long |
DECIMAL | Store as BigDecimal |
DOUBLE | Store as Double |
REAL | Store as Float |
VARCHAR | Store as Unicode string |
A more detailed list of data types supported by Ignite and its equivalents in Java refer to Ignite JDBC Data types