DynamoDbEnhancedClient allow to request to return capacity on all data plane operations
Describe the feature
https://github.com/aws/aws-sdk-java-v2/issues/2095 added ReturnConsumedCapacity for putItem, updateItem and deleteItem operations, but other Data plane operations should allow you to request to return consumed capacity as offered by the DynamoDB API on their (paged) return.
This should include the following Data plane operations:
- DynamoDbEnhancedClient.batchGetItem
- DynamoDbEnhancedClient.batchWriteItem
- DynamoDbEnhancedClient.transactGetItems
- DynamoDbEnhancedClient.transactWriteItems
- DynamoDbTable.getitem
- DynamoDbTable.query
- DynamoDbTable.scan
Use Case
Common scenario is to request to the DynamoDB API to return the consumed capacity to log or debug the read or write capacity used by the data plane operation.
Proposed Solution
Continue by adding functionality introduced in https://github.com/aws/aws-sdk-java-v2/issues/2095 by either adding *WithResponse methods to these classes or extend the existing response objects to include the consumed capacity.
Other Information
No response
Acknowledgements
- [X] I may be able to implement this feature request
- [ ] This feature might incur a breaking change
AWS Java SDK version used
2.20.88
JDK version used
OpenJDK Runtime Environment Corretto-20.0.1.9.1 (build 20.0.1+9-FR)
Operating System and version
macOS Ventura 13.4
That's fair, feature request acknowledged.
Community note: please show your support by adding a 👍 to the original description above to help us prioritize this request.
Quick update:
ReturnConsumedCapacity is now supported by :
Query and Scan now support ConsumedCapacity too, since version 2.20.153 (via #4444).
Query and Scan now support
ConsumedCapacitytoo, since version2.20.153(via #4444).
Hi @debora-ito - Any plans on supporting BatchWriteItem and TransactWriteItem in the future?
Query and Scan now support
ConsumedCapacitytoo, since version2.20.153(via #4444).Hi @debora-ito - Any plans on supporting BatchWriteItem and TransactWriteItem in the future?
I can take a stab at it, if this has not been implemented yet
Here's a PR for supporting ConsumedCapacity in BatchWriteItems and TransactWriteItems https://github.com/aws/aws-sdk-java-v2/pull/5462
Hi @debora-ito I reviewed the SDK code and relevant pull requests, and it appears that all operations have been progressively enhanced to support returning capacity when requested. These include:
- DynamoDbEnhancedClient.batchGetItem
- DynamoDbEnhancedClient.batchWriteItem
- DynamoDbEnhancedClient.transactGetItems
- DynamoDbEnhancedClient.transactWriteItems
- DynamoDbTable.getItem
- DynamoDbTable.query
- DynamoDbTable.scan
Given that this functionality is now implemented across all relevant operations, I believe this task can be closed as there are no further changes required.
Indeed, all operations now support ConsumedCapacity in the response. Closing.
This issue is now closed. Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one.