Class ResilientCacheLoader.BatchBuilder<K,V>

java.lang.Object
cloud.opencode.base.cache.resilience.ResilientCacheLoader.BatchBuilder<K,V>
Type Parameters:
K - the key type | 键类型
V - the value type | 值类型
Enclosing class:
ResilientCacheLoader<K,V>

public static class ResilientCacheLoader.BatchBuilder<K,V> extends Object
Builder for batch resilient loader
Since:
JDK 25, opencode-base-cache V1.9.0
Author:
Leon Soo www.LeonSoo.com
  • Constructor Details

    • BatchBuilder

      public BatchBuilder()
      Creates a new BatchBuilder instance | 创建新的 BatchBuilder 实例
  • Method Details

    • loader

      public ResilientCacheLoader.BatchBuilder<K,V> loader(Function<Set<? extends K>, Map<K,V>> loader)
      Set the batch loader function 设置批量加载函数
      Parameters:
      loader - the loader | 加载器
      Returns:
      this builder | 此构建器
    • retry

      public ResilientCacheLoader.BatchBuilder<K,V> retry(RetryPolicy retryPolicy)
      Set retry policy 设置重试策略
      Parameters:
      retryPolicy - the retryPolicy | retryPolicy
      Returns:
      the result | 结果
    • circuitBreaker

      public ResilientCacheLoader.BatchBuilder<K,V> circuitBreaker(CircuitBreaker circuitBreaker)
      Set circuit breaker 设置熔断器
      Parameters:
      circuitBreaker - the circuitBreaker | circuitBreaker
      Returns:
      the result | 结果
    • bulkhead

      public ResilientCacheLoader.BatchBuilder<K,V> bulkhead(Bulkhead bulkhead)
      Set bulkhead 设置舱壁
      Parameters:
      bulkhead - the bulkhead | bulkhead
      Returns:
      the result | 结果
    • timeout

      public ResilientCacheLoader.BatchBuilder<K,V> timeout(Duration timeout)
      Set operation timeout 设置操作超时
      Parameters:
      timeout - the timeout | timeout
      Returns:
      the result | 结果
    • build

      public Function<Set<? extends K>, Map<K,V>> build()
      Build the resilient batch loader 构建弹性批量加载器
      Returns:
      resilient batch loader function | 弹性批量加载器函数