From 127b7bec630ba2e6afa25aed7f56934ea52c186f Mon Sep 17 00:00:00 2001 From: "Kevin W. Sutter" Date: Tue, 23 Feb 2010 14:15:11 +0000 Subject: [PATCH] OPENJPA-1510. Corrected placement of the Distributed Cache description, along with a few incorrect spellings and punctuation. git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@915353 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/doc/manual/ref_guide_caching.xml | 85 +++++++++---------- 1 file changed, 42 insertions(+), 43 deletions(-) diff --git a/openjpa-project/src/doc/manual/ref_guide_caching.xml b/openjpa-project/src/doc/manual/ref_guide_caching.xml index 740f6038d..be0f33150 100644 --- a/openjpa-project/src/doc/manual/ref_guide_caching.xml +++ b/openjpa-project/src/doc/manual/ref_guide_caching.xml @@ -150,49 +150,6 @@ openjpa.RemoteCommitProvider property to sjvm <property name="openjpa.RemoteCommitProvider" value="sjvm"/> - -
- "Distributing instanes across cache partitions" - - -OpenJPA also supports a partitioned cache configuration where the cached -instances can be distributed across partitions by a application-defined -policy. Each partition behaves as a data cache by itself, identified by its name and can -configured individually. The distribution policy -determines the specific partition that stores the state of a managed instance. -The default distribution policy distributes the instances by their type -as specified by the name attribute in @DataCache -annotation. Cache distribution policy is a simple interface that can be implemented -by an application to distribute among the partitions per instance basis. -To enable a partitioned cache set the openjpa.DataCache -property to partitioned, and configure individual partitions -as follows: - - - - Partitioned Data Cache - - -<property name="openjpa.CacheDistributionPolicy" value="org.acme.foo.DistributionPolicy"/> -<property name="openjpa.DataCache" value="partitioned(PartitionType=concurrent,partitions= - '(name=a,cacheSize=100),(name=b,cacheSize=200)')"/> - - -
- -The distribution policy is configured by a full-qualified class name that implements -org.apache.openjpa.datacahe.CacheDistributionPolicy. The partitions -are specified as value of partitions attribute as a series of -individually configurable plug-in strings. As the example shows, i) each partition plug-in configuration -must be enclosed in parentheses, ii) must be separated by comma and iii) the complete -set be enclosed in single quote. Each individual partition is a Data Cache by itself and -class that implements the partition can be configured via PartitionType -attribute. The above example configuration will configure a partitioned cache with -two partitions named a and b of cache size 100 and 200 -respectively. The partitions are of concurrent type which is a mnemonic or alias -for org.apache.openjpa.datacache.ConcurrentDataCache. The PartitionType -is defaulted to concurrent though explicitly mentioned in this example. - To configure the data cache to remain up-to-date in a distributed environment, set the @@ -360,6 +317,48 @@ past 3 PM on Sunday. true(EvictionSchedule='15,45 15 * * 1') +
+ Distributing instances across cache partitions + + +OpenJPA also supports a partitioned cache configuration where the cached +instances can be distributed across partitions by an application-defined +policy. Each partition behaves as a data cache by itself, identified by its name and can +be configured individually. The distribution policy +determines the specific partition that stores the state of a managed instance. +The default distribution policy distributes the instances by their type +as specified by the name attribute in @DataCache +annotation. Cache distribution policy is a simple interface that can be implemented +by an application to distribute among the partitions on a per instance basis. +To enable a partitioned cache set the openjpa.DataCache +property to partitioned, and configure individual partitions +as follows: + + + + Partitioned Data Cache + + +<property name="openjpa.CacheDistributionPolicy" value="org.acme.foo.DistributionPolicy"/> +<property name="openjpa.DataCache" value="partitioned(PartitionType=concurrent,partitions= + '(name=a,cacheSize=100),(name=b,cacheSize=200)')"/> + + +
+ +The distribution policy is configured by a full-qualified class name that implements +org.apache.openjpa.datacahe.CacheDistributionPolicy. The partitions +are specified as value of the partitions attribute as a series of +individually configurable plug-in strings. As the example shows, i) each partition plug-in configuration +must be enclosed in parentheses, ii) must be separated by comma and iii) the complete +set be enclosed in single quote. Each individual partition is a Data Cache by itself and +the class that implements the partition can be configured via PartitionType +attribute. The above example configuration will configure a partitioned cache with +two partitions named a and b of cache size 100 and 200, +respectively. The partitions are of concurrent type which is a mnemonic or alias +for org.apache.openjpa.datacache.ConcurrentDataCache. The PartitionType +is defaulted to concurrent though explicitly mentioned in this example. +