Package com.databricks.jdbc.dbclient.impl.http

## Class UCVolumeHttpRetryHandler

- java.lang.Object
- - com.databricks.jdbc.dbclient.impl.http.DatabricksHttpRetryHandler
  - - com.databricks.jdbc.dbclient.impl.http.UCVolumeHttpRetryHandler

All Implemented Interfaces:
  `org.apache.http.client.HttpRequestRetryHandler`, `org.apache.http.HttpResponseInterceptor`

    public class UCVolumeHttpRetryHandler
    extends DatabricksHttpRetryHandler

### Constructor Summary

Constructors
`UCVolumeHttpRetryHandler​(IDatabricksConnectionContext connectionContext)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `process​(org.apache.http.HttpResponse httpResponse, org.apache.http.protocol.HttpContext httpContext)` Processes an HTTP response to handle retryable status codes and set up retry logic.
`boolean` `retryRequest​(IOException exception, int executionCount, org.apache.http.protocol.HttpContext context)` Determines whether a request should be retried after encountering an IOException.

### Methods inherited from class com.databricks.jdbc.dbclient.impl.http.DatabricksHttpRetryHandler

`doSleepForDelay`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### UCVolumeHttpRetryHandler

    public UCVolumeHttpRetryHandler​(IDatabricksConnectionContext connectionContext)

### Method Detail

#### process

    public void process​(org.apache.http.HttpResponse httpResponse,
                        org.apache.http.protocol.HttpContext httpContext)
                 throws IOException

Processes an HTTP response to handle retryable status codes and set up retry logic.

This method is responsible for examining the HTTP response, determining if it's retryable, and setting up the necessary context for potential retry attempts.

Specifically this handles retryable http codes and setting of retry start time for UC Volume operations

Specified by:
  `process` in interface `org.apache.http.HttpResponseInterceptor`
Overrides:
  `process` in class `DatabricksHttpRetryHandler`
Parameters:
  `httpResponse` - The HTTP response to be processed.
  `httpContext` - The HTTP context associated with the request and response.
Throws:
  `IOException` - If there's an issue processing the response.
  `DatabricksRetryHandlerException` - If the status code is retryable, triggering the retry mechanism.
See Also:
  `DatabricksHttpRetryHandler.isStatusCodeRetryable(int)`, `DatabricksHttpRetryHandler.initializeRetryAccumulatedTimeIfNotExist(HttpContext)`, `DatabricksRetryHandlerException`

#### retryRequest

    public boolean retryRequest​(IOException exception,
                                int executionCount,
                                org.apache.http.protocol.HttpContext context)

Determines whether a request should be retried after encountering an IOException.

This method implements a comprehensive retry strategy for HTTP requests, considering various factors such as status codes, retry intervals, and execution counts.

Specifically, this method implements retry strategy for HTTP requests for UC Volume operations

Specified by:
  `retryRequest` in interface `org.apache.http.client.HttpRequestRetryHandler`
Overrides:
  `retryRequest` in class `DatabricksHttpRetryHandler`
Parameters:
  `exception` - The IOException encountered during the request execution.
  `executionCount` - The number of times this request has been executed.
  `context` - The HttpContext containing attributes related to the request and retry logic.
Returns:
  boolean True if the request should be retried, false otherwise.
See Also:
  `DatabricksHttpRetryHandler.isStatusCodeRetryable(int)`, `DatabricksHttpRetryHandler.isRequestMethodRetryable(String)`, `DatabricksHttpRetryHandler.calculateDelayInMillis(int, int, int)`, `DatabricksHttpRetryHandler.doSleepForDelay(long)`