-
Notifications
You must be signed in to change notification settings - Fork 121
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 a wrapper to manage IPC and RPC clients and revise the statement about RPC client in documentation #1629
Conversation
cd8a838
to
3440901
Compare
from vineyard._C import _connect | ||
|
||
|
||
class ClientManager: |
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.
ClientManager -> Client.
You could rename the existing Client
to IPCClient
(only in python/client.cc).
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.
Updated.
0c2aaf0
to
1c0593f
Compare
1c0593f
to
4176930
Compare
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.
Please address these "Either all return statements in a function should return an expression, or none of them should." warnings.
@@ -0,0 +1,81 @@ | |||
#! /usr/bin/env python |
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.
I cannot see if there are any cases that can be covered by this test file but cannot be covered by existing test cases.
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.
Actually, the main purpose of this test is to get the same data from different vineyard nodes with different clients.
ipc client1 put vineyard instance 1/ vineyard instance 2/ vineyard instance 3 -> obj1/obj2/obj3
rpc client1 put vineyard instance 1/ vineyard instance 2/ vineyard instance 3 -> obj4/obj5/obj6
test:
rpc client1 get obj1/obj2/obj3 == obj1/obj2/obj3
ipc client1 get obj4/obj5/obj6 == obj4/obj5/obj6
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.
Move the test case to https://github.com/v6d-io/v6d/blob/main/python/vineyard/deploy/tests/test_distributed.py
python/vineyard/core/resolver.py
Outdated
|
||
if resolver is None: | ||
resolver = get_current_resolvers() | ||
return resolver(obj, __vineyard_client=client, **kw) | ||
|
||
|
||
setattr(IPCClient, 'get', get) | ||
setattr(RPCClient, 'get', get) |
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.
Keep the original bindings as well.
python/vineyard/core/client.py
Outdated
"Failed to resolve IPC socket or RPC endpoint of vineyard server from " | ||
"environment variables VINEYARD_IPC_SOCKET or VINEYARD_RPC_ENDPOINT." | ||
) | ||
return self |
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.
Please put contents in connect()
to __init__()
to make it more Pythonic.
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.
Done.
f994a3d
to
4e16f22
Compare
Signed-off-by: Ye Cao <[email protected]>
Signed-off-by: Ye Cao <[email protected]>
…expression, or none of them should.' warnings. Signed-off-by: Ye Cao <[email protected]>
…ibuted.py Signed-off-by: Ye Cao <[email protected]>
Signed-off-by: Ye Cao <[email protected]>
Signed-off-by: Ye Cao <[email protected]>
Signed-off-by: Ye Cao <[email protected]>
6394de0
to
ab80852
Compare
Signed-off-by: Tao He <[email protected]>
ab80852
to
c1cbc01
Compare
Signed-off-by: Tao He <[email protected]>
Signed-off-by: Tao He <[email protected]>
Signed-off-by: Tao He <[email protected]>
Signed-off-by: Tao He <[email protected]>
What do these changes do?