forked from vitessio/vitess
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprotocols_flavor.py
85 lines (60 loc) · 2.76 KB
/
protocols_flavor.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/usr/bin/env python
"""Base class for protocols flavor.
Each set of protocols has a flavor object. The current one is dynamically
imported once.
"""
class ProtocolsFlavor(object):
"""Base class for protocols flavor."""
def binlog_player_protocol(self):
"""The binlog player protocol between vttablets, in go."""
raise NotImplementedError('Not implemented in the base class')
def vtctl_client_protocol(self):
"""The protocol to use for vtctl connections.
This is just for the go client.
"""
raise NotImplementedError('Not implemented in the base class')
def vtctl_python_client_protocol(self):
"""The protocol to use for vtctl connections.
This is just for the python client.
"""
raise NotImplementedError('Not implemented in the base class')
def vtworker_client_protocol(self):
"""The protocol to use for vtworker connections."""
raise NotImplementedError('Not implemented in the base class')
def tablet_manager_protocol(self):
"""The protocol to use for the tablet manager protocol."""
raise NotImplementedError('Not implemented in the base class')
def tabletconn_protocol(self):
"""The protocol to use for connections from vtctl/vtgate to vttablet."""
raise NotImplementedError('Not implemented in the base class')
def throttler_client_protocol(self):
"""Client protocol for the resharding throttler.
This RPC interface is enabled in vtworker and vttablet.
"""
raise NotImplementedError('Not implemented in the base class')
def vtgate_protocol(self):
"""The protocol to use to talk to vtgate, in go."""
raise NotImplementedError('Not implemented in the base class')
def vtgate_python_protocol(self):
"""The protocol to use to talk to vtgate with python clients."""
raise NotImplementedError('Not implemented in the base class')
def client_error_exception_type(self):
"""The exception type the RPC client implementation returns for errors."""
raise NotImplementedError('Not implemented in the base class')
def rpc_timeout_message(self):
"""The error message used by the protocol to indicate a timeout."""
raise NotImplementedError('Not implemented in the base class')
def service_map(self):
"""A list of entries to enable all relevant protocols in all servers."""
raise NotImplementedError('Not implemented in the base class')
def vttest_protocol(self):
"""Python protocol to use to talk to a vttest client."""
raise NotImplementedError('Not implemented in the base class')
_protocols_flavor = None
def protocols_flavor():
"""Returns the current ProtocolsFlavor object."""
return _protocols_flavor
def set_protocols_flavor(flavor):
"""Set the protocols flavor implementation."""
global _protocols_flavor
_protocols_flavor = flavor