Class AsyncBatchWriteBuilder<T>
java.lang.Object
dev.hogwai.dynamodb.simplified.builder.base.AbstractBatchWriteBuilder<T, AsyncBatchWriteBuilder<T>>
dev.hogwai.dynamodb.simplified.async.AsyncBatchWriteBuilder<T>
- Type Parameters:
T- the item type
public class AsyncBatchWriteBuilder<T>
extends AbstractBatchWriteBuilder<T, AsyncBatchWriteBuilder<T>>
Builds an async batch write operation to put and delete multiple items in a single table.
Obtain via AsyncTable.batchWrite(). Executes using the async enhanced client and
returns a CompletableFuture that completes with the batch write result.
A single batch write can contain up to 25 put and delete operations combined. Unprocessed items are automatically retried with exponential backoff (up to 3 retries).
-
Field Summary
Fields inherited from class AbstractBatchWriteBuilder
itemsToPut, keysToDelete, returnConsumedCapacity -
Method Summary
Modifier and TypeMethodDescription@NonNull CompletableFuture<BatchWriteResult> execute()Executes the batch write operation asynchronously.protected AsyncBatchWriteBuilder<T> self()Returnsthistyped asSfor fluent chaining.protected @NonNull StringReturns the DynamoDB table name.protected @NonNull software.amazon.awssdk.enhanced.dynamodb.TableSchema<T> Returns the table schema for converting items to attribute maps.Methods inherited from class AbstractBatchWriteBuilder
buildRequestItems, delete, delete, put, returnConsumedCapacity
-
Method Details
-
self
Description copied from class:AbstractBatchWriteBuilderReturnsthistyped asSfor fluent chaining.- Specified by:
selfin classAbstractBatchWriteBuilder<T, AsyncBatchWriteBuilder<T>>- Returns:
- this builder
-
tableSchema
Description copied from class:AbstractBatchWriteBuilderReturns the table schema for converting items to attribute maps.- Specified by:
tableSchemain classAbstractBatchWriteBuilder<T, AsyncBatchWriteBuilder<T>>- Returns:
- the table schema
-
tableName
Description copied from class:AbstractBatchWriteBuilderReturns the DynamoDB table name.- Specified by:
tableNamein classAbstractBatchWriteBuilder<T, AsyncBatchWriteBuilder<T>>- Returns:
- the DynamoDB table name
-
execute
Executes the batch write operation asynchronously.All puts and deletes added to this builder are sent in a single batch write request. Unprocessed items are automatically retried with exponential backoff (up to 3 retries).
- Returns:
- a
CompletableFuturecontaining theBatchWriteResult - Throws:
IllegalArgumentException- if more than 25 items (puts + deletes combined) are provided
-