<?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="gridLogger">
            <bean class="org.apache.ignite.logger.log4j2.Log4J2Logger">
                <constructor-arg type="java.lang.String" value="log4j2.xml"/>
            </bean>
        </property>

        <property name="communicationSpi">
            <bean class="org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi">
              <!-- Override local port. -->
              <property name="localPort" value="47400"/>
            </bean>
        </property>

        <!-- Configure internal thread pool. 64-->
        <property name="publicThreadPoolSize" value="16"/>

        <!-- Configure system thread pool. 32-->
        <property name="systemThreadPoolSize" value="8"/>

        <property name="systemWorkerBlockedTimeout" value="#{5 * 60 * 1000}"/>

        <property name="failureHandler">
            <bean class="org.apache.ignite.failure.StopNodeFailureHandler">

                <!-- uncomment to enable this handler to 
                process critical workers' hung-ups -->
                <property name="ignoredFailureTypes">
                    <list>
                    </list>
                </property>

            </bean>
        </property>
        <!-- Set to true to enable distributed class loading for examples, default is false. -->
        <property name="peerClassLoadingEnabled" value="false"/>

        <property name="dataStorageConfiguration">
            <bean class="org.apache.ignite.configuration.DataStorageConfiguration">

                <!--
                     Sets a path to the root directory where data and indexes are
                     to be persisted. It's assumed the directory is on a separated SSD.
                -->
                <property name="storagePath" value="persistence"/>

                <!--
                     Sets a path to the directory where WAL is stored.
                     It's assumed the directory is on a separated HDD.
                -->
                <property name="walPath" value="wal"/>

                <!--
                    Sets a path to the directory where WAL archive is stored.
                    The directory is on the same HDD as the WAL.
                -->
                <property name="walArchivePath" value="wal/archive"/>

                <!-- Changing WAL Mode. --> 
                <property name="walMode" value="NONE"/>

                <!-- Set the page size to 4 KB, default -->
                <!-- limit 1 KB - 16 KB -->
                <property name="pageSize" value="#{4 * 1024}"/>

                <!-- Enable write throttling. -->
                <property name="writeThrottlingEnabled" value="false"/>

                <property name="checkpointFrequency" value="500"/>
                <property name="lockWaitTime" value="2000"/>
                <property name="checkpointThreads" value="1"/>
                <property name="checkpointWriteOrder" value="RANDOM"/>

                <!--
                    Default memory region that grows endlessly. A cache is bound to this memory region
                    unless it sets another one in its CacheConfiguration.
                -->
                <property name="defaultDataRegionConfiguration">
                    <bean class="org.apache.ignite.configuration.DataRegionConfiguration">
                        <!--property name="name" value="Default_Region"/-->
                        <property name="name" value="default"/>
                        <!-- 100 MB memory region with disabled eviction -->
                        <property name="initialSize" value="#{100L * 1024 * 1024}"/>
                        <!-- maxSize 20 MB is too little -->
                        <!-- sum of all maxSize values has to be less than total memory of the system -->
                        <!-- limits size in memory, not on disk -->
                        <!-- default value 1.2GB -->
                        <property name="maxSize"     value="#{2L * 1024 * 1024 * 1024}"/>
                        <property name="persistenceEnabled" value="true"/>
                        <!-- Increasing the buffer size to 1 GB. -->
                        <property name="checkpointPageBufferSize" value="#{1L * 1024 * 1024 * 1024}"/>
                    </bean>
                </property>

                <!-- Defining several data regions for different memory regions -->
                <property name="dataRegionConfigurations">
                    <list>
                    </list>
                </property>
            </bean>
        </property>

        <property name="cacheConfiguration">
            <list>
                <!--bean class="org.apache.ignite.configuration.CacheConfiguration">
                    <property name="dataRegionName" value="default"/>
                    <property name="name" value=".ShardDetectorStorage"/>
                    <property name="onheapCacheEnabled" value="true"/>
                </bean>
                <bean class="org.apache.ignite.configuration.CacheConfiguration">
                    <property name="dataRegionName" value="default"/>
                    <property name="name" value=".ChildrenStore"/>
                    <property name="onheapCacheEnabled" value="true"/>
                </bean>
                <bean class="org.apache.ignite.configuration.CacheConfiguration">
                    <property name="dataRegionName" value="default"/>
                    <property name="name" value=".ChildrenStore.listsize"/>
                    <property name="onheapCacheEnabled" value="true"/>
                </bean>
                <bean class="org.apache.ignite.configuration.CacheConfiguration">
                    <property name="dataRegionName" value="default"/>
                    <property name="name" value=".RootStorage"/>
                    <property name="onheapCacheEnabled" value="true"/>
                </bean>
                <bean class="org.apache.ignite.configuration.CacheConfiguration">
                    <property name="dataRegionName" value="default"/>
                    <property name="name" value=".QualifierStorage"/>
                    <property name="onheapCacheEnabled" value="true"/>
                </bean-->
            </list>
        </property>
    </bean>

</beans>
