Package net.snowflake.ingest.connection
Class ServiceResponseHandler
- java.lang.Object
-
- net.snowflake.ingest.connection.ServiceResponseHandler
-
public final class ServiceResponseHandler extends Object
This class handles taking the HttpResponses we've gotten back, and producing an appropriate response object for usage
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classServiceResponseHandler.ApiNameEnums for Snowpipe REST API: https://docs.snowflake.com/en/user-guide/data-load-snowpipe-rest-apis.html Used in handleExceptionalStatus for logging purpose
-
Constructor Summary
Constructors Constructor Description ServiceResponseHandler()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ConfigureClientResponseunmarshallConfigureClientResponse(net.snowflake.client.jdbc.internal.apache.http.HttpResponse response, UUID requestId)unmarshallConfigureClientResponse - Given an HttpResponse object, attempts to deserialize it into a ConfigureClientResponsestatic ClientStatusResponseunmarshallGetClientStatus(net.snowflake.client.jdbc.internal.apache.http.HttpResponse response, UUID requestId)unmarshallGetClientStatus - Given an HttpResponse object, attempts to deserialize it into a ClientStatusResponsestatic HistoryRangeResponseunmarshallHistoryRangeResponse(net.snowflake.client.jdbc.internal.apache.http.HttpResponse response, UUID requestId)Given an HttpResponse object - attempts to deserialize it into a HistoryRangeResponsestatic HistoryResponseunmarshallHistoryResponse(net.snowflake.client.jdbc.internal.apache.http.HttpResponse response, UUID requestId)unmarshallHistoryResponse Given an HttpResponse object - attempts to deserialize it into a HistoryResponse objectstatic IngestResponseunmarshallIngestResponse(net.snowflake.client.jdbc.internal.apache.http.HttpResponse response, UUID requestId)unmarshallIngestResponse Given an HttpResponse object - attempts to deserialize it into an IngestResponse objectstatic <T> TunmarshallStreamingIngestResponse(net.snowflake.client.jdbc.internal.apache.http.HttpResponse response, Class<T> valueType, ServiceResponseHandler.ApiName apiName)unmarshallStreamingIngestResponse Given an HttpResponse object - attempts to deserialize it into an Object based on input type
-
-
-
Method Detail
-
unmarshallIngestResponse
public static IngestResponse unmarshallIngestResponse(net.snowflake.client.jdbc.internal.apache.http.HttpResponse response, UUID requestId) throws IOException, IngestResponseException, BackOffException
unmarshallIngestResponse Given an HttpResponse object - attempts to deserialize it into an IngestResponse object- Parameters:
response- the HTTPResponse we want to distill into an IngestResponserequestId-- Returns:
- An IngestResponse with all of the parsed out information
- Throws:
IOException- if our entity is somehow corrupt or we can't get itIngestResponseException- - if we have an uncategorized network issueBackOffException- - if we have a 503 issue
-
unmarshallHistoryResponse
public static HistoryResponse unmarshallHistoryResponse(net.snowflake.client.jdbc.internal.apache.http.HttpResponse response, UUID requestId) throws IOException, IngestResponseException, BackOffException
unmarshallHistoryResponse Given an HttpResponse object - attempts to deserialize it into a HistoryResponse object- Parameters:
response- the HttpResponse object we are trying to deserializerequestId-- Returns:
- a HistoryResponse with all the parsed out information
- Throws:
IOException- if our entity is somehow corrupt or we can't get itIngestResponseException- - if we have an uncategorized network issueBackOffException- - if we have a 503 issue
-
unmarshallHistoryRangeResponse
public static HistoryRangeResponse unmarshallHistoryRangeResponse(net.snowflake.client.jdbc.internal.apache.http.HttpResponse response, UUID requestId) throws IOException, IngestResponseException, BackOffException
Given an HttpResponse object - attempts to deserialize it into a HistoryRangeResponse- Parameters:
response- the HttpResponse object we are trying to deserializerequestId-- Returns:
- HistoryRangeResponse
- Throws:
IOException- if our entity is somehow corrupt or we can't get itIngestResponseException- - if we have an uncategorized network issueBackOffException- - if we have a 503 issue
-
unmarshallConfigureClientResponse
public static ConfigureClientResponse unmarshallConfigureClientResponse(net.snowflake.client.jdbc.internal.apache.http.HttpResponse response, UUID requestId) throws IOException, IngestResponseException, BackOffException
unmarshallConfigureClientResponse - Given an HttpResponse object, attempts to deserialize it into a ConfigureClientResponse- Parameters:
response- HttpResponserequestId-- Returns:
- ConfigureClientResponse
- Throws:
IOException- if our entity is somehow corrupt or we can't get itIngestResponseException- - if we have an uncategorized network issueBackOffException- - if we have a 503 issue
-
unmarshallGetClientStatus
public static ClientStatusResponse unmarshallGetClientStatus(net.snowflake.client.jdbc.internal.apache.http.HttpResponse response, UUID requestId) throws IOException, IngestResponseException, BackOffException
unmarshallGetClientStatus - Given an HttpResponse object, attempts to deserialize it into a ClientStatusResponse- Parameters:
response- HttpResponserequestId-- Returns:
- ClientStatusResponse
- Throws:
IOException- if our entity is somehow corrupt or we can't get itIngestResponseException- - if we have an uncategorized network issueBackOffException- - if we have a 503 issue
-
unmarshallStreamingIngestResponse
public static <T> T unmarshallStreamingIngestResponse(net.snowflake.client.jdbc.internal.apache.http.HttpResponse response, Class<T> valueType, ServiceResponseHandler.ApiName apiName) throws IOException, IngestResponseExceptionunmarshallStreamingIngestResponse Given an HttpResponse object - attempts to deserialize it into an Object based on input type- Parameters:
response- http response from servervalueType- the class typeapiName- enum to represent the corresponding api name- Returns:
- the corresponding response object based on input class type
- Throws:
IOException- if a low-level I/O problemIngestResponseException- if received an exceptional status code
-
-