Class AsyncBatchGetBuilder<T>
java.lang.Object
dev.hogwai.dynamodb.simplified.builder.base.AbstractBatchGetBuilder<T, AsyncBatchGetBuilder<T>>
dev.hogwai.dynamodb.simplified.async.AsyncBatchGetBuilder<T>
- Type Parameters:
T- the item type
Builds an async batch get operation to retrieve multiple items from a single table by their keys.
Obtain via AsyncTable.batchGet(). The default execute() path uses the
async enhanced client and completes after its pages have been collected; projection
execution uses the low-level client and executeWithPagination() returns one page.
-
Field Summary
Fields inherited from class AbstractBatchGetBuilder
consistentRead, keys, projectionExpression, returnConsumedCapacity -
Method Summary
Modifier and TypeMethodDescription@NonNull CompletableFuture<BatchGetResult<T>> execute()Executes the batch get operation asynchronously and returns all matching items aggregated from all pages.@NonNull CompletableFuture<PagedResult<T>> Executes the batch get operation and returns only the first page of results.protected AsyncBatchGetBuilder<T> self()Returnsthistyped asSfor fluent chaining.protected @NonNull StringReturns the DynamoDB table name.Methods inherited from class AbstractBatchGetBuilder
addKey, addKey, addKeys, buildKeysAndAttributes, consistentRead, keys, project, project, returnConsumedCapacity
-
Method Details
-
self
Description copied from class:AbstractBatchGetBuilderReturnsthistyped asSfor fluent chaining.- Specified by:
selfin classAbstractBatchGetBuilder<T, AsyncBatchGetBuilder<T>>- Returns:
- this builder
-
tableName
Description copied from class:AbstractBatchGetBuilderReturns the DynamoDB table name.- Specified by:
tableNamein classAbstractBatchGetBuilder<T, AsyncBatchGetBuilder<T>>- Returns:
- the DynamoDB table name
-
execute
Executes the batch get operation asynchronously and returns all matching items aggregated from all pages.- Returns:
- a
CompletableFuturecontaining theBatchGetResult - Throws:
IllegalArgumentException- if more than 100 keys are provided
-
executeWithPagination
Executes the batch get operation and returns only the first page of results.Since batch get does not use traditional cursor-based pagination, the last evaluated key is always
null. Unprocessed keys are not exposed by the returnedPagedResult; useexecute()to access them.- Returns:
- a
CompletableFuturecontaining aPagedResultwith items from the first response page - Throws:
IllegalStateException- if a projection is configured; useexecute()instead
-