-
Notifications
You must be signed in to change notification settings - Fork 0
/
mykvserver_pb2_grpc.py
165 lines (148 loc) · 6.42 KB
/
mykvserver_pb2_grpc.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
import mykvserver_pb2 as mykvserver__pb2
class KVServerStub(object):
# missing associated documentation comment in .proto file
pass
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.Join = channel.unary_unary(
'/KVServer/Join',
request_serializer=mykvserver__pb2.JoinRequest.SerializeToString,
response_deserializer=mykvserver__pb2.JoinResponse.FromString,
)
self.PutRequest = channel.unary_unary(
'/KVServer/PutRequest',
request_serializer=mykvserver__pb2.PutMessage.SerializeToString,
response_deserializer=mykvserver__pb2.PutReply.FromString,
)
self.GetRequest = channel.unary_unary(
'/KVServer/GetRequest',
request_serializer=mykvserver__pb2.GetMessage.SerializeToString,
response_deserializer=mykvserver__pb2.GetReply.FromString,
)
self.DelRequest = channel.unary_unary(
'/KVServer/DelRequest',
request_serializer=mykvserver__pb2.DelMessage.SerializeToString,
response_deserializer=mykvserver__pb2.DelReply.FromString,
)
self.VoteRequest = channel.unary_unary(
'/KVServer/VoteRequest',
request_serializer=mykvserver__pb2.VoteMessage.SerializeToString,
response_deserializer=mykvserver__pb2.VoteReply.FromString,
)
self.HeartBeat = channel.unary_unary(
'/KVServer/HeartBeat',
request_serializer=mykvserver__pb2.HBMessage.SerializeToString,
response_deserializer=mykvserver__pb2.HBReply.FromString,
)
self.SpreadLog = channel.unary_unary(
'/KVServer/SpreadLog',
request_serializer=mykvserver__pb2.LogMessage.SerializeToString,
response_deserializer=mykvserver__pb2.LogReply.FromString,
)
self.SpreadCommit = channel.unary_unary(
'/KVServer/SpreadCommit',
request_serializer=mykvserver__pb2.CommitMessage.SerializeToString,
response_deserializer=mykvserver__pb2.CommitReply.FromString,
)
class KVServerServicer(object):
# missing associated documentation comment in .proto file
pass
def Join(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def PutRequest(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetRequest(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def DelRequest(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def VoteRequest(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def HeartBeat(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def SpreadLog(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def SpreadCommit(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def add_KVServerServicer_to_server(servicer, server):
rpc_method_handlers = {
'Join': grpc.unary_unary_rpc_method_handler(
servicer.Join,
request_deserializer=mykvserver__pb2.JoinRequest.FromString,
response_serializer=mykvserver__pb2.JoinResponse.SerializeToString,
),
'PutRequest': grpc.unary_unary_rpc_method_handler(
servicer.PutRequest,
request_deserializer=mykvserver__pb2.PutMessage.FromString,
response_serializer=mykvserver__pb2.PutReply.SerializeToString,
),
'GetRequest': grpc.unary_unary_rpc_method_handler(
servicer.GetRequest,
request_deserializer=mykvserver__pb2.GetMessage.FromString,
response_serializer=mykvserver__pb2.GetReply.SerializeToString,
),
'DelRequest': grpc.unary_unary_rpc_method_handler(
servicer.DelRequest,
request_deserializer=mykvserver__pb2.DelMessage.FromString,
response_serializer=mykvserver__pb2.DelReply.SerializeToString,
),
'VoteRequest': grpc.unary_unary_rpc_method_handler(
servicer.VoteRequest,
request_deserializer=mykvserver__pb2.VoteMessage.FromString,
response_serializer=mykvserver__pb2.VoteReply.SerializeToString,
),
'HeartBeat': grpc.unary_unary_rpc_method_handler(
servicer.HeartBeat,
request_deserializer=mykvserver__pb2.HBMessage.FromString,
response_serializer=mykvserver__pb2.HBReply.SerializeToString,
),
'SpreadLog': grpc.unary_unary_rpc_method_handler(
servicer.SpreadLog,
request_deserializer=mykvserver__pb2.LogMessage.FromString,
response_serializer=mykvserver__pb2.LogReply.SerializeToString,
),
'SpreadCommit': grpc.unary_unary_rpc_method_handler(
servicer.SpreadCommit,
request_deserializer=mykvserver__pb2.CommitMessage.FromString,
response_serializer=mykvserver__pb2.CommitReply.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'KVServer', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))