You can use Ignite node attributes to define separate "logical clusters" on
Ignite cluster:
1. Node attributes are defined in the Ignite configuration as a
"userAttributes" map. Define an attribute, say, "group":
<bean class="org.apache.ignite.configuration.IgniteConfiguration">
<property name="userAttributes">
<map>
<entry key=*"**group**" *value="mutable"/>
</map>
</property>
2. Create a GroupNodeFilter:
public class GroupNodeFilter implements IgnitePredicate<ClusterNode> {
public GroupNodeFilter(String group) {
this.group = group;
}
/** {@inheritDoc} */
@Override public boolean apply(ClusterNode node) {
return group.equals(node.attributes().get(*"**group**"*));
}
}
3. Start caches storing mutable data only where "mutable.processor"
attribute is defined and cache storing immutable data only where it is
undefined:
<bean class="org.apache.ignite.configuration.CacheConfiguration">
<property name="name" value="c1"/>
<property name="cacheMode" value="PARTITIONED"/>
<property name="atomicityMode" value="ATOMIC"/>
<property name="backups" value="0"/>
<property name="nodeFilter">
<bean class=*"**GroupNodeFilter**"*>
<constructor-arg value="mutable"/></bean>
</property>
</bean>
4. Send compute jobs to corresponding server group:
IgniteCompute compute =
ignite.compute(ignite.cluster().forAttribute("group", "mutable"));