GeertPt
GeertPt

Reputation: 17846

How to dedicate nodes in an infinispan compute grid

We want to use Infinispan as a compute grid. We found the documentation on the Distributed Execution Framework in Infinispan 5.0.

What we want to do is to dedicate some nodes of the cache as dedicated nodes for executing particular tasks, since only these nodes have the necessary hardware.

My idea was to create a distributed cache mapping HardwareDriverKey to HardwareDriver, and execute the task using DistributedExecutorService.submit(task, hardwareDriverKey). For this to work, we need to figure out a way to ensure that the hardwareDriverKey is always located on the particular node of the distributed cache containing the actual hardware.

Do we need to write a custom ConsistentHash that can extract the node address from the hardwareDriverKey? Have you got an example for this? Or is there another way?

Thanks in advance, Geert.

Upvotes: 3

Views: 835

Answers (2)

mircea.markus
mircea.markus

Reputation: 124

That basically forces the groups of objects to stay on the same node, but you can't control which node it is. In order to force location to a specific address you can use the KeyAffinityService. Be aware though that objects might be moved around if the topology changes.

Upvotes: 2

mircea.markus
mircea.markus

Reputation: 124

The grouping API is there to solve this problem. You can read more about it here.

Upvotes: 1

Related Questions