# Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
import nvflare.app_opt.xgboost.histogram_based_v2.proto.federated_pb2 as federated__pb2
[docs]class FederatedStub(object):
"""Missing associated documentation comment in .proto file."""
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.Allgather = channel.unary_unary(
'/xgboost.federated.Federated/Allgather',
request_serializer=federated__pb2.AllgatherRequest.SerializeToString,
response_deserializer=federated__pb2.AllgatherReply.FromString,
)
self.AllgatherV = channel.unary_unary(
'/xgboost.federated.Federated/AllgatherV',
request_serializer=federated__pb2.AllgatherVRequest.SerializeToString,
response_deserializer=federated__pb2.AllgatherVReply.FromString,
)
self.Allreduce = channel.unary_unary(
'/xgboost.federated.Federated/Allreduce',
request_serializer=federated__pb2.AllreduceRequest.SerializeToString,
response_deserializer=federated__pb2.AllreduceReply.FromString,
)
self.Broadcast = channel.unary_unary(
'/xgboost.federated.Federated/Broadcast',
request_serializer=federated__pb2.BroadcastRequest.SerializeToString,
response_deserializer=federated__pb2.BroadcastReply.FromString,
)
[docs]class FederatedServicer(object):
"""Missing associated documentation comment in .proto file."""
[docs] def Allgather(self, request, context):
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
[docs] def AllgatherV(self, request, context):
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
[docs] def Allreduce(self, request, context):
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
[docs] def Broadcast(self, request, context):
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
[docs]def add_FederatedServicer_to_server(servicer, server):
rpc_method_handlers = {
'Allgather': grpc.unary_unary_rpc_method_handler(
servicer.Allgather,
request_deserializer=federated__pb2.AllgatherRequest.FromString,
response_serializer=federated__pb2.AllgatherReply.SerializeToString,
),
'AllgatherV': grpc.unary_unary_rpc_method_handler(
servicer.AllgatherV,
request_deserializer=federated__pb2.AllgatherVRequest.FromString,
response_serializer=federated__pb2.AllgatherVReply.SerializeToString,
),
'Allreduce': grpc.unary_unary_rpc_method_handler(
servicer.Allreduce,
request_deserializer=federated__pb2.AllreduceRequest.FromString,
response_serializer=federated__pb2.AllreduceReply.SerializeToString,
),
'Broadcast': grpc.unary_unary_rpc_method_handler(
servicer.Broadcast,
request_deserializer=federated__pb2.BroadcastRequest.FromString,
response_serializer=federated__pb2.BroadcastReply.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'xgboost.federated.Federated', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
# This class is part of an EXPERIMENTAL API.
[docs]class Federated(object):
"""Missing associated documentation comment in .proto file."""
[docs] @staticmethod
def Allgather(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, '/xgboost.federated.Federated/Allgather',
federated__pb2.AllgatherRequest.SerializeToString,
federated__pb2.AllgatherReply.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
[docs] @staticmethod
def AllgatherV(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, '/xgboost.federated.Federated/AllgatherV',
federated__pb2.AllgatherVRequest.SerializeToString,
federated__pb2.AllgatherVReply.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
[docs] @staticmethod
def Allreduce(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, '/xgboost.federated.Federated/Allreduce',
federated__pb2.AllreduceRequest.SerializeToString,
federated__pb2.AllreduceReply.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
[docs] @staticmethod
def Broadcast(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, '/xgboost.federated.Federated/Broadcast',
federated__pb2.BroadcastRequest.SerializeToString,
federated__pb2.BroadcastReply.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)