-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Scanning with returnConsumedCapacity returns PaginatedScanList which does not surface consumedCapacity #2707
Comments
Hi @christi-square thank you for reaching out. We had a pretty similar request (#1170) for load, save and delete item. We ended up implementing those in the Java SDK v2 DynamoDB Enhanced Client, not in the V1 DynamoDB Mapper. This request will probably have the same path, since we are prioritizing work for SDK V2. Scan does not return consumedCapacity currently, so it would be a feature request too. Let us know if you'd like to open a feature request in Java SDK v2 for this. |
Hmm, I didn't realize there was a v2. Yes, that would be great if you could open a ticket there. I don't know when I'll be able to upgrade to v2 to get sample code but if I can manage it soon, I will provide an example. |
We don't have plans to add this to v1 before going into Maintenance Mode. ConsumedCapacity is supported in query and scan responses in the v2 DynamoDB Enhanced Client. Please migrate to Java SDK v2 if you have a chance, and open a new issue in the v2 repo with questions or feedbacks. Reference:
|
This issue is now closed. Comments on closed issues are hard for our team to see. |
Describe the bug
I am using
DynamoDBMapper.scan(Class<T>, DynamoDBScanExpression)
which returns aPaginatedScanList
. When I create the scan expression, if I setreturnConsumedCapacity
, there is no way to get the value of the consumed capacity because it is hidden in a private field and not surfaced.Expected behavior
I expected that I would be able to read
consumedCapacity
from the result of the scan.Current behavior
The result of the scan is hidden in a private variable and
consumedCapacity
is not surfaced. If I debug and look at private variables, I can see the consumed capacity is set:Steps to Reproduce
Possible Solution
I think the
PaginatedScanList
class should surface aconsumedCapacity
property which returns the sum ofconsumedCapacity
from eachscanResult
fetched. So, the total consumed capacity thus far would be returned.Context
I wanted to report on consumed capacity for a job I am writing so we can estimate costs.
AWS Java SDK version used
aws-java-sdk-dynamodb-1.12.131.jar
JDK version used
openjdk version "11.0.9" 2020-10-20 / OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.9+11) / OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.9+11, mixed mode)
Operating System and version
MacOS Monterey 12.1
The text was updated successfully, but these errors were encountered: