K - key typepublic class CacheableContainer<K> extends Object implements Container<K>, Container.Lifecycle
Data source container wrapper class with cache function.
When the data source is obtained from the key set,
it will first try to obtain it from the cache.
If some key sets do not exist in the cache,
it will be obtained from the original container and added to the cache for this batch of keys.
CacheManagerContainer.LifecycleEMPTY_CONTAINER_NAMESPACE| 构造器和说明 |
|---|
CacheableContainer() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
destroy()
Destroy the container
|
Map<K,?> |
get(Collection<K> keys)
Enter a batch of key values to return data source objects grouped by key values.
|
String |
getNamespace()
Gets the namespace of the data source container,
always return the namespace of the wrapped original container.
|
void |
init()
Initialize the container
|
public String getNamespace()
getNamespace 在接口中 Container<K>public Map<K,?> get(Collection<K> keys)
Enter a batch of key values to return data source objects grouped by key values. If part of the key value entered has been cached, the data corresponding to that part of the key value will be obtained from the cache first.
public void init()
init 在接口中 Container.Lifecyclepublic void destroy()
destroy 在接口中 Container.LifecycleCopyright © 2023. All rights reserved.