-
Notifications
You must be signed in to change notification settings - Fork 180
refactor: 21915 Introduce StateLifecycleManager #21958
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
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
025556f to
11ae127
Compare
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferences |
cbc5f95 to
a7221b5
Compare
Signed-off-by: Ivan Malygin <[email protected]>
a7221b5 to
855bf5a
Compare
mhess-swl
left a comment
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 (Execution) 🙂
...platform-core/src/test/java/com/swirlds/platform/eventhandling/TransactionHandlerTester.java
Show resolved
Hide resolved
Signed-off-by: Ivan Malygin <[email protected]>
c80769f
platform-sdk/swirlds-state-api/src/main/java/com/swirlds/state/StateLifecycleManager.java
Outdated
Show resolved
Hide resolved
...sdk/swirlds-state-impl/src/main/java/com/swirlds/state/merkle/StateLifecycleManagerImpl.java
Outdated
Show resolved
Hide resolved
...sdk/swirlds-state-impl/src/main/java/com/swirlds/state/merkle/StateLifecycleManagerImpl.java
Show resolved
Hide resolved
...sdk/swirlds-state-impl/src/main/java/com/swirlds/state/merkle/StateLifecycleManagerImpl.java
Show resolved
Hide resolved
...sdk/swirlds-state-impl/src/main/java/com/swirlds/state/merkle/StateLifecycleManagerImpl.java
Show resolved
Hide resolved
...sdk/swirlds-state-impl/src/main/java/com/swirlds/state/merkle/StateLifecycleManagerImpl.java
Outdated
Show resolved
Hide resolved
...platform-core/src/main/java/com/swirlds/platform/components/DefaultSavedStateController.java
Outdated
Show resolved
Hide resolved
...sdk/swirlds-state-impl/src/main/java/com/swirlds/state/merkle/StateLifecycleManagerImpl.java
Outdated
Show resolved
Hide resolved
platform-sdk/swirlds-state-api/src/main/java/com/swirlds/state/MerkleNodeState.java
Outdated
Show resolved
Hide resolved
...sdk/swirlds-state-impl/src/main/java/com/swirlds/state/merkle/StateLifecycleManagerImpl.java
Show resolved
Hide resolved
...sdk/swirlds-state-impl/src/main/java/com/swirlds/state/merkle/StateLifecycleManagerImpl.java
Outdated
Show resolved
Hide resolved
...sdk/swirlds-state-impl/src/main/java/com/swirlds/state/merkle/StateLifecycleManagerImpl.java
Outdated
Show resolved
Hide resolved
...s-platform-core/src/main/java/com/swirlds/platform/state/snapshot/SignedStateFileWriter.java
Show resolved
Hide resolved
...s-platform-core/src/main/java/com/swirlds/platform/state/snapshot/SignedStateFileWriter.java
Show resolved
Hide resolved
platform-sdk/swirlds-state-api/src/main/java/com/swirlds/state/StateLifecycleManager.java
Show resolved
Hide resolved
platform-sdk/swirlds-state-api/src/main/java/com/swirlds/state/StateLifecycleManager.java
Show resolved
Hide resolved
...sdk/swirlds-state-impl/src/main/java/com/swirlds/state/merkle/StateLifecycleManagerImpl.java
Outdated
Show resolved
Hide resolved
...sdk/swirlds-state-impl/src/main/java/com/swirlds/state/merkle/StateLifecycleManagerImpl.java
Outdated
Show resolved
Hide resolved
...sdk/swirlds-state-impl/src/main/java/com/swirlds/state/merkle/StateLifecycleManagerImpl.java
Show resolved
Hide resolved
...sdk/swirlds-state-impl/src/main/java/com/swirlds/state/merkle/StateLifecycleManagerImpl.java
Outdated
Show resolved
Hide resolved
- got rid of `getRound` method - improved javadoc - added missing nullity annotations Signed-off-by: Ivan Malygin <[email protected]>
Signed-off-by: Ivan Malygin <[email protected]>
Signed-off-by: Ivan Malygin <[email protected]>
Addressed review comments: - improved javadocs - removed `synchronized` modifier from `initState` and `copyMutableState` Signed-off-by: Ivan Malygin <[email protected]>
Signed-off-by: Ivan Malygin <[email protected]>
...sdk/swirlds-state-impl/src/main/java/com/swirlds/state/merkle/StateLifecycleManagerImpl.java
Outdated
Show resolved
Hide resolved
- improved javadoc Signed-off-by: Ivan Malygin <[email protected]>
- improved javadoc - improved handling of destroyed states Signed-off-by: Ivan Malygin <[email protected]>
Signed-off-by: Ivan Malygin <[email protected]>
mhess-swl
left a comment
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.
Approved for Execution
Description:
This PR introduces
StateLifecycleManager, a class responsible for managing the lifecycle of a state:Highlights of changes:
VirtualMapState.newInstancemethod was replaced with a factory function (stateSupplier) passed as a constructor argument toStateLifecycleManagerImpl.State.loadSnapshotandState.createSnapshotwere migrated toStateLifecycleManager.StateLifecycleManageris a drop-in replacement forSwirldsStateManager.Related issue(s):
Fixes #21915
Notes for reviewer:
Even though
StateLifecycleManagercomes with acopyMutableStatemethod, and this method assumes that it's the ONLY way to create a copy of the state, usages ofState.copyare not yet eliminated to limit the scope of this PR. This will be done in the follow-up task: #21949