Interface DynamoDBMapperConfig.BatchWriteRetryStrategy
- All Known Implementing Classes:
DynamoDBMapperConfig.DefaultBatchWriteRetryStrategy
- Enclosing class:
- DynamoDBMapperConfig
public static interface DynamoDBMapperConfig.BatchWriteRetryStrategy
DynamoDBMapper#batchWrite takes arbitrary number of save/delete requests
and breaks them into smaller chunks that can be accepted by the service
API. Each chunk will be sent to DynamoDB via the BatchWriteItem API, and
if it fails because the table's provisioned throughput is exceeded or an
internal processing failure occurs, the failed requests are returned in
the UnprocessedItems response parameter. This interface allows you to
control the retry strategy when such scenario occurs.
- See Also:
-
DynamoDBMapper#batchWrite(List, List, DynamoDBMapperConfig)
- invalid input: '<ahref="http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_BatchWriteItem.html">DynamoDB service API reference -- BatchWriteItem</a>'
-
Method Summary
Modifier and TypeMethodDescriptionlong
getDelayBeforeRetryUnprocessedItems
(Map<String, List<WriteRequest>> unprocessedItems, int retriesAttempted) Returns the delay (in milliseconds) before retrying on UnprocessedItems.int
getMaxRetryOnUnprocessedItems
(Map<String, List<WriteRequest>> batchWriteItemInput) Returns the max number of retries to be performed if the service returns UnprocessedItems in the response.
-
Method Details
-
getMaxRetryOnUnprocessedItems
Returns the max number of retries to be performed if the service returns UnprocessedItems in the response.- Parameters:
batchWriteItemInput
- the one batch of write requests that is being sent to the BatchWriteItem API.- Returns:
- max number of retries to be performed if the service returns UnprocessedItems in the response, or a negative value if you want it to keep retrying until all the UnprocessedItems are fulfilled.
-
getDelayBeforeRetryUnprocessedItems
long getDelayBeforeRetryUnprocessedItems(Map<String, List<WriteRequest>> unprocessedItems, int retriesAttempted) Returns the delay (in milliseconds) before retrying on UnprocessedItems.- Parameters:
unprocessedItems
- the UnprocessedItems returned by the service in the last BatchWriteItem callretriesAttempted
- The number of times we have attempted to resend UnprocessedItems.- Returns:
- the delay (in milliseconds) before resending UnprocessedItems.
-