Este conteúdo não está disponível no idioma selecionado.

29.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.
Voltar ao topo
Red Hat logoGithubredditYoutubeTwitter

Aprender

Experimente, compre e venda

Comunidades

Sobre a documentação da Red Hat

Ajudamos os usuários da Red Hat a inovar e atingir seus objetivos com nossos produtos e serviços com conteúdo em que podem confiar. Explore nossas atualizações recentes.

Tornando o open source mais inclusivo

A Red Hat está comprometida em substituir a linguagem problemática em nosso código, documentação e propriedades da web. Para mais detalhes veja o Blog da Red Hat.

Sobre a Red Hat

Fornecemos soluções robustas que facilitam o trabalho das empresas em plataformas e ambientes, desde o data center principal até a borda da rede.

Theme

© 2025 Red Hat