<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	   xmlns:context="http://www.springframework.org/schema/context"
	   xmlns:gfe="http://www.springframework.org/schema/geode"
	   xmlns:util="http://www.springframework.org/schema/util"
	   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	   xsi:schemaLocation="
		http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd
		http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd
		http://www.springframework.org/schema/geode https://www.springframework.org/schema/geode/spring-geode.xsd
		http://www.springframework.org/schema/util https://www.springframework.org/schema/util/spring-util.xsd
">

	<util:properties id="gemfireProperties">
		<prop key="name">DiskStoreNamespaceTest</prop>
		<prop key="log-level">error</prop>
	</util:properties>

    <gfe:cache properties-ref="gemfireProperties"/>

    <util:properties id="props">
        <prop key="allowForceCompaction">true</prop>
        <prop key="autoCompact">true</prop>
        <prop key="compactionThreshold">70</prop>
        <prop key="diskUsageCriticalPercentage">90</prop>
        <prop key="diskUsageWarningPercentage">75</prop>
        <prop key="location">./tmp</prop>
        <prop key="maxOplogSize">1</prop>
        <prop key="maxSize">10</prop>
        <prop key="queueSize">50</prop>
        <prop key="timeInterval">9999</prop>
        <prop key="writeBufferSize">4096</prop>
        <prop key="ttl">300</prop>
    </util:properties>

    <context:property-placeholder properties-ref="props"/>

	<gfe:disk-store id="fullyConfiguredDiskStore"
					allow-force-compaction="${allowForceCompaction}"
					auto-compact="${autoCompact}"
					compaction-threshold="${compactionThreshold}"
					disk-usage-critical-percentage="${diskUsageCriticalPercentage}"
					disk-usage-warning-percentage="${diskUsageWarningPercentage}"
					max-oplog-size="${maxOplogSize}"
					queue-size="${queueSize}"
					time-interval="${timeInterval}"
					write-buffer-size="${writeBufferSize}">
		<gfe:disk-dir location="${location}" max-size="${maxSize}"/>
	</gfe:disk-store>

	<gfe:disk-store id="diskStore1" auto-compact="${autoCompact}" max-oplog-size="${maxOplogSize}"
					queue-size="${queueSize}" time-interval="${timeInterval}">
        <gfe:disk-dir location="${location}" max-size="${maxSize}"/>
    </gfe:disk-store>

	<gfe:disk-store id="ds2" auto-compact="true" max-oplog-size="1" queue-size="50" time-interval="9999">
		<gfe:disk-dir location="./" max-size="10"/>
	</gfe:disk-store>

	<gfe:partitioned-region id="partition-data" persistent="true" disk-store-ref="ds2">
		<gfe:eviction type="MEMORY_SIZE" threshold="10" action="LOCAL_DESTROY">
			<gfe:object-sizer>
				<bean class="org.springframework.data.gemfire.SimpleObjectSizer"/>
			</gfe:object-sizer>
		</gfe:eviction>
	</gfe:partitioned-region>

	<gfe:partitioned-region id="partitioned-data-with-timeout" persistent="true" disk-store-ref="diskStore1">
        <gfe:entry-ttl timeout="${ttl}" action="DESTROY"/>
    </gfe:partitioned-region>

	<gfe:replicated-region id="replicated-data" persistent="false" disk-store-ref="diskStore1" close="true" destroy="false">
		<gfe:region-ttl timeout="${ttl}" action="DESTROY"/>
		<gfe:region-tti timeout="400" action="INVALIDATE"/>
		<gfe:entry-ttl timeout="100" action="DESTROY"/>
		<gfe:entry-tti timeout="200" action="INVALIDATE"/>
		<gfe:eviction type="ENTRY_COUNT" threshold="50" action="OVERFLOW_TO_DISK"/>
	</gfe:replicated-region>

	<gfe:replicated-region id="replicated-data-custom-expiry" close="true" destroy="false">
		<gfe:custom-entry-ttl ref="customExpiry"/>
		<gfe:custom-entry-tti>
			<bean class="org.springframework.data.gemfire.config.xml.DiskStoreAndEvictionRegionParsingTest.TestCustomExpiry"/>
		</gfe:custom-entry-tti>
	</gfe:replicated-region>

    <bean id="customExpiry" class="org.springframework.data.gemfire.config.xml.DiskStoreAndEvictionRegionParsingTest.TestCustomExpiry"/>

</beans>
