Interface WriteCoalescer.WriteErrorHandler<K,V>

Type Parameters:
K - key type | 键类型
V - value type | 值类型
Enclosing class:
WriteCoalescer<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.

@FunctionalInterface public static interface WriteCoalescer.WriteErrorHandler<K,V>
Write error handler 写错误处理器
Since:
JDK 25, opencode-base-cache V2.0.5
Author:
Leon Soo www.LeonSoo.com
  • Method Details

    • handleError

      void handleError(Map<K,V> failedBatch, Exception error)
      Handle write error 处理写错误
      Parameters:
      failedBatch - the failed batch | 失败的批次
      error - the error | 错误
    • logAndDiscard

      static <K,V> WriteCoalescer.WriteErrorHandler<K,V> logAndDiscard()
      Default handler that logs errors 记录错误的默认处理器
      Type Parameters:
      K - key type | 键类型
      V - value type | 值类型
      Returns:
      error handler | 错误处理器
    • rethrow

      static <K,V> WriteCoalescer.WriteErrorHandler<K,V> rethrow()
      Handler that rethrows errors 重新抛出错误的处理器
      Type Parameters:
      K - key type | 键类型
      V - value type | 值类型
      Returns:
      error handler | 错误处理器