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 Details

    • MAX_RETRIES

      public static final int MAX_RETRIES
      Maximum 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 check
      connectionContext - 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 milliseconds
      connectionContext - 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