Package com.databricks.jdbc.common.util
Class VolumeRetryUtil
- java.lang.Object
-
- com.databricks.jdbc.common.util.VolumeRetryUtil
-
public class VolumeRetryUtil extends Object
Utility class for volume operation retry logic. Centralizes retry decision logic for both presigned URL requests and upload operations.
-
-
Field Summary
Fields Modifier and Type Field Description static intMAX_RETRIESMaximum number of retry attempts for volume operations.
-
Constructor Summary
Constructors Constructor Description VolumeRetryUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static 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 Detail
-
MAX_RETRIES
public static final int MAX_RETRIES
Maximum number of retry attempts for volume operations.- See Also:
- Constant Field Values
-
-
Method Detail
-
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
public static int getRetryTimeoutSeconds(IDatabricksConnectionContext connectionContext)
Get the retry timeout in seconds.- Parameters:
connectionContext- The connection context (can be null for tests)- Returns:
- The retry timeout in seconds
-
-