Author: lewismc Date: Thu Aug 25 07:04:00 2016 New Revision: 1757612 URL: http://svn.apache.org/viewvc?rev=1757612&view=rev Log: GORA-484 Add documentation to JCache Datastore
Added: gora/site/trunk/content/current/gora-jcache.md Modified: gora/site/trunk/content/current/index.md gora/site/trunk/content/current/tutorial.md Added: gora/site/trunk/content/current/gora-jcache.md URL: http://svn.apache.org/viewvc/gora/site/trunk/content/current/gora-jcache.md?rev=1757612&view=auto ============================================================================== --- gora/site/trunk/content/current/gora-jcache.md (added) +++ gora/site/trunk/content/current/gora-jcache.md Thu Aug 25 07:04:00 2016 @@ -0,0 +1,126 @@ +Title: Gora JCache Module + +##Overview +This is the main documentation for the gora-jcache module. gora-jcache +module enables [Hazelcast JCache](https://hazelcast.com/use-cases/caching/jcache-provider) caching support for Gora. +This implementation is based on Hazelcast JCache provider. This dataStore can act as wrapped caching layer for any other +persistent Apache Gora persistent dataStore. + +[TOC] + +##gora.properties + +* <code>gora.cache.datastore.default</code> - Caching dataStore to be used with persistent dataStore. If JCache dataStore is used as caching store +assigned value should be <b>org.apache.gora.jcache.store.JCacheStore</b> <code>( Mandatory )</code> + +* <code>gora.datastore.default</code> - Persistent back-end dataStore to be used with JCache caching dataStore. <code>( Mandatory )</code> + +* <code>gora.datastore.jcache.provider</code> - Two possible values, whether to start JCache dataStore in Server mode or Client mode, + 1. Server Mode + <b>com.hazelcast.cache.impl.HazelcastServerCachingProvider</b> + 2. Client Mode + <b>com.hazelcast.client.cache.impl.HazelcastClientCachingProvider</b> <code>( Mandatory )</code> + +* <code>gora.datastore.jcache.hazelcast.config</code> - If JCache datastore is started in, + 1. Server Mode + This property to should point s to Hazelcast Cluster member network configuration file related to + forming Hazelcast cluster using members. Please see <a href="http://docs.hazelcast.org/docs/3.5/manual/html/networkconfiguration.html">Network configuration</a>. + 2. Client Mode + This property to should point s to Hazelcast client configuration file related to connecting related to already formed Hazelcast cluster. + Please see <a href="http://docs.hazelcast.org/docs/3.5/manual/html/javaclientconfiguration.html#java-client-configuration">Client configuration</a> <code>( Mandatory )</code> + +* <code>jcache.auto.create.cache</code> - Whether force creating the cache at time JCache dataStore creation. Default is set to <b>false</b>. + +* <code>jcache.cache.inmemory.format</code> - In memory for format for persistent bean resides in cache. Possible values, + <b>BINARY, OBJECT, NATIVE</b> Please see <a href="http://docs.hazelcast.org/docs/3.5/manual/html/map-inmemoryformat.html">In memory format/a>. + +* <code>jcache.read.through.enable</code> - Whether to fetch a missing cache entry from backend persistent dataStore. Default value is <b>true</b>. + +* <code>jcache.write.through.enable</code> - Whether to push change of a cache entry to backend persistent dataStore. Default value is <b>true</b>. + +* <code>jcache.statistics.enable</code> - Statistics like cache hits and misses are collected. Default value is <b>false</b>. + +* <code>jcache.management.enable</code> - JMX beans are enabled and collected statistics are exposed over the beans.It doesn't automatically enables statistics collection. +Default is set to false. Default JMX port opens on <b>9999</b>. + +* <code>jcache.store.by.value.enable</code> - Whether to store key and values of data beans in means of store by value or store by reference. Default is <b>true</b> that means store by <b>value</b>. + +* <code>jcache.cache.namespace</code> - Cache manager scope URI. This will allow different cache manager instances to share data among them if they are aligned with same scope. + On opposite having two different scopes means such that each cache manager can isolate each otherâs owned caches without any conflict. + Please see <a href="http://docs.hazelcast.org/docs/3.5/manual/html/jcache-icache.html">Scopes and Namespaces</a> + +* <code>jcache.expire.policy</code> - Cache entry expiry policy. Possible values <b> ACCESSED, CREATED, MODIFIED, TOUCHED </b> + Please see <a href="http://docs.hazelcast.org/docs/3.5/manual/html/jcache-expirepolicy.html">JCache expiry policy</a> + +* <code>jcache.expire.policy.duration</code> - Cache entry expiry timeout in seconds. + +* <code>jcache.eviction.policy</code> - Cache entry eviction policy. Possible values <b> LRU, LFU, NONE, RANDOM </b> + Please see <a href="http://docs.hazelcast.org/docs/3.5/manual/html/jcache-eviction.html">Hazelcast eviction policy</a> + +* <code>jcache.eviction.max.size.policy</code> - Measure of maximum cache size to apply eviction policy. + <b> ENTRY_COUNT, USED_NATIVE_MEMORY_SIZE, USED_NATIVE_MEMORY_PERCENTAGE, FREE_NATIVE_MEMORY_SIZE, FREE_NATIVE_MEMORY_PERCENTAGE </b> + +* <code>jcache.eviction.size</code> - Maximum size as integer as a measure of max size policy criteria. +Title: Gora JCache Module + +##Overview +This is the main documentation for the gora-jcache module. gora-jcache +module enables [Hazelcast JCache](https://hazelcast.com/use-cases/caching/jcache-provider) caching support for Gora. +This implementation is based on Hazelcast JCache provider. This dataStore can act as wrapped caching layer for any other +persistent Apache Gora persistent dataStore. + +[TOC] + +##gora.properties + +* <code>gora.cache.datastore.default</code> - Caching dataStore to be used with persistent dataStore. If JCache dataStore is used as caching store +assigned value should be <b>org.apache.gora.jcache.store.JCacheStore</b> <code>( Mandatory )</code> + +* <code>gora.datastore.default</code> - Persistent back-end dataStore to be used with JCache caching dataStore. <code>( Mandatory )</code> + +* <code>gora.datastore.jcache.provider</code> - Two possible values, whether to start JCache dataStore in Server mode or Client mode, + 1. Server Mode + <b>com.hazelcast.cache.impl.HazelcastServerCachingProvider</b> + 2. Client Mode + <b>com.hazelcast.client.cache.impl.HazelcastClientCachingProvider</b> <code>( Mandatory )</code> + +* <code>gora.datastore.jcache.hazelcast.config</code> - If JCache datastore is started in, + 1. Server Mode + This property to should point s to Hazelcast Cluster member network configuration file related to + forming Hazelcast cluster using members. Please see <a href="http://docs.hazelcast.org/docs/3.5/manual/html/networkconfiguration.html">Network configuration</a>. + 2. Client Mode + This property to should point s to Hazelcast client configuration file related to connecting related to already formed Hazelcast cluster. + Please see <a href="http://docs.hazelcast.org/docs/3.5/manual/html/javaclientconfiguration.html#java-client-configuration">Client configuration</a> <code>( Mandatory )</code> + +* <code>jcache.auto.create.cache</code> - Whether force creating the cache at time JCache dataStore creation. Default is set to <b>false</b>. + +* <code>jcache.cache.inmemory.format</code> - In memory for format for persistent bean resides in cache. Possible values, + <b>BINARY, OBJECT, NATIVE</b> Please see <a href="http://docs.hazelcast.org/docs/3.5/manual/html/map-inmemoryformat.html">In memory format/a>. + +* <code>jcache.read.through.enable</code> - Whether to fetch a missing cache entry from backend persistent dataStore. Default value is <b>true</b>. + +* <code>jcache.write.through.enable</code> - Whether to push change of a cache entry to backend persistent dataStore. Default value is <b>true</b>. + +* <code>jcache.statistics.enable</code> - Statistics like cache hits and misses are collected. Default value is <b>false</b>. + +* <code>jcache.management.enable</code> - JMX beans are enabled and collected statistics are exposed over the beans.It doesn't automatically enables statistics collection. +Default is set to false. Default JMX port opens on <b>9999</b>. + +* <code>jcache.store.by.value.enable</code> - Whether to store key and values of data beans in means of store by value or store by reference. Default is <b>true</b> that means store by <b>value</b>. + +* <code>jcache.cache.namespace</code> - Cache manager scope URI. This will allow different cache manager instances to share data among them if they are aligned with same scope. + On opposite having two different scopes means such that each cache manager can isolate each otherâs owned caches without any conflict. + Please see <a href="http://docs.hazelcast.org/docs/3.5/manual/html/jcache-icache.html">Scopes and Namespaces</a> + +* <code>jcache.expire.policy</code> - Cache entry expiry policy. Possible values <b> ACCESSED, CREATED, MODIFIED, TOUCHED </b> + Please see <a href="http://docs.hazelcast.org/docs/3.5/manual/html/jcache-expirepolicy.html">JCache expiry policy</a> + +* <code>jcache.expire.policy.duration</code> - Cache entry expiry timeout in seconds. + +* <code>jcache.eviction.policy</code> - Cache entry eviction policy. Possible values <b> LRU, LFU, NONE, RANDOM </b> + Please see <a href="http://docs.hazelcast.org/docs/3.5/manual/html/jcache-eviction.html">Hazelcast eviction policy</a> + +* <code>jcache.eviction.max.size.policy</code> - Measure of maximum cache size to apply eviction policy. + <b> ENTRY_COUNT, USED_NATIVE_MEMORY_SIZE, USED_NATIVE_MEMORY_PERCENTAGE, FREE_NATIVE_MEMORY_SIZE, FREE_NATIVE_MEMORY_PERCENTAGE </b> + +* <code>jcache.eviction.size</code> - Maximum size as integer as a measure of max size policy criteria. Modified: gora/site/trunk/content/current/index.md URL: http://svn.apache.org/viewvc/gora/site/trunk/content/current/index.md?rev=1757612&r1=1757611&r2=1757612&view=diff ============================================================================== --- gora/site/trunk/content/current/index.md (original) +++ gora/site/trunk/content/current/index.md Thu Aug 25 07:04:00 2016 @@ -37,6 +37,7 @@ following modules are currently implemen * [gora-cassandra](./gora-cassandra.html): Module for [Apache Cassandra](http://cassandra.apacheorg) backend and CassandraStore implementation; * [gora-dynamodb](./gora-dynamodb.html): Module for [Amazon DynamoDB](http://aws.amazon.com/dynamodb/) backend and DynamoDBStore implementation; * [gora-hbase](./gora-hbase.html): Module for [Apache HBase](http://hbase.apache.org) backend and HBaseStore implementation; +* [gora-jcache](./gora-jcache.html): Module for [Hazelcast JCache](https://hazelcast.com/use-cases/caching/jcache-provider) caching and JCacheStore implementation; * [gora-couchdb](./gora-couchdb.html): Module for [Apache CouchDB](http://couchdb.apache.org) backend and CouchDBStore implementation; * [gora-metamodel](./gora-metamodel.html): Module for [Apache MetaModel](http://metamodel.incubator.apache.org) backend and query functionality; * [gora-mongodb](./gora-mongodb.html): Module for [MongoDB](http://www.mongodb.org/) backend and MongoStore implementation; Modified: gora/site/trunk/content/current/tutorial.md URL: http://svn.apache.org/viewvc/gora/site/trunk/content/current/tutorial.md?rev=1757612&r1=1757611&r2=1757612&view=diff ============================================================================== --- gora/site/trunk/content/current/tutorial.md (original) +++ gora/site/trunk/content/current/tutorial.md Thu Aug 25 07:04:00 2016 @@ -1098,6 +1098,27 @@ When you want to persist result into out Thatâs all! You can check Solr to verify the result. +##JCache caching dataStore + +This tutorial is about exposing Apache Gora persistent dataStore over Apache Gora default caching dataStore JCache. This sample exhibits how caching can reduce read latency +for consecutive reads when data beans are retrieved from intermediate cache as opposite to directly through the backend for consecutive iteration. + +Start HBase. + + /hbase-0.98.19-hadoop2/bin$ ./start-hbase.sh + +Start DistributedLogManager. ( Expose HBase dataStore over JCache dataStore ) + + /gora/bin$ ./gora distributedlogmanager + +Persist Log Databeans to HBase either via the path <b> JCache DataStore -> HBase DataStore -> HBase </b> either via direct path <b> HBase DataStore -> HBase </b> + + -parse persistent|cache <-input_log_file-> - + +Benchmark dataBean read latency for two paths, path via <b> JCache DataStore <- HBase DataStore <- HBase </b> and path via <b> HBase DataStore <- HBase </b> + + -benchmark <-startLineNum-> <-endLineNum-> <-iterations-> + ##More Examples Other than this tutorial, there are several places that you can find examples of Gora in action.