Skip to content

Common Configuration

xamry edited this page Nov 8, 2012 · 3 revisions
Clone this wiki locally

This page provides information on different configurations you would require to make (irrespective of datastore under use) in order to use Kundera.

Persistence.xml

Kundera (or any JPA provider for that matter) requires you to define persistence units in this file. It must be put under META-INF folder in your classpath. Here are things to keep in mind:

  1. You must set Persistence Provider to: com.impetus.kundera.KunderaPersistence
  2. Below are the properties that you need to define under properties tag.

kundera.nodes: Node(s) on which your NoSQL database server is running

kundera.port: NoSQL database port

kundera.keyspace: Database schema

kundera.dialect: Used by Kundera to determine persistence provider implementation. Possible values are cassandra, hbase and mongodb.

kundera.client.lookup.class: This is used by Kundera to find low level data-store specific dialect class that it uses to perform operations on underlying datastore. Possible values are:

  • For Cassandra: com.impetus.client.cassandra.pelops.PelopsClientFactory OR com.impetus.client.cassandra.thrift.ThriftClientFactory (PelopsClient used scale7-pelops library while ThriftClient uses Cassandra Thrift library)
  • For HBase: com.impetus.client.hbase.HBaseClientFactory
  • For MongoDB: com.impetus.client.mongodb.MongoDBClientFactory (uses mongo-java-driver from here)
  • For RDBMS: com.impetus.client.rdbms.RDBMSClientFactory (uses hibernate library)

kundera.cache.provider.class: This is L2 cache implementation class. It should be set to com.impetus.kundera.cache.ehcache.EhCacheProvider or your own cache provider class if you chose to make your own.

kundera.cache.config.resource: File containing L2 cache configuration.

kundera.ddl.auto.prepare (Optional): This is used by Kundera to automatically generate schema and tables for all entities within a given persistence unit. Possible options are:

  • create: Drops(if exists) schema and then creates schema/ tables based on entity definitions.
  • create-drop: Drops(if exists) schema, creates schema/ tables based on entity definitions and finally drops schema after operation ends.
  • update: Updates schema/ tables based on entity definition.
  • validate: Validates schema/ tables based on entity definition. Throws SchemaGenerationException if validation fails.

kundera.pool.size.max.active (Optional): Cap on the number of object instances managed by the pool per node.

kundera.pool.size.max.idle (Optional): Cap on the number of "idle" instances in the pool.

kundera.pool.size.min.idle (Optional): Minimum number of idle objects to maintain in each of the nodes.

kundera.pool.size.max.total (Optional): Cap on the total number of instances from all nodes combined.

index.home.dir (Optional): Directory path where you intend to store Lucene indexes (if you chose to use lucene indexes instead of inbuilt secondary indexes provided by underlying datastore).

kundera.client.property (Optional): Name of database-specific configuration file that must be in classpath. For more, see Data store Specific Configuration.

kundera.batch.size (Optional): Batch size in integer for bulk insert/ update.

kundera.username (Optional): User name to authenticate to for Cassandra and MongoDB.

kundera.password (Optional): Password for login authentication for Cassandra and MongoDB.


Home

Something went wrong with that request. Please try again.