-
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
Return ConsumedCapacity in DynamoDBMapper's load(), save() and delete() methods #1170
Comments
How is the returned ConsumedCapacity used? Is this commonly used feature that requires integration into the SDK? |
ConsumedCapacity contains information about how much of provisioned read/write capacity has been consumed to execute the particular request to dynamodb. ConsumedCapacity could be used in variety of ways. In particular, I am going to use this data to adjust intensity of requests to DB and maintain the amount of consumed read/write capacity on the near to constant level. This technique allows more control and better load distribution than just making as many request as possible until having them throttled and then doing exponential back-off. It's been already integrated into SDK namely GetItemResult and UpdateItemResult contain ConsumedCapacity. It's just a problem with DynamoDBMapper that it ignores it. |
We are working on a v2 version of the SDK which we plan to release later this year. We are looking at making major changes in DynamoDBMapper. We can consider this feature request in the new version but we don't have bandwidth to add this feature to current dynamodb mapper. If you can send us a PR, we can certainly look at that. |
Hi @daniil-dubin, the SDK team has reviewed the feature request list for V1, and since they're concentrating efforts on V2 new features they decided to not implement this one in V1. It's still being considered for the DynamoDB Mapper refactor in V2, see the referenced issue above. I'll go ahead and close this. Please feel free to comment on the V2 issue with your use case, and reach out if you have further questions. |
Information about consumed capacity would be very handy to optimize the load on DB but it's not returned by
load()
,save()
anddelete()
methods of DynamoDBMapper. Even though underlying AmazonDynamoDBClient provides it, it's simply discarded.We can change
public <T> void delete(...)
into
public <T> ConsumedCapasity delete()
The question is how to modify
load()
andsave()
method's signature so that to enable return of consumed capacity.The alternatives are: an extra wrapper over result (extra GC pressure) or the overloaded version with listener (which is less comfortable to use).Any ideas what way to follow? Once decided I can contribute.
The text was updated successfully, but these errors were encountered: