Class VolumeRetryUtil
java.lang.Object
com.databricks.jdbc.common.util.VolumeRetryUtil
Utility class for volume operation retry logic. Centralizes retry decision logic for both
presigned URL requests and upload operations.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intMaximum number of retry attempts for volume operations. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intgetRetryTimeoutSeconds(IDatabricksConnectionContext connectionContext) Get the retry timeout in seconds.static booleanisRetryableHttpCode(int statusCode, IDatabricksConnectionContext connectionContext) Check if the given HTTP status code is retryable.static booleanshouldRetry(int attempt, long retryStartTime, IDatabricksConnectionContext connectionContext) Check if we should retry based on attempt count and elapsed time.
-
Field Details
-
MAX_RETRIES
public static final int MAX_RETRIESMaximum number of retry attempts for volume operations.- See Also:
-
-
Constructor Details
-
VolumeRetryUtil
public VolumeRetryUtil()
-
-
Method Details
-
isRetryableHttpCode
public static boolean isRetryableHttpCode(int statusCode, IDatabricksConnectionContext connectionContext) Check if the given HTTP status code is retryable.- Parameters:
statusCode- The HTTP status code to checkconnectionContext- The connection context (can be null for tests)- Returns:
- true if the status code is retryable, false otherwise
-
shouldRetry
public static boolean shouldRetry(int attempt, long retryStartTime, IDatabricksConnectionContext connectionContext) Check if we should retry based on attempt count and elapsed time.- Parameters:
attempt- Current attempt number (1-based)retryStartTime- Start time of the retry sequence in millisecondsconnectionContext- The connection context (can be null for tests)- Returns:
- true if we should retry, false otherwise
-
getRetryTimeoutSeconds
Get the retry timeout in seconds.- Parameters:
connectionContext- The connection context (can be null for tests)- Returns:
- The retry timeout in seconds
-