We're migrating an application from an older gridgain 4 codebase to gridgain 6. In the old application, we partitioned the nodes based on the grid attribute key "com.mycompany.workgroup" . The new release doesn't have a topologySpi configuration property or GridAttributesTopologySpi .
What is the recommended approach or alternative?
Do any of the supplied examples address my requirement? Maybe I missed something when browsing through them.
Thanks
<beans profile="default">
<bean id="workerGrid"
class="org.gridgain.grid.GridSpringBean">
<property name="configuration">
<bean parent="abstractGridConfiguration">
<property name="gridName" value="${grid.name}-worker"/>
<property name="userAttributes">
<map merge="true">
<entry key="com.mycompany.master" value="false"/>
</map>
</property>
<property name="topologySpi">
<bean class="org.gridgain.grid.spi.topology.attributes.GridAttributesTopologySpi">
<property name="attributes">
<map>
<entry key="com.mycompany.workgroup" value="${grid.workgroup}"/>
</map>
</property>
</bean>
</property>
</bean>
</property>
</bean>
The alternative is to use GridProjection, like so
Grid grid = GridGain.grid();
GridProjection prj = grid.forAttribute("com.mycompany.workgroup", "workers");
GridComputeTaskFuture<?> fut = prj.compute().execute(new MyTask());
// Synchronous wait.
prj.get();