Repository navigation
refactor: move configuration, secrets, lock and metadata out of DaprClientImpl - #1915
Conversation
…lientImpl Signed-off-by: Javier Aliaga <javier@diagrid.io>
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain, and the refactoring preserves the existing public API through focused client implementations and delegation.
No open issues 🎉
What changed in this PR
This pull request continues the internal decomposition of DaprClientImpl by moving secrets, distributed lock, configuration, and metadata implementations into dedicated package-private clients while preserving the existing public API and behavior.
Changes:
- Added dedicated clients for secrets, locks, configuration, and metadata operations.
- Moved metadata response mapping and related helper methods into
DaprMetadataClient. - Replaced the corresponding
DaprClientImplimplementations with one-line delegates.
| File | Description |
|---|---|
| sdk/src/main/java/io/dapr/client/DaprSecretsClient.java | Implements secret and bulk-secret gRPC operations. |
| sdk/src/main/java/io/dapr/client/DaprMetadataClient.java | Implements metadata retrieval and gRPC response mapping. |
| sdk/src/main/java/io/dapr/client/DaprLockClient.java | Implements distributed lock and unlock operations. |
| sdk/src/main/java/io/dapr/client/DaprConfigurationClient.java | Implements configuration retrieval, subscription, and unsubscription. |
| sdk/src/main/java/io/dapr/client/DaprClientImpl.java | Initializes the new clients and delegates the corresponding public methods. |
Review effort: Lite
There was a problem hiding this comment.
❤️ @javier-aliaga please take a look at coverage.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #1915 +/- ##
============================================
- Coverage 82.67% 82.66% -0.01%
- Complexity 3954 3966 +12
============================================
Files 355 359 +4
Lines 11941 11965 +24
Branches 1339 1339
============================================
+ Hits 9872 9891 +19
- Misses 1561 1567 +6
+ Partials 508 507 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Description
Eighth step of splitting
DaprClientImplinto package-private classes, one per building block. This PR moves the secrets, distributed lock, configuration and metadata APIs.DaprSecretsClient:getSecret,getBulkSecretDaprLockClient:tryLock,unlock(alpha)DaprConfigurationClient: get, subscribe and unsubscribe configurationDaprMetadataClient:getMetadataand the mapping of its gRPC response toDaprMetadataDaprClientImplkeep their signatures and Javadoc, and delegate in one line.DaprClientImplgoes from 1,339 to 983 lines.Issue reference
Part of #1875
Checklist
DaprClientGrpcTestandDaprPreviewClientGrpcTestcover these APIs through the public methods. The 670sdkunit tests pass unchanged.