<?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 id="ignite.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
        <property name="peerClassLoadingEnabled" value="true"/>
        <property name="consistentId" value="#{systemEnvironment['CONSISTENTID']}"/>
        <property name="workDirectory" value="/home/liyujue/ignite"/>
        <property name="sqlConfiguration">
            <bean class="org.apache.ignite.configuration.SqlConfiguration">
                <property name="queryEnginesConfiguration">
                    <list>
                        <bean class="org.apache.ignite.indexing.IndexingQueryEngineConfiguration">
                            <property name="default" value="true"/>
                        </bean>
                        <bean class="org.apache.ignite.calcite.CalciteQueryEngineConfiguration">
                            <property name="default" value="false"/>
                        </bean>
                    </list>
                </property>
            </bean>
        </property>
        <property name="gridLogger">
            <bean class="org.apache.ignite.logger.log4j2.Log4J2Logger">
              <constructor-arg type="java.lang.String" value="config/ignite-log4j2.xml"/>
            </bean>
        </property>
        <property name="cacheConfiguration">
            <list>
                <bean id="partitioned-cache-template" abstract="true" class="org.apache.ignite.configuration.CacheConfiguration">
                    <property name="name" value="cache-partitioned*"/>
                    <property name="cacheMode" value="PARTITIONED" />
                    <property name="statisticsEnabled" value="true"/>
                    <property name="queryParallelism" value="8"/>
                    <property name="groupName" value="group1"/>
                    <property name="partitionLossPolicy" value="READ_WRITE_SAFE"/>
                </bean>
                <bean id="replicated-cache-template" abstract="true" class="org.apache.ignite.configuration.CacheConfiguration">
                    <property name="name" value="cache-replicated*"/>
                    <property name="cacheMode" value="REPLICATED" />
                    <property name="statisticsEnabled" value="true"/>
                    <property name="partitionLossPolicy" value="READ_WRITE_SAFE"/>
                </bean>
            </list>
        </property>
        <!-- Enabling Apache Ignite Persistent Store. -->
        <property name="dataStorageConfiguration">
            <bean class="org.apache.ignite.configuration.DataStorageConfiguration">
                <property name="walSegments" value="20"/>
                <property name="metricsEnabled" value="true"/>
                <property name="defaultDataRegionConfiguration">
                    <bean class="org.apache.ignite.configuration.DataRegionConfiguration">
                        <property name="persistenceEnabled" value="false"/>
                        <property name="metricsEnabled" value="true"/>
                        <property name="initialSize" value="#{100 * 1024 * 1024}" />
                        <property name="maxSize" value="#{10L * 1024 * 1024 * 1024}"/>
                    </bean>
                </property>
            </bean>
        </property>
        <property name="discoverySpi">
            <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
                <property name="ipFinder">
                    <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">
                        <property name="addresses">
                            <list>
                                <value>localhost:47500..47509</value>
                            </list>
                        </property>
                    </bean>
                </property>
            </bean>
        </property>
    </bean>
</beans>
