Class AmazonServiceExceptionTransformer
This class transforms an Amazon DynamoDB Streams AmazonServiceException into a compatible Amazon Kinesis AmazonServiceException.
Applicable API calls:
- DescribeStream
- GetRecords
- GetShardIterator
- ListStreams
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Error message used for ThrottlingException by the Amazon DynamoDB Streams service.static final String
Empty String used when an Exception requires an error message, but none is supplied.static final String
Error message used for InternalFailure by the Amazon Kinesis service.static final String
Error message used for ValidationError by the Amazon Kinesis service. -
Method Summary
Modifier and TypeMethodDescriptionstatic software.amazon.awssdk.awscore.exception.AwsServiceException
transformDynamoDBStreamsToKinesisDescribeStream
(software.amazon.awssdk.awscore.exception.AwsServiceException ase) Transforms Amazon DynamoDB Streams exceptions to compatible Amazon Kinesis exceptions for the DescribeStream API.static software.amazon.awssdk.awscore.exception.AwsServiceException
transformDynamoDBStreamsToKinesisGetRecords
(software.amazon.awssdk.awscore.exception.AwsServiceException ase, AmazonDynamoDBStreamsAdapterClient.SkipRecordsBehavior skipRecordsBehavior) Transforms Amazon DynamoDB Streams exceptions to compatible Amazon Kinesis exceptions for the GetRecords API.static software.amazon.awssdk.awscore.exception.AwsServiceException
transformDynamoDBStreamsToKinesisGetShardIterator
(software.amazon.awssdk.awscore.exception.AwsServiceException ase, AmazonDynamoDBStreamsAdapterClient.SkipRecordsBehavior skipRecordsBehavior) Transforms Amazon DynamoDB Streams exceptions to compatible Amazon Kinesis exceptions for the GetShardIterator API.static software.amazon.awssdk.awscore.exception.AwsServiceException
transformDynamoDBStreamsToKinesisListStreams
(software.amazon.awssdk.awscore.exception.AwsServiceException ase) Transforms Amazon DynamoDB Streams exceptions to compatible Amazon Kinesis exceptions for the ListStreams API.
-
Field Details
-
DYNAMODB_STREAMS_THROTTLING_EXCEPTION_ERROR_CODE
Error message used for ThrottlingException by the Amazon DynamoDB Streams service.- See Also:
-
EMPTY_STRING
Empty String used when an Exception requires an error message, but none is supplied.- See Also:
-
KINESIS_INTERNAL_ERROR_MESSAGE
Error message used for InternalFailure by the Amazon Kinesis service.- See Also:
-
KINESIS_VALIDATION_ERROR_MESSAGE
Error message used for ValidationError by the Amazon Kinesis service.- See Also:
-
-
Method Details
-
transformDynamoDBStreamsToKinesisDescribeStream
public static software.amazon.awssdk.awscore.exception.AwsServiceException transformDynamoDBStreamsToKinesisDescribeStream(software.amazon.awssdk.awscore.exception.AwsServiceException ase) Transforms Amazon DynamoDB Streams exceptions to compatible Amazon Kinesis exceptions for the DescribeStream API.The following transformations are applied:
(1) InternalServerError
Amazon DynamoDB Streams:InternalServerErrorException
Amazon Kinesis:com.amazonaws.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:AwsServiceException
with ErrorCode "ThrottlingException"
Amazon Kinesis:LimitExceededException
Notes: N/A- Parameters:
ase
- The Amazon DynamoDB Streams exception thrown by a DescribeStream call- Returns:
- A compatible Amazon Kinesis DescribeStream exception
-
transformDynamoDBStreamsToKinesisGetRecords
public static software.amazon.awssdk.awscore.exception.AwsServiceException transformDynamoDBStreamsToKinesisGetRecords(software.amazon.awssdk.awscore.exception.AwsServiceException ase, AmazonDynamoDBStreamsAdapterClient.SkipRecordsBehavior skipRecordsBehavior) Transforms Amazon DynamoDB Streams exceptions to compatible Amazon Kinesis exceptions for the GetRecords API.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:AwsServiceException
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:AwsServiceException
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, anUnableToReadMoreRecordsException
is thrown.- Parameters:
ase
- The Amazon DynamoDB Streams exception thrown by a GetRecords callskipRecordsBehavior
- TheAmazonDynamoDBStreamsAdapterClient.SkipRecordsBehavior
for the adapter- Returns:
- A compatible Amazon Kinesis GetRecords exception
-
transformDynamoDBStreamsToKinesisGetShardIterator
public static software.amazon.awssdk.awscore.exception.AwsServiceException transformDynamoDBStreamsToKinesisGetShardIterator(software.amazon.awssdk.awscore.exception.AwsServiceException ase, AmazonDynamoDBStreamsAdapterClient.SkipRecordsBehavior skipRecordsBehavior) Transforms Amazon DynamoDB Streams exceptions to compatible Amazon Kinesis exceptions for the GetShardIterator API.The following transformations are applied:
(1) InternalServerError
Amazon DynamoDB Streams:InternalServerErrorException
Amazon Kinesis:AwsServiceException
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 anUnableToReadMoreRecordsException
(3) ThrottlingException
Amazon DynamoDB Streams:AwsServiceException
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, anUnableToReadMoreRecordsException
is thrown.- Parameters:
ase
- The Amazon DynamoDB Streams exception thrown by a GetRecords callskipRecordsBehavior
- TheAmazonDynamoDBStreamsAdapterClient.SkipRecordsBehavior
for the adapter- Returns:
- A compatible Amazon Kinesis GetRecords exception
-
transformDynamoDBStreamsToKinesisListStreams
public static software.amazon.awssdk.awscore.exception.AwsServiceException transformDynamoDBStreamsToKinesisListStreams(software.amazon.awssdk.awscore.exception.AwsServiceException ase) Transforms Amazon DynamoDB Streams exceptions to compatible Amazon Kinesis exceptions for the ListStreams API.The following transformations are applied:
(1) InternalServerError
Amazon DynamoDB Streams:InternalServerErrorException
Amazon Kinesis:AwsServiceException
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:AwsServiceException
with ErrorCode "ThrottlingException"
Amazon Kinesis:LimitExceededException
Notes: N/A- Parameters:
ase
- The Amazon DynamoDB Streams exception thrown by a ListStreams call- Returns:
- A compatible Amazon Kinesis ListStreams exception
-