-
Notifications
You must be signed in to change notification settings - Fork 278
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
AWS SDK v1 DynamoDB backend #142
AWS SDK v1 DynamoDB backend #142
Conversation
Hello @akhomchenko Do not worry. Efforts from It was just a technical decision to use |
According to this request: I will merge it to ```7.0```` during the holidays. Thank you for your work. |
8ef57c1
to
e3065e6
Compare
@ akhomchenko hello, I am going to review and merge this request. Did you finalize all planned works? |
Hey, sorry for the delay.
I have update with documentation + extra safe guards locally. I will publish it by EOD for review. There are some things that I am not sure about and I want to hear your opinion as you are a lead maintainer. I want to test it in personal AWS account during this weekend but that should not affect the review. |
Ok. Just do not forget to remove WIP prefix when finishing. |
e3065e6
to
6418c71
Compare
Updated. I left some comments and questions as TODOs and will add some as inline comments. I used CFN template I specified in javadoc to create a table and used that table in |
<dependency> | ||
<groupId>com.amazonaws</groupId> | ||
<artifactId>aws-java-sdk-bom</artifactId> | ||
<version>1.11.913</version> |
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.
Unfortunately I can not specify range for dependencyManagement
so I am not sure what is the best path forward. My idea was to specify 1.11.913 <2.0 range to support updates. I can update pom.xml
to not use dependencyManagement
and just specify range on a dependency.
} | ||
|
||
AttributeValue state = result.get(stateAttr); | ||
if (state.getB() == null) { |
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.
This is the first place I have a question for. So in my initial implementation I was returning empty optional here as I was not sure if throwing an exception from get
is something that can be expected (method does not define if exception can be thrown if state is broken).
I switched to throwing as there is no possibility for code to succeed if state attribute has type different from NULL
or B
.
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.
This method does not support NULL
value for state
as from current logic NULL
should never be written, but I can update code to support it.
By "current logic NULL
should never be written" I mean I assume that getModifiedStateBytes
of GenericEntry
will not return null
. Is it a case?
int length = key.getBytes(StandardCharsets.UTF_8).length; | ||
if (length > MAX_SUPPORTED_LENGTH) { | ||
throw new IllegalArgumentException( | ||
"key " + key + " has length of " + length + " bytes " + | ||
"while max allowed is " + MAX_SUPPORTED_LENGTH + " bytes" | ||
); | ||
} |
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 added this check in updated revision to provide better message. If you think that it is not worth the trouble and / or expensive to do I can drop it. DynamoDB will throw it's own exception.
6418c71
to
f47bee8
Compare
Backend supports 2 key types: string and number (only long for now). Backend is based on compare and swap and relies on DynamoDB's condition expression to guarantee consistency.
f47bee8
to
1f8b3af
Compare
Oh wow, that was fast! Thank you for accepting my contribution! Could you please take a look on questions I left in this PR? I will do some follow-up fixed based on your feedback if necessary. I am mostly interested if |
I will answer your questions at weekend |
Good evening.
Thank you a lot for awesome library. It looks really cool.
I wanted to use it for one of my projects and noticed lack of most common backend I use - AWS DynamoDB. At the time I've forked the code there was no
6.0
branch and so I based my code on5.0
branch which had a lot of helpful abstract classes. Implementation was really simple.Given that there is
6.0
that does not contain changes from5.0
I have couple of questions:5.0
abandoned and will not be merged tomaster
?master
/6.0
?General questions:
Notes:
Thank you and happy holidays!