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

1.4. Placing and Retrieving Sets of Data


The AdvancedCache and RemoteCache interfaces include methods to either put or get a Map of existing data in bulk. These operations are typically much more efficient than an equivalent sequence of individual operations, especially when using them in server-client mode, as a single network operation occurs as opposed to multiple transactions.
When using the bulk operations the memory overhead is higher during the operation itself, as the get or put operation must accommodate for the full Map in a single execution.
The methods for each class are found below:
  • AdvancedCache:
    • Map<K,V> getAll(Set<?> keys) - returns a Map containing the values associated with the set of keys requested.
    • void putAll(Map<? extends K, ? extends V> map, Metadata metadata) - copies all of the mappings from the specified map to this cache, which takes an instance of Metadata to provide metadata information such as the lifespan, version, etc. on the entries being stored.
  • RemoteCache:
    • Map<K,V> getAll(Set<? extends K> keys) - returns a Map containing the values associated with the set of keys requested.
    • void putAll(Map<? extends K, ? extends V> map) - copies all of the mappings from the specified map to this cache.
    • void putAll(Map<? extends K, ? extends V> map, long lifespan, TimeUnit unit) - copies all of the mappings from the specified map to this cache, along with a lifespan before the entry is expired.
    • void putAll(Map<? extends K, ? extends V> map, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit) - copies all of the mappings from the specified map to this cache, along with both a timespan before the entries are expired and the maximum amount of time the entry is allowed to be idle before it is considered to be expired.
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

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

让开源更具包容性

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

關於紅帽

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

Theme

© 2025 Red Hat