|
1 | 1 | from ydb import _apis, issues |
2 | | -from ydb._grpc.grpcwrapper.ydb_coordination_public_types import NodeConfig, NodeDescription |
| 2 | +from ydb._grpc.grpcwrapper.ydb_coordination_public_types import NodeConfig, DescribeResult |
| 3 | +import logging |
3 | 4 |
|
4 | 5 |
|
5 | | -def wrapper_create_node(rpc_state, response_pb, client: "BaseCoordinationClient"): |
| 6 | +logger = logging.getLogger(__name__) |
| 7 | + |
| 8 | + |
| 9 | +def wrapper_create_node(rpc_state, response_pb): |
6 | 10 | issues._process_response(response_pb.operation) |
7 | 11 |
|
8 | 12 |
|
9 | | -def wrapper_describe_node(rpc_state, response_pb, client: "BaseCoordinationClient", path: str) -> NodeDescription: |
| 13 | +def wrapper_describe_node(rpc_state, response_pb) -> NodeConfig: |
10 | 14 | issues._process_response(response_pb.operation) |
11 | | - return NodeDescription.from_proto(path, response_pb) |
| 15 | + return DescribeResult.from_proto(response_pb) |
12 | 16 |
|
13 | 17 |
|
14 | | -def wrapper_delete_node(rpc_state, response_pb, client: "BaseCoordinationClient"): |
| 18 | +def wrapper_delete_node(rpc_state, response_pb): |
15 | 19 | issues._process_response(response_pb.operation) |
16 | 20 |
|
17 | 21 |
|
18 | | -def wrapper_alter_node(rpc_state, response_pb, client: "BaseCoordinationClient"): |
| 22 | +def wrapper_alter_node(rpc_state, response_pb): |
19 | 23 | issues._process_response(response_pb.operation) |
20 | 24 |
|
21 | 25 |
|
22 | 26 | class BaseCoordinationClient: |
23 | 27 | def __init__(self, driver): |
| 28 | + logger.warning("Experimental API: interface may change in future releases.") |
24 | 29 | self._driver = driver |
25 | 30 |
|
26 | | - def _call_create(self, request, settings=None, wrap_args=None): |
| 31 | + def _call_create(self, request, settings=None): |
27 | 32 | return self._driver( |
28 | 33 | request, |
29 | 34 | _apis.CoordinationService.Stub, |
30 | 35 | _apis.CoordinationService.CreateNode, |
31 | 36 | wrap_result=wrapper_create_node, |
32 | | - wrap_args=wrap_args, |
33 | 37 | settings=settings, |
34 | 38 | ) |
35 | 39 |
|
36 | | - def _call_describe(self, request, settings=None, wrap_args=None): |
| 40 | + def _call_describe(self, request, settings=None): |
37 | 41 | return self._driver( |
38 | 42 | request, |
39 | 43 | _apis.CoordinationService.Stub, |
40 | 44 | _apis.CoordinationService.DescribeNode, |
41 | 45 | wrap_result=wrapper_describe_node, |
42 | | - wrap_args=wrap_args, |
43 | 46 | settings=settings, |
44 | 47 | ) |
45 | 48 |
|
46 | | - def _call_alter(self, request, settings=None, wrap_args=None): |
| 49 | + def _call_alter(self, request, settings=None): |
47 | 50 | return self._driver( |
48 | 51 | request, |
49 | 52 | _apis.CoordinationService.Stub, |
50 | 53 | _apis.CoordinationService.AlterNode, |
51 | 54 | wrap_result=wrapper_alter_node, |
52 | | - wrap_args=wrap_args, |
53 | 55 | settings=settings, |
54 | 56 | ) |
55 | 57 |
|
56 | | - def _call_delete(self, request, settings=None, wrap_args=None): |
| 58 | + def _call_delete(self, request, settings=None): |
57 | 59 | return self._driver( |
58 | 60 | request, |
59 | 61 | _apis.CoordinationService.Stub, |
60 | 62 | _apis.CoordinationService.DropNode, |
61 | 63 | wrap_result=wrapper_delete_node, |
62 | | - wrap_args=wrap_args, |
63 | 64 | settings=settings, |
64 | 65 | ) |
0 commit comments