此内容没有您所选择的语言版本。

16.6. Distributed Execution and Locality


In a Distributed Environment ownership, in regards to the DistributionManager and ConsistentHash, is theoretical; neither of these classes have any knowledge if data is actively in the cache. Instead, these classes are used to determine which node should store the specified key.
To examine the locality of a given key use either of the following options:
  • Option 1: Confirm that the key is both found in the cache and the DistributionManager indicates it is local, as seen in the following example:
    (cache.getAdvancedCache().withFlags(SKIP_REMOTE_LOOKUP).containsKey(key) 
    && cache.getAdvancedCache().getDistributionManager().getLocality(key).isLocal())
    Copy to Clipboard Toggle word wrap
  • Option 2: Query the DataContainer directly:
    cache.getAdvancedCache().getDataContainer().containsKey(key)
    Copy to Clipboard Toggle word wrap

    Note

    If the entry is passivated then the DataContainer will return False, regardless of the key's presence.
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat