1

I have been trying to implement a project that would always store an particular value in an particular node in Infinispan 8.1.If that node is down,the values in that cache should be moved to another node. I have heard about Grouping api which supports my requirement,But, i just want to confirm that if that node is down,whether all the values will be moved to the secondary owner node or not.

karthi keyan
  • 213
  • 2
  • 19

1 Answers1

3

Grouping API doesn't guarantee that an entry is stored on a particular node. It guarantees that entries in the same group are stored on the same node [1].

The KeyAffinity API [2] can help ensure that an entry is stored on a specific node. However it will only be stored on that specific node under a stable topology. If the topology changes there are no guarantees that it is still stored on that node, even if it is still around.

In either case if you are using a Distributed cache with at least numOwners >= 2, then the data will be retained (and moved between nodes as needed) as long as you don't have concurrent failures >= numOwners.

[1] http://infinispan.org/docs/dev/user_guide/user_guide.html#grouping

[2] http://infinispan.org/docs/dev/user_guide/user_guide.html#KeyAffinityService

Mudokonman
  • 856
  • 4
  • 6
  • Yeah,I understood the basic concept of Grouping api. I have been searching for an programmatic example of this grouping api for more than a month.But I couldn't find any useful answers.Can you please guide me on programmatic knowledge of grouping api. – karthi keyan Nov 08 '17 at 07:40
  • The User Guide should explain it pretty well. But if you want more code examples you can look at the test packages at https://github.com/infinispan/infinispan/tree/master/core/src/test/java/org/infinispan/distribution/groups – Mudokonman Nov 08 '17 at 15:07
  • I'm asking for the source code of an real time application which implemented grouping api in it. – karthi keyan Nov 09 '17 at 06:47
  • Thanks a lot man..It took some time,but i finally got your point.I voted your answer is correct. Better late than never :) – karthi keyan Feb 22 '18 at 17:03
  • If you got time,you can help me with another problem in infinispan https://stackoverflow.com/questions/48933184/custom-hashing-function-in-infinispan – karthi keyan Feb 22 '18 at 17:05