| <?xml version="1.0" encoding="UTF-8"?> |
| |
| <!-- |
| Licensed to the Apache Software Foundation (ASF) under one or more |
| contributor license agreements. See the NOTICE file distributed with |
| this work for additional information regarding copyright ownership. |
| The ASF licenses this file to You under the Apache License, Version 2.0 |
| (the "License"); you may not use this file except in compliance with |
| the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
| --> |
| |
| <!-- |
| Ignite Spring configuration file to startup grid cache. |
| |
| When starting a standalone Ignite node, you need to execute the following command: |
| {IGNITE_HOME}/bin/ignite.{bat|sh} path-to-this-file/example-cache.xml |
| |
| When starting Ignite from Java IDE, pass path to this file into Ignition: |
| Ignition.start("path-to-this-file/example-benchmark.xml"); |
| --> |
| <beans xmlns="http://www.springframework.org/schema/beans" |
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| xmlns:util="http://www.springframework.org/schema/util" |
| xsi:schemaLocation=" |
| http://www.springframework.org/schema/beans |
| http://www.springframework.org/schema/beans/spring-beans.xsd |
| http://www.springframework.org/schema/util |
| http://www.springframework.org/schema/util/spring-util.xsd"> |
| |
| <!-- |
| Optional description. |
| --> |
| <description> |
| Spring file for grid configuration with client available endpoints. |
| </description> |
| |
| <!-- |
| Initialize property configurer so we can reference environment variables. |
| --> |
| <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> |
| <property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_FALLBACK"/> |
| <property name="searchSystemEnvironment" value="true"/> |
| </bean> |
| |
| <!-- |
| Configuration below demonstrates how to setup a collision and failover SPI's |
| to enable work stealing from overloaded nodes to underloaded nodes. |
| |
| Note that for job stealing to work, you must always use both, |
| GridJobStealingCollisionSpi and GridJobStealingFailoverSPI. |
| --> |
| <bean id="grid.cfg" class="org.apache.ignite.configuration.IgniteConfiguration"> |
| <property name="igniteInstanceName" value="node"/> |
| |
| <!-- Set to local host address. --> |
| <property name="localHost" value="127.0.0.1"/> |
| |
| <!-- Configure to skip all events for better performance. --> |
| <property name="includeEventTypes"> |
| <list> |
| <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_FAILED"/> |
| <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_FINISHED"/> |
| <util:constant static-field="org.apache.ignite.events.EventType.EVT_JOB_MAPPED"/> |
| </list> |
| </property> |
| |
| <!-- Client configuration. --> |
| <property name="connectorConfiguration"> |
| <bean class="org.apache.ignite.configuration.ConnectorConfiguration"> |
| <!-- Configure TCP rest protocol. --> |
| <property name="port" value="10080"/> |
| </bean> |
| </property> |
| |
| <property name="cacheConfiguration"> |
| <!-- |
| Specify list of cache configurations here. Any property from |
| CacheConfiguration interface can be configured here. |
| --> |
| <list> |
| <!-- |
| Local cache example configuration. |
| --> |
| <bean class="org.apache.ignite.configuration.CacheConfiguration"> |
| <!-- Cache name is null. --> |
| <!--<property name="name"><null/></property>--> |
| |
| <!-- LOCAL cache mode. --> |
| <property name="cacheMode" value="LOCAL"/> |
| </bean> |
| |
| <!-- |
| Partitioned cache example configuration. |
| --> |
| <bean class="org.apache.ignite.configuration.CacheConfiguration"> |
| <!-- Cache name is 'partitioned'. --> |
| <property name="name" value="partitioned"/> |
| |
| <!-- PARTITIONED cache mode. --> |
| <property name="cacheMode" value="PARTITIONED"/> |
| |
| <!-- Transactional updates supported. --> |
| <property name="atomicityMode" value="TRANSACTIONAL"/> |
| |
| <!-- Enable near cache to cache recently accessed data. --> |
| <property name="nearConfiguration"> |
| <bean class="org.apache.ignite.configuration.NearCacheConfiguration" /> |
| </property> |
| |
| <property name="writeSynchronizationMode" value="FULL_SYNC"/> |
| |
| <property name="affinity"> |
| <bean class="org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction"> |
| <constructor-arg value="1"/> |
| </bean> |
| </property> |
| |
| <!--<property name="binaryEnabled" value="true"/>--> |
| |
| <property name="queryEntities"> |
| <list> |
| <bean class="org.apache.ignite.cache.QueryEntity"> |
| <property name="valueType" value="GridBinaryPerson"/> |
| <property name="fields"> |
| <map> |
| <entry key="name" value="java.lang.String"/> |
| <entry key="address" value="java.lang.String"/> |
| <entry key="age" value="java.lang.Integer"/> |
| </map> |
| </property> |
| <property name="indexes"> |
| <list> |
| <bean class="org.apache.ignite.cache.QueryIndex"> |
| <property name="fields"> |
| <map> |
| <entry key="age" value="true"/> |
| </map> |
| </property> |
| </bean> |
| <bean class="org.apache.ignite.cache.QueryIndex"> |
| <property name="indexType" value="FULLTEXT"/> |
| <property name="fields"> |
| <map> |
| <entry key="address" value="false"/> |
| </map> |
| </property> |
| </bean> |
| </list> |
| </property> |
| </bean> |
| <bean class="org.apache.ignite.cache.QueryEntity"> |
| <property name="valueType" value="GridImplicitBinaryPerson"/> |
| <property name="fields"> |
| <map> |
| <entry key="name" value="java.lang.String"/> |
| <entry key="age" value="java.lang.Integer"/> |
| </map> |
| </property> |
| <property name="indexes"> |
| <list> |
| <bean class="org.apache.ignite.cache.QueryIndex"> |
| <property name="fields"> |
| <map> |
| <entry key="age" value="true"/> |
| </map> |
| </property> |
| </bean> |
| </list> |
| </property> |
| </bean> |
| <bean class="org.apache.ignite.cache.QueryEntity"> |
| <property name="valueType" value="GridNoDefBinaryPerson"/> |
| <property name="fields"> |
| <map> |
| <entry key="name" value="java.lang.String"/> |
| <entry key="age" value="java.lang.Integer"/> |
| </map> |
| </property> |
| <property name="indexes"> |
| <list> |
| <bean class="org.apache.ignite.cache.QueryIndex"> |
| <property name="fields"> |
| <map> |
| <entry key="age" value="true"/> |
| </map> |
| </property> |
| </bean> |
| </list> |
| </property> |
| </bean> |
| </list> |
| </property> |
| </bean> |
| |
| <!-- |
| Local cache with store. |
| --> |
| <bean class="org.apache.ignite.configuration.CacheConfiguration"> |
| <property name="name" value="local.store"/> |
| |
| <property name="cacheMode" value="LOCAL"/> |
| |
| <property name="writeSynchronizationMode" value="FULL_SYNC"/> |
| |
| <property name="store"> |
| <bean class="org.apache.ignite.internal.client.HashMapStore"/> |
| </property> |
| </bean> |
| |
| <!-- |
| Replicated cache example configuration. |
| --> |
| <bean class="org.apache.ignite.configuration.CacheConfiguration"> |
| <!-- Cache name is 'replicated'. --> |
| <property name="name" value="replicated"/> |
| |
| <property name="writeSynchronizationMode" value="FULL_SYNC"/> |
| |
| <!-- REPLICATED cache mode. --> |
| <property name="cacheMode" value="REPLICATED"/> |
| |
| <property name="atomicityMode" value="TRANSACTIONAL"/> |
| </bean> |
| |
| <!-- |
| Replicated cache with in-memory store enabled. |
| --> |
| <bean class="org.apache.ignite.configuration.CacheConfiguration"> |
| <!-- Cache name is 'replicated.store'. --> |
| <property name="name" value="replicated.store"/> |
| |
| <property name="writeSynchronizationMode" value="FULL_SYNC"/> |
| |
| <property name="atomicityMode" value="TRANSACTIONAL"/> |
| |
| <!-- REPLICATED cache mode. --> |
| <property name="cacheMode" value="REPLICATED"/> |
| |
| <!-- Store.--> |
| <property name="store"> |
| <bean class="org.apache.ignite.internal.client.HashMapStore"/> |
| </property> |
| </bean> |
| </list> |
| </property> |
| |
| |
| <!-- |
| TCP discovery SPI (uses VM-shared IP-finder). |
| --> |
| <property name="discoverySpi"> |
| <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi"> |
| <!-- Make sure both servers (unsecured and SSL-protected) can start as independent grids. --> |
| <property name="localPort" value="49500"/> |
| |
| <!-- Override default IP-finder.--> |
| <property name="ipFinder"> |
| <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder"> |
| <property name="addresses"> |
| <list> |
| <!-- |
| List all IP/port configurations that potentially |
| can be started first in examples. We are assuming |
| grid of size 10 or less. |
| --> |
| <value>127.0.0.1:49500</value> |
| <value>127.0.0.1:49501</value> |
| </list> |
| </property> |
| </bean> |
| </property> |
| </bean> |
| </property> |
| |
| <!-- |
| Logger to use. |
| --> |
| <property name="gridLogger"> |
| <bean class="org.apache.ignite.logger.log4j.Log4JLogger"> |
| <constructor-arg type="java.lang.String" value="modules/clients/src/test/resources/log4j.xml"/> |
| </bean> |
| </property> |
| |
| <!-- |
| Explicitly set custom public and system thread pools to increase |
| possible started nodes count in one VM. |
| --> |
| <property name="publicThreadPoolSize" value="15"/> |
| |
| <property name="systemThreadPoolSize" value="15"/> |
| </bean> |
| </beans> |