-
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
Support distributed lock API #764
Conversation
Signed-off-by: crazyhzm <crazyhzm@gmail.com>
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.
@CrazyHZM
Thanks for this PR!! Added some comments. Please add E2E, example and it's validation for this api with both http and grpc. See the configuration api implementation for the Preview Client change if needed.
@CrazyHZM Please fix conflicts in the PR ... |
Signed-off-by: crazyhzm <crazyhzm@gmail.com> # Conflicts: # pom.xml
Signed-off-by: crazyhzm <crazyhzm@gmail.com>
Signed-off-by: crazyhzm <crazyhzm@gmail.com>
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.
Pretty close to be merged. Thanks.
/** | ||
* DistributedLockGrpcClient. | ||
*/ | ||
public class DistributedLockGrpcClient { |
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.
We don't need an example for both HTTP and gRPC since the SDK abstract that.
It would be great if the example was using the APIs to make something more useful, like leader election, for example.
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 has not been deleted for the time being, and new examples can be added in the future.
sdk/src/test/java/io/dapr/client/DaprPreviewClientGrpcTest.java
Outdated
Show resolved
Hide resolved
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.
Just small requests re: magic strings but not a blocker.
return Mono.just(UnlockResponseStatus.INTERNAL_ERROR); | ||
} | ||
|
||
Integer statusCode = (Integer) m.get("status"); |
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.
Same here - can we make "status"
a constant so it's guaranteed to be consistent anywhere it gets used?
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.
For the time being, only the lock api is in use, and if there is a scene in the future, it will be extracted
Signed-off-by: crazyhzm <crazyhzm@gmail.com>
Signed-off-by: crazyhzm <crazyhzm@gmail.com> # Conflicts: # sdk/src/main/java/io/dapr/client/AbstractDaprClient.java # sdk/src/main/java/io/dapr/client/DaprClientGrpc.java # sdk/src/main/java/io/dapr/client/DaprClientHttp.java # sdk/src/main/java/io/dapr/client/DaprPreviewClient.java # sdk/src/test/java/io/dapr/client/DaprPreviewClientGrpcTest.java # sdk/src/test/java/io/dapr/client/DaprPreviewClientHttpTest.java
Signed-off-by: crazyhzm <crazyhzm@gmail.com>
@mukundansundar @artursouza - Is this ready for review? |
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
91472c9
to
a32bc85
Compare
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #764 +/- ##
============================================
- Coverage 76.47% 76.04% -0.44%
- Complexity 1398 1427 +29
============================================
Files 132 135 +3
Lines 4264 4399 +135
Branches 497 514 +17
============================================
+ Hits 3261 3345 +84
- Misses 743 776 +33
- Partials 260 278 +18
☔ View full report in Codecov by Sentry. |
Description
Please explain the changes you've made
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: #747
Checklist
Please make sure you've completed the relevant tasks for this PR, out of the following list: