Skip to content
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

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open

Conversation

artursouza
Copy link
Member

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:

  • Code compiles correctly
  • Created/updated tests
  • Extended the documentation

@artursouza artursouza requested review from a team as code owners June 26, 2024 14:48
@artursouza artursouza marked this pull request as draft June 26, 2024 14:48
Signed-off-by: Artur Souza <[email protected]>
@artursouza artursouza marked this pull request as ready for review June 26, 2024 18:07
cicoyle
cicoyle previously approved these changes Jun 27, 2024
Copy link
Contributor

@cicoyle cicoyle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Contributor

@artur-ciocanu artur-ciocanu left a 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?

@@ -309,15 +345,26 @@ private static final class StateChangeMetadata {
*/
private final Object value;
Copy link
Contributor

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.

Copy link
Member Author

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.

sdk-tests/components/actorstatestore.yaml Outdated Show resolved Hide resolved
@artursouza
Copy link
Member Author

@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?

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.

@mikeee mikeee mentioned this pull request Jun 28, 2024
artursouza and others added 2 commits November 15, 2024 09:46
Signed-off-by: Artur Souza <[email protected]>
@artursouza
Copy link
Member Author

@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?

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.

See my reply. This is not needed because it is used for serialization and does not interface with the user's API.

@artur-ciocanu
Copy link
Contributor

@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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FEATURE PREVIEW: Add Actor State TTL support
3 participants