Interface CacheWarmer.WarmingEventHandler<K,V>
- Type Parameters:
K- the key type | 键类型V- the value type | 值类型
- Enclosing class:
CacheWarmer<K,V>
public static interface CacheWarmer.WarmingEventHandler<K,V>
Warming event handler
预热事件处理器
- Since:
- JDK 25, opencode-base-cache V2.0.5
- Author:
- Leon Soo www.LeonSoo.com
-
Method Summary
Modifier and TypeMethodDescriptionstatic <K,V> CacheWarmer.WarmingEventHandler <K, V> noOp()Returns a no-op event handler | 返回空操作事件处理器default voidonComplete(CacheWarmer.WarmingResult<K> result) Called when warming completes | 预热完成时调用default voidonKeyFailed(K key, Exception error) Called when a key fails to warm | 键预热失败时调用default voidonKeyWarmed(K key, V value) Called when a key is warmed | 键预热完成时调用default voidonStart(int totalKeys) Called when warming starts | 预热开始时调用
-
Method Details
-
onStart
default void onStart(int totalKeys) Called when warming starts | 预热开始时调用- Parameters:
totalKeys- total keys to warm | 要预热的总键数
-
onKeyWarmed
-
onKeyFailed
-
onComplete
Called when warming completes | 预热完成时调用- Parameters:
result- the warming result | 预热结果
-
noOp
Returns a no-op event handler | 返回空操作事件处理器- Type Parameters:
K- the key type | 键类型V- the value type | 值类型- Returns:
- no-op handler | 空操作处理器
-