Skip to content

Instantly share code, notes, and snippets.

Created August 17, 2016 22:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/8cbb027bb747c4a047f3dcadcd7ca314 to your computer and use it in GitHub Desktop.
Save anonymous/8cbb027bb747c4a047f3dcadcd7ca314 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="UTF-8"?>
<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">
<description>Bean definitions for Service Module</description>
<import resource="classpath:applicationContext-service-base.xml"/>
<bean id="hostname" factory-bean="localhost" factory-method="getHostName"/>
<bean id="localhost" class="java.net.InetAddress" factory-method="getLocalHost"/>
<bean id="roundRobinLoadBalancingSpi" class="org.apache.ignite.spi.loadbalancing.roundrobin.RoundRobinLoadBalancingSpi">
<property name="perTask" value="false"/>
</bean>
<bean id="cpuLoadBalancingSpi" class="org.apache.ignite.spi.loadbalancing.adaptive.AdaptiveLoadBalancingSpi">
<property name="loadProbe">
<bean class="org.apache.ignite.spi.loadbalancing.adaptive.AdaptiveCpuLoadProbe">
<property name="useAverage" value="${grid.loadbalancer.cpu.use_average:true}"/>
<property name="useProcessors" value="${grid.loadbalancer.cpu.use_processors:true}"/>
<property name="processorCoefficient" value="${grid.loadbalancer.cpu.coefficient:0.75}"/>
</bean>
</property>
</bean>
<bean id="jobCountLoadBalancingSpi" class="org.apache.ignite.spi.loadbalancing.adaptive.AdaptiveLoadBalancingSpi">
<property name="loadProbe">
<bean class="org.apache.ignite.spi.loadbalancing.adaptive.AdaptiveCpuLoadProbe">
<property name="useAverage" value="${grid.loadbalancer.jobcount.use_average:false}"/>
</bean>
</property>
</bean>
<!--TODO : do we still need these beans ?? -->
<!--<bean id="sharedFsMetricsStore" class="org.gridgain.grid.spi.discovery.tcp.metricsstore.sharedfs.GridTcpDiscoverySharedFsMetricsStore">-->
<!--<property name="path" value="${grid.metricsStorePath}"/>-->
<!--</bean>-->
<!--<bean id="jvmMetricsStore" class="org.gridgain.grid.spi.discovery.tcp.metricsstore.vm.GridTcpDiscoveryVmMetricsStore">-->
<!--</bean>-->
<bean id="nullMetricsStore" class="com.myco.enterprise.utility.NullFactoryBean"/>
<!-- Base configuration shared between grid definitions -->
<bean id="abstractGridConfiguration" abstract="true"
class="org.apache.ignite.configuration.IgniteConfiguration">
<property name="userAttributes">
<map>
<entry key="com.myco.identifier" value="${grid.identifier}"/>
<entry key="com.myco.workgroup" value="${grid.workgroup}"/>
<entry key="com.myco.maxjobs" value="${grid.maxjobs:95}"/>
<entry key="com.myco.hostname" value-ref="hostname"/>
<entry key="com.myco.version" value="#{versionData.getVersion()}"/>
</map>
</property>
<property name="peerClassLoadingEnabled" value="false"/>
<!-- TODO - do we need ?-->
<!--<property name="restEnabled" value="false"/>-->
<!--<property name="executorServiceShutdown" value="true"/>-->
<!--<property name="systemExecutorServiceShutdown" value="true"/>-->
<property name="discoverySpi">
<bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
<property name="ipFinder" ref="gridTcpDiscoveryJdbcIpFinder"/>
<property name="ackTimeout" value="${grid.ackTimeout}"/>
<property name="socketTimeout" value="${grid.socketTimeout}"/>
<property name="networkTimeout" value="${grid.networkTimeout}"/>
<property name="heartbeatFrequency" value="${grid.heartbeatFrequency}"/>
<property name="maxMissedHeartbeats" value="${grid.maxMissedHeartbeats}"/>
<property name="reconnectCount" value="${grid.reconnectCount}"/>
<!-- TODO ? - do we need this ?-->
<!--<property name="metricsStore" ref="${grid.metricsStore:nullMetricsStore}"/>-->
</bean>
</property>
<property name="collisionSpi">
<bean class="org.apache.ignite.spi.collision.fifoqueue.FifoQueueCollisionSpi">
<property name="parallelJobsNumber" value="${grid.maxjobs:95}"/>
</bean>
</property>
<property name="communicationSpi">
<bean class="org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi">
<property name="sharedMemoryPort" value="-1"/>
</bean>
</property>
<property name="loadBalancingSpi" ref="${grid.loadbalancer:roundRobinLoadBalancingSpi}"/>
</bean>
<!-- The default profile defines a worker node -->
<beans profile="default">
<bean id="workerGrid"
class="org.apache.ignite.IgniteSpringBean">
<property name="configuration">
<bean parent="abstractGridConfiguration">
<property name="gridName" value="${grid.name}-worker"/>
<property name="userAttributes">
<map merge="true">
<entry key="com.myco.master" value="false"/>
</map>
</property>
</bean>
</property>
</bean>
</beans>
<!-- The master profile defines a master node and additional services -->
<beans profile="master">
<bean id="processingQueueDataSource"
class="com.zaxxer.hikari.HikariDataSource"
depends-on="h2ProcessingQueueInitializer"
destroy-method="close">
<property name="driverClassName" value="org.h2.Driver"/>
<property name="jdbcUrl" value="jdbc:h2:${D360_HOME}/h2/processing_queue;DB_CLOSE_ON_EXIT=FALSE"/>
<property name="username" value="${datasource.username}"/>
<property name="password" value="${datasource.password}"/>
<property name="minimumIdle" value="${datasource.minpoolsize}"/>
<property name="maximumPoolSize" value="${datasource.maxpoolsize}"/>
<property name="connectionTimeout" value="300000"/>
<property name="idleTimeout" value="${datasource.idletime}"/>
</bean>
<bean id="processingQueueJdbcTemplate"
class="org.springframework.jdbc.core.JdbcTemplate">
<constructor-arg ref="processingQueueDataSource"/>
</bean>
<bean id="processingQueue"
class="com.myco.enterprise.processing.pqueue.H2ProcessingQueue">
<constructor-arg ref="processingQueueJdbcTemplate"/>
</bean>
<bean id="masterGrid"
class="org.apache.ignite.IgniteSpringBean">
<property name="configuration">
<bean parent="abstractGridConfiguration">
<property name="gridName" value="${grid.name}-master"/>
<property name="userAttributes">
<map merge="true">
<entry key="com.myco.master" value="true"/>
</map>
</property>
<property name="lifecycleBeans">
<list>
<ref bean="gridNodeMonitor"/>
</list>
</property>
<property name="includeEventTypes">
<list>
<util:constant static-field="org.apache.ignite.events.EventType.EVT_NODE_JOINED"/>
<util:constant static-field="org.apache.ignite.events.EventType.EVT_NODE_LEFT"/>
<util:constant static-field="org.apache.ignite.events.EventType.EVT_NODE_FAILED"/>
<util:constant static-field="org.apache.ignite.events.EventType.EVT_CLIENT_NODE_DISCONNECTED"/>
<util:constant static-field="org.apache.ignite.events.EventType.EVT_CLIENT_NODE_RECONNECTED"/>
<util:constant static-field="org.apache.ignite.events.EventType.EVT_NODE_SEGMENTED"/>
</list>
</property>
</bean>
</property>
</bean>
</beans>
</beans>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment