-
Notifications
You must be signed in to change notification settings - Fork 207
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
Add actor state TTL support. #1060
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Artur Souza <[email protected]>
Signed-off-by: Artur Souza <[email protected]>
Signed-off-by: Artur Souza <[email protected]>
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.
lgtm
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.
@artursouza looks great!
I have a more general design question related to ActorState. ActorState uses a generic type, however in ActorStateManager it is used without generic type. I am wondering if we should try to enforce generic type usage across other classes like: AbstractActor, StateChangeMetadata, ActorStateOperation, etc to ensure a stronger type safety.
What are your thoughts?
sdk-actors/src/main/java/io/dapr/actors/runtime/ActorStateManager.java
Outdated
Show resolved
Hide resolved
@@ -309,15 +345,26 @@ private static final class StateChangeMetadata { | |||
*/ | |||
private final Object value; |
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 am wondering if value
shouldn't be of type T
just like in ActorState
, otherwise we are loosing some compiler safety.
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.
It does not need because this is only to serialize and not to be deserialized.
Let me give it a try. These are not exposed to the user and are for internal use only. There might be a reason I did not propagate the generic type everywhere, but I don't remember now. Again, let me revisit this. |
Signed-off-by: Artur Souza <[email protected]>
Signed-off-by: Artur Souza <[email protected]>
Signed-off-by: Artur Souza <[email protected]>
See my reply. This is not needed because it is used for serialization and does not interface with the user's API. |
@artursouza could you please check the compilation failures for SB 3.2 and SB 3.3, once those are resolved. I think we are good to merge the PR. Thank you! |
Description
Add actor state TTL support.
Issue reference
We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.
Please reference the issue this PR will close: #849
Checklist
Please make sure you've completed the relevant tasks for this PR, out of the following list: