Repository navigation
refactor: move state management out of DaprClientImpl - #1902
Merged
dapr-bot merged 2 commits intoNov 12, 2026
Merged
Conversation
Move getState, getBulkState, saveBulkState, deleteState, executeStateTransaction, queryState and their proto mapping into a package-private DaprStateClient class. The public methods on DaprClientImpl keep their signatures and delegate to it. No public API change. Part of dapr#1875 Signed-off-by: Javier Aliaga <javier@diagrid.io>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are identified for this focused extraction of state-management responsibilities.
No open issues 🎉
What changed in this PR
This PR extracts state-management functionality from DaprClientImpl into a package-private DaprStateClient, preserving the public API and behavior while reducing the implementation class size.
Changes:
- Added
DaprStateClientfor state retrieval, persistence, deletion, transactions, queries, and protobuf mappings. - Updated
DaprClientImplto initialize the state client and delegate the existing public state APIs. - Qualified the shared
JSON_REQUEST_MAPPERreference inqueryState.
| File | Description |
|---|---|
sdk/src/main/java/io/dapr/client/DaprStateClient.java |
Contains the extracted state-management operations, request construction, gRPC calls, serialization, and response mapping. |
sdk/src/main/java/io/dapr/client/DaprClientImpl.java |
Initializes DaprStateClient and delegates the existing public state methods. |
Review effort: Lite
javier-aliaga
marked this pull request as ready for review
November 9, 2026 10:57
Contributor
|
@javier-aliaga looks great, please fix the conflicts and we are good to go. |
Signed-off-by: artur-ciocanu <artur.ciocanu@gmail.com>
artur-ciocanu
self-requested a review
November 12, 2026 03:47
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1902 +/- ##
============================================
+ Coverage 81.92% 81.93% +0.01%
- Complexity 3644 3651 +7
============================================
Files 329 330 +1
Lines 11340 11351 +11
Branches 1290 1290
============================================
+ Hits 9290 9301 +11
Misses 1556 1556
Partials 494 494 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
4 of 8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Third step of splitting
DaprClientImplinto package-private classes, one per building block. This PR moves state management.DaprStateClientholdsgetState,getBulkState,saveBulkState,deleteState,executeStateTransaction,queryStateand their proto mapping. The bodies are unchanged.queryStateusedJSON_REQUEST_MAPPERinherited fromAbstractDaprClient, and now names itAbstractDaprClient.JSON_REQUEST_MAPPER. It is the same static field.DaprClientImplkeep their signatures and Javadoc, and delegate in one line.DaprClientImplgoes from 2,299 to 1,953 lines.Issue reference
Part of #1875
Checklist
DaprClientGrpcTestcovers state through the public methods. The 593sdkunit tests pass unchanged.