public class AmazonServiceExceptionTransformer
extends java.lang.Object
This class transforms an Amazon DynamoDB Streams AmazonServiceException into a compatible Amazon Kinesis AmazonServiceException.
Applicable API calls:
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DYNAMODB_STREAMS_THROTTLING_EXCEPTION_ERROR_CODE
Error message used for ThrottlingException by the Amazon DynamoDB Streams service.
|
static java.lang.String |
EMPTY_STRING
Empty String used when an Exception requires an error message, but none is supplied.
|
static java.lang.String |
KINESIS_INTERNAL_ERROR_MESSAGE
Error message used for InternalFailure by the Amazon Kinesis service.
|
static java.lang.String |
KINESIS_VALIDATION_ERROR_MESSAGE
Error message used for ValidationError by the Amazon Kinesis service.
|
| Constructor and Description |
|---|
AmazonServiceExceptionTransformer() |
| Modifier and Type | Method and Description |
|---|---|
static com.amazonaws.AmazonServiceException |
transformDynamoDBStreamsToKinesisDescribeStream(com.amazonaws.AmazonServiceException ase)
Transforms Amazon DynamoDB Streams exceptions to compatible Amazon Kinesis exceptions for the DescribeStream API.
|
static com.amazonaws.AmazonServiceException |
transformDynamoDBStreamsToKinesisGetRecords(com.amazonaws.AmazonServiceException ase,
AmazonDynamoDBStreamsAdapterClient.SkipRecordsBehavior skipRecordsBehavior)
Transforms Amazon DynamoDB Streams exceptions to compatible Amazon Kinesis exceptions for the GetRecords API.
|
static com.amazonaws.AmazonServiceException |
transformDynamoDBStreamsToKinesisGetShardIterator(com.amazonaws.AmazonServiceException ase,
AmazonDynamoDBStreamsAdapterClient.SkipRecordsBehavior skipRecordsBehavior)
Transforms Amazon DynamoDB Streams exceptions to compatible Amazon Kinesis exceptions for the GetShardIterator
API.
|
static com.amazonaws.AmazonServiceException |
transformDynamoDBStreamsToKinesisListStreams(com.amazonaws.AmazonServiceException ase)
Transforms Amazon DynamoDB Streams exceptions to compatible Amazon Kinesis exceptions for the ListStreams API.
|
public static final java.lang.String DYNAMODB_STREAMS_THROTTLING_EXCEPTION_ERROR_CODE
public static final java.lang.String EMPTY_STRING
public static final java.lang.String KINESIS_INTERNAL_ERROR_MESSAGE
public static final java.lang.String KINESIS_VALIDATION_ERROR_MESSAGE
public static com.amazonaws.AmazonServiceException transformDynamoDBStreamsToKinesisDescribeStream(com.amazonaws.AmazonServiceException ase)
The following transformations are applied:
(1) InternalServerError
Amazon DynamoDB Streams: InternalServerErrorException
Amazon Kinesis: AmazonServiceException
Notes: SDK relies on the 500 series StatusCode to identify that the issue was service side
(2) ResourceNotFound
Amazon DynamoDB Streams: ResourceNotFoundException
Amazon Kinesis: ResourceNotFoundException
Notes: N/A
(2) ThrottlingException
Amazon DynamoDB Streams: AmazonServiceException with ErrorCode
"ThrottlingException"
Amazon Kinesis: LimitExceededException
Notes: N/A
ase - The Amazon DynamoDB Streams exception thrown by a DescribeStream callpublic static com.amazonaws.AmazonServiceException transformDynamoDBStreamsToKinesisGetRecords(com.amazonaws.AmazonServiceException ase,
AmazonDynamoDBStreamsAdapterClient.SkipRecordsBehavior skipRecordsBehavior)
The following transformations are applied:
(1) ExpiredIterator
Amazon DynamoDB Streams: ExpiredIteratorException
Amazon Kinesis: ExpiredIteratorException
Notes: N/A
(2) InternalServerError
Amazon DynamoDB Streams: InternalServerErrorException
Amazon Kinesis: AmazonServiceException
Notes: SDK relies on the 500 series StatusCode to identify that the issue was service side
(3) LimitExceeded
Amazon DynamoDB Streams: LimitExceededException
Amazon Kinesis: ProvisionedThroughputExceededException
Notes: N/A
(4) ResourceNotFound
Amazon DynamoDB Streams: ResourceNotFoundException
Amazon Kinesis: ResourceNotFoundException
Notes: N/A
(5) ThrottlingException
Amazon DynamoDB Streams: AmazonServiceException with ErrorCode
"ThrottlingException"
Amazon Kinesis: ProvisionedThroughputExceededException
Notes: N/A
(6) TrimmedDataAccess
Amazon DynamoDB Streams: TrimmedDataAccessException
Amazon Kinesis: N/A
Notes: FIXME Amazon Kinesis does not communicate trimmed data; the service retrieves the oldest available records
for the shard and returns those as if no trimming occurred. Because no context information about the shardId or
streamId is available in the GetRecords request, the adapter relies on the user attempting to get a fresh shard
iterator using the GetShardIterator API when an ExpiredIteratorException is thrown. If data loss is unacceptable,
an UnableToReadMoreRecordsException is thrown.
ase - The Amazon DynamoDB Streams exception thrown by a GetRecords callskipRecordsBehavior - The AmazonDynamoDBStreamsAdapterClient.SkipRecordsBehavior for the adapterpublic static com.amazonaws.AmazonServiceException transformDynamoDBStreamsToKinesisGetShardIterator(com.amazonaws.AmazonServiceException ase,
AmazonDynamoDBStreamsAdapterClient.SkipRecordsBehavior skipRecordsBehavior)
The following transformations are applied:
(1) InternalServerError
Amazon DynamoDB Streams: InternalServerErrorException
Amazon Kinesis: AmazonServiceException
Notes: SDK relies on the 500 series StatusCode to identify that the issue was service side
(2) ResourceNotFound
Amazon DynamoDB Streams: ResourceNotFoundException
Amazon Kinesis: ResourceNotFoundException
Notes: Amazon Kinesis does not differentiate TrimmedData and ResourceNotFound. In the case that data loss is not
acceptable, the adapter throws an UnableToReadMoreRecordsException
(3) ThrottlingException
Amazon DynamoDB Streams: AmazonServiceException with ErrorCode
"ThrottlingException"
Amazon Kinesis: ProvisionedThroughputExceededException
Notes: N/A
(4) TrimmedDataAccess
Amazon DynamoDB Streams: TrimmedDataAccessException
Amazon Kinesis: N/A
Notes: FIXME Amazon Kinesis does not communicate trimmed data; the service returns a valid shard iterator for the
oldest available records for the specified shard as if no trimming occurred. If data loss is acceptable, the
adapter mimics this behavior by intercepting the exception and retrieving a shard iterator for TRIM_HORIZON. If
data loss is unacceptable, an UnableToReadMoreRecordsException is thrown.
ase - The Amazon DynamoDB Streams exception thrown by a GetRecords callskipRecordsBehavior - The AmazonDynamoDBStreamsAdapterClient.SkipRecordsBehavior for the adapterpublic static com.amazonaws.AmazonServiceException transformDynamoDBStreamsToKinesisListStreams(com.amazonaws.AmazonServiceException ase)
The following transformations are applied:
(1) InternalServerError
Amazon DynamoDB Streams: InternalServerErrorException
Amazon Kinesis: AmazonServiceException
Notes: SDK relies on the 500 series StatusCode to identify that the issue was service side
(2) ResourceNotFound
Amazon DynamoDB Streams: ResourceNotFoundException
Amazon Kinesis: N/A
Notes: A compatible transformation is to an AmazonServiceException with a 400 series StatusCode
(3) ThrottlingException
Amazon DynamoDB Streams: AmazonServiceException with ErrorCode
"ThrottlingException"
Amazon Kinesis: LimitExceededException
Notes: N/A
ase - The Amazon DynamoDB Streams exception thrown by a ListStreams call