Class CacheWarmer.Builder<K,V>
java.lang.Object
cloud.opencode.base.cache.warming.CacheWarmer.Builder<K,V>
- Type Parameters:
K- the key type | 键类型V- the value type | 值类型
- Enclosing class:
CacheWarmer<K,V>
Builder for CacheWarmer
CacheWarmer 构建器
- Since:
- JDK 25, opencode-base-cache V2.0.5
- Author:
- Leon Soo www.LeonSoo.com
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSets the batch loader function | 设置批量加载函数batchSize(int size) Sets the batch size | 设置批量大小build()Builds the CacheWarmer | 构建缓存预热器Sets the cache | 设置缓存eventHandler(CacheWarmer.WarmingEventHandler<K, V> handler) Sets the event handler | 设置事件处理器Sets the loader function | 设置加载函数parallelism(int parallelism) Sets the parallelism level | 设置并行度
-
Constructor Details
-
Builder
public Builder()Creates a new Builder instance | 创建新的构建器实例
-
-
Method Details
-
cache
-
loader
-
batchLoader
-
batchSize
Sets the batch size | 设置批量大小- Parameters:
size- the batch size | 批量大小- Returns:
- this builder | 此构建器
-
parallelism
Sets the parallelism level | 设置并行度- Parameters:
parallelism- the parallelism | 并行度- Returns:
- this builder | 此构建器
-
eventHandler
Sets the event handler | 设置事件处理器- Parameters:
handler- the handler | 处理器- Returns:
- this builder | 此构建器
-
build
-