Permalink
Browse files

converted to use lookup tag

  • Loading branch information...
1 parent de64c28 commit f23695df49fb5537ce02e95efb394a80368b92a3 @d4v3r d4v3r committed May 4, 2012
@@ -7,52 +7,10 @@
http://www.springframework.org/schema/gemfire http://www.springframework.org/schema/gemfire/spring-gemfire.xsd">
<!-- GemFire cache bean -->
- <gfe:cache properties-ref="props" />
- <util:properties id="props" location="cache.properties" />
-
- <!-- creating disk store factory -->
- <bean id="dsFactory" factory-bean="gemfire-cache" factory-method="createDiskStoreFactory">
- <property name="maxOplogSize" value="1024" />
- <property name="autoCompact" value="true" />
- <property name="queueSize" value="10000" />
- <property name="timeInterval" value="15" />
- </bean>
-
- <!-- setting more disk store factory settings -->
- <bean id="dirs" factory-bean="dsFactory" factory-method="setDiskDirsAndSizes">
- <constructor-arg>
- <bean class="java.io.File">
- <constructor-arg value="overflowData1" />
- </bean>
- </constructor-arg>
- <constructor-arg value="4096"/>
- </bean>
-
- <!-- Creating Disk Store-->
- <bean id="ds1" factory-bean="dsFactory" factory-method="create"
- depends-on="dirs">
- <constructor-arg value="ds1" />
- </bean>
+ <gfe:cache properties-ref="props" cache-xml-location="xml/DataOverflow.xml"/>
- <util:constant id="objSizer"
- static-field="com.gemstone.gemfire.cache.util.ObjectSizer.DEFAULT" />
-
- <bean id="exampleRegion" class="org.springframework.data.gemfire.RegionFactoryBean"
- p:cache-ref="gemfire-cache">
- <property name="attributes">
- <bean class="org.springframework.data.gemfire.RegionAttributesFactoryBean">
- <property name="evictionAttributes">
- <bean class="com.gemstone.gemfire.cache.EvictionAttributes"
- factory-method="createLRUMemoryAttributes">
- <constructor-arg value="1" />
- <constructor-arg ref="objSizer" />
- <constructor-arg value="OVERFLOW_TO_DISK" />
- </bean>
- </property>
- <property name="diskStoreName" value="ds1" />
- <property name="diskSynchronous" value="false" />
- </bean>
- </property>
- </bean>
+ <util:properties id="props" location="cache.properties" />
+ <gfe:lookup-region id="exampleRegion" name="exampleRegion"/>
+
</beans>
@@ -0,0 +1,29 @@
+<?xml version="1.0"?>
+<!DOCTYPE cache PUBLIC
+ "-//GemStone Systems, Inc.//GemFire Declarative Caching 6.5//EN"
+ "http://www.gemstone.com/dtd/cache6_5.dtd">
+
+<!--
+ | DataOverflow.xml
+ |
+ | Configures a region to overflow to disk when the region reaches
+ | a certain capacity. The data files are written to the subdirectories
+ | specified in the disk-dirs elements.
+-->
+<cache>
+ <disk-store name="ds1" auto-compact="true" max-oplog-size="1024" queue-size="10000" time-interval="15">
+ <disk-dirs>
+ <disk-dir dir-size="4096">overflowData1</disk-dir>
+ </disk-dirs>
+ </disk-store>
+ <region name="exampleRegion">
+ <region-attributes disk-store-name="ds1" disk-synchronous="false">
+ <!-- Write buffer data to disk every 10Kb or 15 milliseconds,
+ whichever comes first -->
+
+ <eviction-attributes>
+ <lru-memory-size maximum="1" action="overflow-to-disk" />
+ </eviction-attributes>
+ </region-attributes>
+ </region>
+</cache>

0 comments on commit f23695d

Please sign in to comment.