Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
145 lines (124 sloc) 6.59 KB
<?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 configuration with all defaults and enabled p2p deployment and enabled events.
-->
<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">
<!-- Enabling the peer-class loading feature. -->
<property name="peerClassLoadingEnabled" value="true"/>
<!--
Labeling Data Nodes with special attribute. This attribute is checked by common.filters.DataNodeFilters
which decides where caches have to be deployed.
-->
<property name="userAttributes">
<map key-type="java.lang.String" value-type="java.lang.Boolean">
<entry key="data.node" value="true"/>
</map>
</property>
<!-- Configuring caches that will be deployed on Data Nodes -->
<property name="cacheConfiguration">
<list>
<!-- Cache for Vehicles' records -->
<bean class="org.apache.ignite.configuration.CacheConfiguration">
<property name="name" value="vehicles"/>
<!--
Enabling a special nodes filter for the cache. The filter will make sure that the cache
will be deployed only on Data Nodes, the nodes that have 'data.node' attribute in the local
node map.
-->
<property name="nodeFilter">
<bean class="common.filters.DataNodeFilter"/>
</property>
</bean>
<!-- Cache for Maintenance records -->
<bean class="org.apache.ignite.configuration.CacheConfiguration">
<property name="name" value="maintenance"/>
<!--
Enabling a special nodes filter for the cache. The filter will make sure that the cache
will be deployed only on Data Nodes, the nodes that have 'data.node' attribute in the local
node map.
-->
<property name="nodeFilter">
<bean class="common.filters.DataNodeFilter"/>
</property>
<!-- Enabling our sample cache store for the Maintenance cache -->
<property name="cacheStoreFactory">
<bean class="javax.cache.configuration.FactoryBuilder" factory-method="factoryOf">
<constructor-arg value="common.cachestore.SimpleCacheStore"/>
</bean>
</property>
<!--
Avoid Maintenance objects deserialization on data nodes side when they are passed to
SampleCacheStore.
-->
<property name="storeKeepBinary" value="true"/>
<!-- Enabling the write-through feature for the store. -->
<property name="writeThrough" value="true"/>
<!-- Enabling the read-through feature for the store. -->
<property name="readThrough" value="true"/>
<!-- Configuring SQL schema. -->
<property name="queryEntities">
<list>
<bean class="org.apache.ignite.cache.QueryEntity">
<!-- Setting indexed type's key class -->
<property name="keyType" value="java.lang.Integer"/>
<!-- Setting indexed type's value class -->
<property name="valueType"
value="services.maintenance.common.Maintenance"/>
<!-- Defining fields that will be either indexed or queryable.
Indexed fields are added to 'indexes' list below.-->
<property name="fields">
<map>
<entry key="vehicleId" value="java.lang.Integer"/>
</map>
</property>
<!-- Defining indexed fields.-->
<property name="indexes">
<list>
<!-- Single field (aka. column) index -->
<bean class="org.apache.ignite.cache.QueryIndex">
<constructor-arg value="vehicleId"/>
</bean>
</list>
</property>
</bean>
</list>
</property>
</bean>
</list>
</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>
<!-- In distributed environment, replace with actual host IP address. -->
<value>127.0.0.1:47500..47509</value>
</list>
</property>
</bean>
</property>
</bean>
</property>
</bean>
</beans>
You can’t perform that action at this time.