Interface WriteBehindCache.BatchWriter<K,V>
- Type Parameters:
K- key type | 键类型V- value type | 值类型
- Enclosing class:
WriteBehindCache<K,V>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Batch writer interface for persisting cache changes
批量写入器接口,用于持久化缓存变更
- Since:
- JDK 25, opencode-base-cache V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
-
Method Summary
Modifier and TypeMethodDescriptionstatic <K,V> WriteBehindCache.BatchWriter <K, V> Create writer with separate put and delete handlers 创建分别处理放入和删除的写入器static <K,V> WriteBehindCache.BatchWriter <K, V> Create writer for puts only 创建仅处理放入的写入器voidWrite batch of changes to underlying store 将批量变更写入底层存储
-
Method Details
-
writeBatch
-
putsOnly
Create writer for puts only 创建仅处理放入的写入器- Type Parameters:
K- key type | 键类型V- value type | 值类型- Parameters:
consumer- put consumer | 放入消费者- Returns:
- batch writer | 批量写入器
-
of
static <K,V> WriteBehindCache.BatchWriter<K,V> of(Consumer<Map<K, V>> putHandler, Consumer<Set<K>> deleteHandler) Create writer with separate put and delete handlers 创建分别处理放入和删除的写入器- Type Parameters:
K- key type | 键类型V- value type | 值类型- Parameters:
putHandler- put handler | 放入处理器deleteHandler- delete handler | 删除处理器- Returns:
- batch writer | 批量写入器
-