-
Notifications
You must be signed in to change notification settings - Fork 856
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds count, scanned count and consumed capacity to DDB Enhanced Page #4444
Adds count, scanned count and consumed capacity to DDB Enhanced Page #4444
Conversation
ca21a0e
to
eb8220d
Compare
...tom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/model/Page.java
Outdated
Show resolved
Hide resolved
@@ -33,30 +36,47 @@ | |||
public final class Page<T> { | |||
private final List<T> items; | |||
private final Map<String, AttributeValue> lastEvaluatedKey; | |||
private final Integer count; | |||
private final Integer scannedCount; | |||
private final ConsumedCapacity consumedCapacity; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we can't just include a service response here since it could be QueryResponse and ScanResponse. :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we really wanted to, we could make it a metadata field, then we'd get
page.responseMetadata().count()
instead of
page.count()
.
I find the current version a more natural, but if DDB would add many more metadata fields we'd be glad we had a containing object. WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking about including the whole responsescanResponse
, so page.sdkResponse().count()
, but that doesn't seem to be possible.
SonarCloud Quality Gate failed. 0 Bugs 53.8% Coverage Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
Motivation and Context
This PR addresses the issue of missing metadata fields in the response of DDB Enhanced Scan and Query operations, as described in
In addition, this PR adds
Count
andScannedCount
to the response to aid users who want to understand the results of their queries.Scan and Query are paginated operations where each page is represented by a backend call to DDB. The consumed capacity and count metric metadata is specific per page; therefore this metadata is exposed to the user per page. The new response values are available on both table and index operations.
Modifications
EnhancedScanRequest
andEnhancedQueryRequest
ConsumedCapacity
to thePage
classCount
andScannedCount
to thePage
classTesting
Functional testing, integration testing
Screenshots (if appropriate)
Types of changes
Checklist
mvn install
succeedsscripts/new-change
script and following the instructions. Commit the new file created by the script in.changes/next-release
with your changes.License