简体   繁体   English

在Infinispan中分组api

[英]Grouping api in Infinispan

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. 我一直在尝试实现一个始终在Infinispan 8.1中的特定节点中存储特定值的项目。如果该节点已关闭,则应将该缓存中的值移动到另一个节点。 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. 我听说过支持我的要求的分组api,但是,我只想确认如果该节点关闭,是否所有值都将移动到辅助所有者节点。

Grouping API doesn't guarantee that an entry is stored on a particular node. 分组API不保证条目存储在特定节点上。 It guarantees that entries in the same group are stored on the same node [1]. 它保证同一组中的条目存储在同一节点上[1]。

The KeyAffinity API [2] can help ensure that an entry is stored on a specific node. KeyAffinity API [2]可以帮助确保条目存储在特定节点上。 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. 在任何一种情况下,如果您使用的分布式缓存至少具有numOwners> = 2,那么只要您没有并发故障> = numOwners,就会保留数据(并根据需要在节点之间移动)。

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

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM