# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc

import common_pb2 as common__pb2
import worker_to_trainer_pb2 as worker__to__trainer__pb2


class WorkerToTrainerStub(object):
    """Missing associated documentation comment in .proto file."""

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

        Args:
            channel: A grpc.Channel.
        """
        self.NewGroup = channel.unary_unary(
                '/WorkerToTrainer/NewGroup',
                request_serializer=worker__to__trainer__pb2.InitNewGroupRequest.SerializeToString,
                response_deserializer=common__pb2.Empty.FromString,
                )
        self.BroadcastFinish = channel.unary_unary(
                '/WorkerToTrainer/BroadcastFinish',
                request_serializer=common__pb2.Empty.SerializeToString,
                response_deserializer=common__pb2.Empty.FromString,
                )
        self.TrainingBegin = channel.unary_unary(
                '/WorkerToTrainer/TrainingBegin',
                request_serializer=common__pb2.Empty.SerializeToString,
                response_deserializer=common__pb2.Empty.FromString,
                )
        self.InitStandby = channel.unary_unary(
                '/WorkerToTrainer/InitStandby',
                request_serializer=worker__to__trainer__pb2.InitStandbyRequest.SerializeToString,
                response_deserializer=common__pb2.Empty.FromString,
                )
        self.KillActive = channel.unary_unary(
                '/WorkerToTrainer/KillActive',
                request_serializer=worker__to__trainer__pb2.KillActiveRequest.SerializeToString,
                response_deserializer=common__pb2.Empty.FromString,
                )
        self.KillTrainer = channel.unary_unary(
                '/WorkerToTrainer/KillTrainer',
                request_serializer=worker__to__trainer__pb2.KillTrainerRequest.SerializeToString,
                response_deserializer=common__pb2.Empty.FromString,
                )
        self.ProbeTrainer = channel.unary_unary(
                '/WorkerToTrainer/ProbeTrainer',
                request_serializer=common__pb2.Empty.SerializeToString,
                response_deserializer=common__pb2.Empty.FromString,
                )


class WorkerToTrainerServicer(object):
    """Missing associated documentation comment in .proto file."""

    def NewGroup(self, request, context):
        """init a new process group on trainer
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def BroadcastFinish(self, request, context):
        """broadcast finish message
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def TrainingBegin(self, request, context):
        """train begin message
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def InitStandby(self, request, context):
        """initialize a job on trainer (possibly start training)
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def KillActive(self, request, context):
        """kill the active workload job on trainer
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def KillTrainer(self, request, context):
        """kill the trainer
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ProbeTrainer(self, request, context):
        """probe the trainer server
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_WorkerToTrainerServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'NewGroup': grpc.unary_unary_rpc_method_handler(
                    servicer.NewGroup,
                    request_deserializer=worker__to__trainer__pb2.InitNewGroupRequest.FromString,
                    response_serializer=common__pb2.Empty.SerializeToString,
            ),
            'BroadcastFinish': grpc.unary_unary_rpc_method_handler(
                    servicer.BroadcastFinish,
                    request_deserializer=common__pb2.Empty.FromString,
                    response_serializer=common__pb2.Empty.SerializeToString,
            ),
            'TrainingBegin': grpc.unary_unary_rpc_method_handler(
                    servicer.TrainingBegin,
                    request_deserializer=common__pb2.Empty.FromString,
                    response_serializer=common__pb2.Empty.SerializeToString,
            ),
            'InitStandby': grpc.unary_unary_rpc_method_handler(
                    servicer.InitStandby,
                    request_deserializer=worker__to__trainer__pb2.InitStandbyRequest.FromString,
                    response_serializer=common__pb2.Empty.SerializeToString,
            ),
            'KillActive': grpc.unary_unary_rpc_method_handler(
                    servicer.KillActive,
                    request_deserializer=worker__to__trainer__pb2.KillActiveRequest.FromString,
                    response_serializer=common__pb2.Empty.SerializeToString,
            ),
            'KillTrainer': grpc.unary_unary_rpc_method_handler(
                    servicer.KillTrainer,
                    request_deserializer=worker__to__trainer__pb2.KillTrainerRequest.FromString,
                    response_serializer=common__pb2.Empty.SerializeToString,
            ),
            'ProbeTrainer': grpc.unary_unary_rpc_method_handler(
                    servicer.ProbeTrainer,
                    request_deserializer=common__pb2.Empty.FromString,
                    response_serializer=common__pb2.Empty.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'WorkerToTrainer', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class WorkerToTrainer(object):
    """Missing associated documentation comment in .proto file."""

    @staticmethod
    def NewGroup(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/WorkerToTrainer/NewGroup',
            worker__to__trainer__pb2.InitNewGroupRequest.SerializeToString,
            common__pb2.Empty.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def BroadcastFinish(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/WorkerToTrainer/BroadcastFinish',
            common__pb2.Empty.SerializeToString,
            common__pb2.Empty.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def TrainingBegin(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/WorkerToTrainer/TrainingBegin',
            common__pb2.Empty.SerializeToString,
            common__pb2.Empty.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def InitStandby(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/WorkerToTrainer/InitStandby',
            worker__to__trainer__pb2.InitStandbyRequest.SerializeToString,
            common__pb2.Empty.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def KillActive(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/WorkerToTrainer/KillActive',
            worker__to__trainer__pb2.KillActiveRequest.SerializeToString,
            common__pb2.Empty.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def KillTrainer(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/WorkerToTrainer/KillTrainer',
            worker__to__trainer__pb2.KillTrainerRequest.SerializeToString,
            common__pb2.Empty.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def ProbeTrainer(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/WorkerToTrainer/ProbeTrainer',
            common__pb2.Empty.SerializeToString,
            common__pb2.Empty.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
