# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc

from . import MasterForData_pb2 as MasterForData__pb2


class MFDStub(object):
  """这是控制服务器Master为数据服务器Server提供的服务MFD的协议

  """

  def __init__(self, channel):
    """Constructor.

    Args:
      channel: A grpc.Channel.
    """
    self.RegisteServer = channel.unary_unary(
        '/MFD/RegisteServer',
        request_serializer=MasterForData__pb2.socket.SerializeToString,
        response_deserializer=MasterForData__pb2.Num.FromString,
        )
    self.Recommit = channel.unary_unary(
        '/MFD/Recommit',
        request_serializer=MasterForData__pb2.recommitRequest.SerializeToString,
        response_deserializer=MasterForData__pb2.recommitResponse.FromString,
        )


class MFDServicer(object):
  """这是控制服务器Master为数据服务器Server提供的服务MFD的协议

  """

  def RegisteServer(self, request, context):
    """服务：注册数据服务器
    请求：IP、端口
    返回：注册码
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def Recommit(self, request, context):
    """服务：二次提交
    请求：FID、CID、状态🏇
    返回：是否提交
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')


def add_MFDServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'RegisteServer': grpc.unary_unary_rpc_method_handler(
          servicer.RegisteServer,
          request_deserializer=MasterForData__pb2.socket.FromString,
          response_serializer=MasterForData__pb2.Num.SerializeToString,
      ),
      'Recommit': grpc.unary_unary_rpc_method_handler(
          servicer.Recommit,
          request_deserializer=MasterForData__pb2.recommitRequest.FromString,
          response_serializer=MasterForData__pb2.recommitResponse.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'MFD', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
