<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="
        http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans.xsd">

    <bean class="org.apache.ignite.configuration.IgniteConfiguration">
        <property name="workDirectory" value="C:\Tools\apache_ignite\work_directory"/>        

        <property name="cacheConfiguration">
            <bean class="org.apache.ignite.configuration.CacheConfiguration">
                <property name="name" value="mlp"/>
                <property name="cacheMode" value="PARTITIONED"/>
                <property name="backups" value="0"/>
                <property name="rebalanceMode" value="ASYNC"/>
                <property name="writeSynchronizationMode" value="PRIMARY_SYNC"/>
                <property name="partitionLossPolicy" value="READ_ONLY_SAFE"/>
                <!-- Other parameters -->
            </bean>
        </property>

        <property name="dataStorageConfiguration">
            <bean class="org.apache.ignite.configuration.DataStorageConfiguration">
                <property name="defaultDataRegionConfiguration">
                    <bean class="org.apache.ignite.configuration.DataRegionConfiguration">
                        <property name="persistenceEnabled" value="true"/>
                    </bean>
                </property>
                <property name="storagePath" value="C:\Tools\apache_ignite\storage"/>
                <property name="walPath" value="C:\Tools\apache_ignite\wal" />
                <property name="walArchivePath" value="C:\Tools\apache_ignite\wal\archive" />
                

                <property name="dataRegionConfigurations">
                    <list>
                    <!--
                        Defining a data region that consumes up to 20 GB of RAM.
                    -->
                    <bean class="org.apache.ignite.configuration.DataRegionConfiguration">
                        <!-- Custom region name. -->
                        <property name="name" value="4GB_Region"/>

                        <!-- 500 MB initial size (RAM). -->
                        <property name="initialSize" value="#{500L * 1024 * 1024}"/>

                        <!-- 4 GB maximum size (RAM). -->
                        <property name="maxSize" value="#{4L * 1024 * 1024 * 1024}"/>

                        <!-- Enabling RANDOM_2_LRU eviction for this region.  -->
                        <property name="pageEvictionMode" value="RANDOM_2_LRU"/>
                        <property name="persistenceEnabled" value="true"/>
                    </bean>
                    </list>
                </property>
            </bean>
        </property>

        <property name="authenticationEnabled" value="true"/>
    </bean>
</beans>