-
Notifications
You must be signed in to change notification settings - Fork 233
Kundera with HBase
Apache HBase is an open-source column-oriented, non-relational, distributed database that supports data versioning and is written in Java. It is developed as part of Apache Software Foundation's Apache Hadoop project and runs on the top of HDFS, providing BigTable-like capabilities for Hadoop. HBase can host very large tables consisting of billions of rows and millions of columns.
Being a JPA provider, Kundera provides support for HBase. It allows to perform CRUD and query operation over HBase using JPA specifications. There are two implementations of Kundera for HBase.
- kundera-hbase
- kundera-hbase-v2
To use it, you need to have the following dependency in your pom.xml.
<dependency>
<groupId>com.impetus.kundera.client</groupId>
<artifactId>kundera-hbase</artifactId>
<version>${kundera.version}</version>
</dependency>
In this implementation, a single hTable with multiple column families is used.
- keyspace ==> hTable
- entity ==> column family (a column family for each entity class)
To use it, you need to have the following dependency in your pom.xml.
<dependency>
<groupId>com.impetus.kundera.client</groupId>
<artifactId>kundera-hbase-v2</artifactId>
<version>${kundera.version}</version>
</dependency>
In this implementation, multiple hTables are used.
- keyspace ==> namespace
- entity ==> hTable (one hTable for each entity)
This implementation supports complex queries (nested AND OR queries), CRUD and query for nested embeddables, aggregations (using elastic as indexing store).
<persistence-unit name="hbase_pu">
<provider>com.impetus.kundera.KunderaPersistence</provider>
<properties>
<property name="kundera.nodes" value="localhost" />
<property name="kundera.port" value="60000" />
<property name="kundera.keyspace" value="hbaseDB" />
<property name="kundera.dialect" value="hbase" />
<property name="kundera.ddl.auto.prepare" value="create" />
<property name="kundera.client.lookup.class"
value="com.impetus.client.hbase.HBaseClientFactory" />
</properties>
</persistence-unit>
For kundera-hbase, refer this test case
For kundera-hbase-v2, view this test case for CRUD and for Query
- Enable support for inheritance in kundera-hbase-v2
- Enable support for 'BETWEEN' queries