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:
  • invalid reference
    DynamoDBMapper#batchWrite(List, List, DynamoDBMapperConfig)
  • invalid input: '<'
  • Method Details

    • getMaxRetryOnUnprocessedItems

      int getMaxRetryOnUnprocessedItems(Map<String,List<WriteRequest>> batchWriteItemInput)
      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 call
      retriesAttempted - The number of times we have attempted to resend UnprocessedItems.
      Returns:
      the delay (in milliseconds) before resending UnprocessedItems.