Package org.pjdbc.drivers
Class RetryDriver.RetryConfig
java.lang.Object
org.pjdbc.drivers.RetryDriver.RetryConfig
- Enclosing class:
RetryDriver
Configuration holder for retry parameters, parsed once at connection time.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongcalculateDelay(int attempt) Calculate delay for a given retry attempt (0-indexed).doublelonglongintbooleanbooleanCheck if an exception indicates a connection failure.booleanCheck if an exception is retryable based on SQL state.
-
Constructor Details
-
RetryConfig
-
-
Method Details
-
getMaxRetries
public int getMaxRetries() -
getInitialDelay
public long getInitialDelay() -
getMaxDelay
public long getMaxDelay() -
getBackoffMultiplier
public double getBackoffMultiplier() -
hasJitter
public boolean hasJitter() -
getRetryableSqlStates
-
isRetryable
Check if an exception is retryable based on SQL state. -
isConnectionError
Check if an exception indicates a connection failure. Connection errors have SQL states starting with "08". -
calculateDelay
public long calculateDelay(int attempt) Calculate delay for a given retry attempt (0-indexed). Uses ThreadLocalRandom for thread-safe jitter generation.
-