diff --git a/python/ppml/example/fgboost_regression/fgboost_regression_party_1.py b/python/ppml/example/fgboost_regression/fgboost_regression_party_1.py index 112a7b058cf..904d329b7b3 100644 --- a/python/ppml/example/fgboost_regression/fgboost_regression_party_1.py +++ b/python/ppml/example/fgboost_regression/fgboost_regression_party_1.py @@ -82,7 +82,7 @@ def FillNaWithMean(data, columnList): @click.command() @click.option('--load_model', default=False) def run_client(load_model): - client_id = '1' + client_id = 1 init_fl_context(client_id) df_train = pd.read_csv('./python/ppml/example/fgboost_regression/data/house-prices-train-1.csv') diff --git a/python/ppml/example/fgboost_regression/fgboost_regression_party_2.py b/python/ppml/example/fgboost_regression/fgboost_regression_party_2.py index 63376950a2f..4f00e05d23e 100644 --- a/python/ppml/example/fgboost_regression/fgboost_regression_party_2.py +++ b/python/ppml/example/fgboost_regression/fgboost_regression_party_2.py @@ -82,7 +82,7 @@ def FillNaWithMean(data, columnList): @click.command() @click.option('--load_model', default=False) def run_client(load_model): - client_id = '2' + client_id = 2 init_fl_context(client_id) df_train = pd.read_csv('./python/ppml/example/fgboost_regression/data/house-prices-train-2.csv') diff --git a/python/ppml/example/pytorch_nn_lr/pytorch_nn_lr_1.py b/python/ppml/example/pytorch_nn_lr/pytorch_nn_lr_1.py index 156279f17f9..bcef74090df 100644 --- a/python/ppml/example/pytorch_nn_lr/pytorch_nn_lr_1.py +++ b/python/ppml/example/pytorch_nn_lr/pytorch_nn_lr_1.py @@ -56,7 +56,7 @@ def forward(self, x: List[Tensor]): @click.option('--load_model', default=False) @click.option('--data_path', default="./data/diabetes-vfl-1.csv") def run_client(load_model, data_path): - init_fl_context('1') + init_fl_context(1) df_train = pd.read_csv(data_path) df_train['ID'] = df_train['ID'].astype(str) diff --git a/python/ppml/example/pytorch_nn_lr/pytorch_nn_lr_2.py b/python/ppml/example/pytorch_nn_lr/pytorch_nn_lr_2.py index fca617612af..da2ca515a17 100644 --- a/python/ppml/example/pytorch_nn_lr/pytorch_nn_lr_2.py +++ b/python/ppml/example/pytorch_nn_lr/pytorch_nn_lr_2.py @@ -42,7 +42,7 @@ def forward(self, x): @click.option('--load_model', default=False) @click.option('--data_path', default="./data/diabetes-vfl-2.csv") def run_client(load_model, data_path): - init_fl_context('2') + init_fl_context(2) df_train = pd.read_csv(data_path) df_train['ID'] = df_train['ID'].astype(str) psi = PSI() diff --git a/python/ppml/src/bigdl/ppml/fl/nn/fl_context.py b/python/ppml/src/bigdl/ppml/fl/nn/fl_context.py index 4ba421de4fc..75bcfe20771 100644 --- a/python/ppml/src/bigdl/ppml/fl/nn/fl_context.py +++ b/python/ppml/src/bigdl/ppml/fl/nn/fl_context.py @@ -16,7 +16,7 @@ from ..nn.fl_client import FLClient -def init_fl_context(client_id, target="localhost:8980"): +def init_fl_context(client_id: int, target="localhost:8980"): FLClient.load_config() FLClient.set_client_id(client_id) # target can be set in config file, and also could be overwritten here diff --git a/python/ppml/src/bigdl/ppml/fl/nn/generated/fgboost_service_pb2.py b/python/ppml/src/bigdl/ppml/fl/nn/generated/fgboost_service_pb2.py index c4104219328..82f56086fdb 100644 --- a/python/ppml/src/bigdl/ppml/fl/nn/generated/fgboost_service_pb2.py +++ b/python/ppml/src/bigdl/ppml/fl/nn/generated/fgboost_service_pb2.py @@ -15,7 +15,7 @@ import fl_base_pb2 as fl__base__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x15\x66gboost_service.proto\x12\x07\x66gboost\x1a\rfl_base.proto\"U\n\x12UploadLabelRequest\x12\x12\n\nclientuuid\x18\x01 \x01(\t\x12\x18\n\x04\x64\x61ta\x18\x02 \x01(\x0b\x32\n.TensorMap\x12\x11\n\talgorithm\x18\x03 \x01(\t\"F\n\x14\x44ownloadLabelRequest\x12\x1b\n\x08metaData\x18\x01 \x01(\x0b\x32\t.MetaData\x12\x11\n\talgorithm\x18\x02 \x01(\t\"L\n\x10\x44ownloadResponse\x12\x18\n\x04\x64\x61ta\x18\x01 \x01(\x0b\x32\n.TensorMap\x12\x10\n\x08response\x18\x02 \x01(\t\x12\x0c\n\x04\x63ode\x18\x03 \x01(\x05\"R\n\x08TreeLeaf\x12\x0e\n\x06treeID\x18\x01 \x01(\t\x12\x11\n\tleafIndex\x18\x02 \x03(\x05\x12\x12\n\nleafOutput\x18\x03 \x03(\x02\x12\x0f\n\x07version\x18\x04 \x01(\x05\"P\n\x15UploadTreeLeafRequest\x12\x12\n\nclientuuid\x18\x01 \x01(\t\x12#\n\x08treeLeaf\x18\x02 \x01(\x0b\x32\x11.fgboost.TreeLeaf\"\xa8\x01\n\tDataSplit\x12\x0e\n\x06treeID\x18\x01 \x01(\t\x12\x0e\n\x06nodeID\x18\x02 \x01(\t\x12\x11\n\tfeatureID\x18\x03 \x01(\x05\x12\x12\n\nsplitValue\x18\x04 \x01(\x02\x12\x0c\n\x04gain\x18\x05 \x01(\x02\x12\x11\n\tsetLength\x18\x06 \x01(\x05\x12\x0f\n\x07itemSet\x18\x07 \x03(\x05\x12\x11\n\tclientUid\x18\x08 \x01(\t\x12\x0f\n\x07version\x18\t \x01(\x05\"0\n\x0eUploadResponse\x12\x10\n\x08response\x18\x01 \x01(\t\x12\x0c\n\x04\x63ode\x18\x02 \x01(\x05\"/\n\x0bTreePredict\x12\x0e\n\x06treeID\x18\x01 \x01(\t\x12\x10\n\x08predicts\x18\x02 \x03(\x08\"6\n\x0c\x42oostPredict\x12&\n\x08predicts\x18\x01 \x03(\x0b\x32\x14.fgboost.TreePredict\"4\n\tBoostEval\x12\'\n\tevaluates\x18\x01 \x03(\x0b\x32\x14.fgboost.TreePredict\"4\n\x0fRegisterRequest\x12\x12\n\nclientuuid\x18\x01 \x01(\t\x12\r\n\x05token\x18\x02 \x01(\t\"2\n\x10RegisterResponse\x12\x10\n\x08response\x18\x01 \x01(\t\x12\x0c\n\x04\x63ode\x18\x02 \x01(\x05\"b\n\x15UploadTreeEvalRequest\x12\x12\n\nclientuuid\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\x05\x12$\n\x08treeEval\x18\x03 \x03(\x0b\x32\x12.fgboost.BoostEval\"o\n\x0f\x45valuateRequest\x12\x12\n\nclientuuid\x18\x01 \x01(\t\x12$\n\x08treeEval\x18\x02 \x03(\x0b\x32\x12.fgboost.BoostEval\x12\x0f\n\x07version\x18\x03 \x01(\x05\x12\x11\n\tlastBatch\x18\x04 \x01(\x08\"]\n\x10\x45valuateResponse\x12\x10\n\x08response\x18\x01 \x01(\t\x12\x18\n\x04\x64\x61ta\x18\x02 \x01(\x0b\x32\n.TensorMap\x12\x0c\n\x04\x63ode\x18\x03 \x01(\x05\x12\x0f\n\x07message\x18\x04 \x01(\t\"n\n\x0ePredictRequest\x12\x12\n\nclientuuid\x18\x01 \x01(\t\x12$\n\x08treeEval\x18\x02 \x03(\x0b\x32\x12.fgboost.BoostEval\x12\x0f\n\x07version\x18\x03 \x01(\x05\x12\x11\n\tlastBatch\x18\x04 \x01(\x08\"E\n\x0cSplitRequest\x12\x12\n\nclientuuid\x18\x01 \x01(\t\x12!\n\x05split\x18\x02 \x01(\x0b\x32\x12.fgboost.DataSplit\"K\n\x0fPredictResponse\x12\x10\n\x08response\x18\x01 \x01(\t\x12\x18\n\x04\x64\x61ta\x18\x02 \x01(\x0b\x32\n.TensorMap\x12\x0c\n\x04\x63ode\x18\x03 \x01(\x05\"R\n\rSplitResponse\x12!\n\x05split\x18\x01 \x01(\x0b\x32\x12.fgboost.DataSplit\x12\x10\n\x08response\x18\x02 \x01(\t\x12\x0c\n\x04\x63ode\x18\x03 \x01(\x05\x32\xf1\x03\n\x0e\x46GBoostService\x12\x45\n\x0buploadLabel\x12\x1b.fgboost.UploadLabelRequest\x1a\x17.fgboost.UploadResponse\"\x00\x12K\n\rdownloadLabel\x12\x1d.fgboost.DownloadLabelRequest\x1a\x19.fgboost.DownloadResponse\"\x00\x12\x38\n\x05split\x12\x15.fgboost.SplitRequest\x1a\x16.fgboost.SplitResponse\"\x00\x12\x41\n\x08register\x12\x18.fgboost.RegisterRequest\x1a\x19.fgboost.RegisterResponse\"\x00\x12K\n\x0euploadTreeLeaf\x12\x1e.fgboost.UploadTreeLeafRequest\x1a\x17.fgboost.UploadResponse\"\x00\x12\x41\n\x08\x65valuate\x12\x18.fgboost.EvaluateRequest\x1a\x19.fgboost.EvaluateResponse\"\x00\x12>\n\x07predict\x12\x17.fgboost.PredictRequest\x1a\x18.fgboost.PredictResponse\"\x00\x42\x42\n+com.intel.analytics.bigdl.ppml.fl.generatedB\x13\x46GBoostServiceProtob\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x15\x66gboost_service.proto\x12\x07\x66gboost\x1a\rfl_base.proto\"U\n\x12UploadLabelRequest\x12\x12\n\nclientuuid\x18\x01 \x01(\x05\x12\x18\n\x04\x64\x61ta\x18\x02 \x01(\x0b\x32\n.TensorMap\x12\x11\n\talgorithm\x18\x03 \x01(\t\"F\n\x14\x44ownloadLabelRequest\x12\x1b\n\x08metaData\x18\x01 \x01(\x0b\x32\t.MetaData\x12\x11\n\talgorithm\x18\x02 \x01(\t\"L\n\x10\x44ownloadResponse\x12\x18\n\x04\x64\x61ta\x18\x01 \x01(\x0b\x32\n.TensorMap\x12\x10\n\x08response\x18\x02 \x01(\t\x12\x0c\n\x04\x63ode\x18\x03 \x01(\x05\"R\n\x08TreeLeaf\x12\x0e\n\x06treeID\x18\x01 \x01(\t\x12\x11\n\tleafIndex\x18\x02 \x03(\x05\x12\x12\n\nleafOutput\x18\x03 \x03(\x02\x12\x0f\n\x07version\x18\x04 \x01(\x05\"P\n\x15UploadTreeLeafRequest\x12\x12\n\nclientuuid\x18\x01 \x01(\x05\x12#\n\x08treeLeaf\x18\x02 \x01(\x0b\x32\x11.fgboost.TreeLeaf\"\xa8\x01\n\tDataSplit\x12\x0e\n\x06treeID\x18\x01 \x01(\t\x12\x0e\n\x06nodeID\x18\x02 \x01(\t\x12\x11\n\tfeatureID\x18\x03 \x01(\x05\x12\x12\n\nsplitValue\x18\x04 \x01(\x02\x12\x0c\n\x04gain\x18\x05 \x01(\x02\x12\x11\n\tsetLength\x18\x06 \x01(\x05\x12\x0f\n\x07itemSet\x18\x07 \x03(\x05\x12\x11\n\tclientUid\x18\x08 \x01(\t\x12\x0f\n\x07version\x18\t \x01(\x05\"0\n\x0eUploadResponse\x12\x10\n\x08response\x18\x01 \x01(\t\x12\x0c\n\x04\x63ode\x18\x02 \x01(\x05\"/\n\x0bTreePredict\x12\x0e\n\x06treeID\x18\x01 \x01(\t\x12\x10\n\x08predicts\x18\x02 \x03(\x08\"6\n\x0c\x42oostPredict\x12&\n\x08predicts\x18\x01 \x03(\x0b\x32\x14.fgboost.TreePredict\"4\n\tBoostEval\x12\'\n\tevaluates\x18\x01 \x03(\x0b\x32\x14.fgboost.TreePredict\"4\n\x0fRegisterRequest\x12\x12\n\nclientuuid\x18\x01 \x01(\x05\x12\r\n\x05token\x18\x02 \x01(\t\"2\n\x10RegisterResponse\x12\x10\n\x08response\x18\x01 \x01(\t\x12\x0c\n\x04\x63ode\x18\x02 \x01(\x05\"b\n\x15UploadTreeEvalRequest\x12\x12\n\nclientuuid\x18\x01 \x01(\x05\x12\x0f\n\x07version\x18\x02 \x01(\x05\x12$\n\x08treeEval\x18\x03 \x03(\x0b\x32\x12.fgboost.BoostEval\"o\n\x0f\x45valuateRequest\x12\x12\n\nclientuuid\x18\x01 \x01(\x05\x12$\n\x08treeEval\x18\x02 \x03(\x0b\x32\x12.fgboost.BoostEval\x12\x0f\n\x07version\x18\x03 \x01(\x05\x12\x11\n\tlastBatch\x18\x04 \x01(\x08\"]\n\x10\x45valuateResponse\x12\x10\n\x08response\x18\x01 \x01(\t\x12\x18\n\x04\x64\x61ta\x18\x02 \x01(\x0b\x32\n.TensorMap\x12\x0c\n\x04\x63ode\x18\x03 \x01(\x05\x12\x0f\n\x07message\x18\x04 \x01(\t\"n\n\x0ePredictRequest\x12\x12\n\nclientuuid\x18\x01 \x01(\x05\x12$\n\x08treeEval\x18\x02 \x03(\x0b\x32\x12.fgboost.BoostEval\x12\x0f\n\x07version\x18\x03 \x01(\x05\x12\x11\n\tlastBatch\x18\x04 \x01(\x08\"E\n\x0cSplitRequest\x12\x12\n\nclientuuid\x18\x01 \x01(\x05\x12!\n\x05split\x18\x02 \x01(\x0b\x32\x12.fgboost.DataSplit\"K\n\x0fPredictResponse\x12\x10\n\x08response\x18\x01 \x01(\t\x12\x18\n\x04\x64\x61ta\x18\x02 \x01(\x0b\x32\n.TensorMap\x12\x0c\n\x04\x63ode\x18\x03 \x01(\x05\"R\n\rSplitResponse\x12!\n\x05split\x18\x01 \x01(\x0b\x32\x12.fgboost.DataSplit\x12\x10\n\x08response\x18\x02 \x01(\t\x12\x0c\n\x04\x63ode\x18\x03 \x01(\x05\"9\n\x10SaveModelRequest\x12\x12\n\nclientuuid\x18\x01 \x01(\x05\x12\x11\n\tmodelPath\x18\x02 \x01(\t\"2\n\x11SaveModelResponse\x12\x0f\n\x07message\x18\x01 \x01(\t\x12\x0c\n\x04\x63ode\x18\x02 \x01(\x05\"9\n\x10LoadModelRequest\x12\x11\n\tclient_id\x18\x01 \x01(\x05\x12\x12\n\nmodel_path\x18\x02 \x01(\t\"2\n\x11LoadModelResponse\x12\x0f\n\x07message\x18\x01 \x01(\t\x12\x0c\n\x04\x63ode\x18\x02 \x01(\x05\x32\x89\x05\n\x0e\x46GBoostService\x12\x45\n\x0buploadLabel\x12\x1b.fgboost.UploadLabelRequest\x1a\x17.fgboost.UploadResponse\"\x00\x12K\n\rdownloadLabel\x12\x1d.fgboost.DownloadLabelRequest\x1a\x19.fgboost.DownloadResponse\"\x00\x12\x38\n\x05split\x12\x15.fgboost.SplitRequest\x1a\x16.fgboost.SplitResponse\"\x00\x12\x41\n\x08register\x12\x18.fgboost.RegisterRequest\x1a\x19.fgboost.RegisterResponse\"\x00\x12K\n\x0euploadTreeLeaf\x12\x1e.fgboost.UploadTreeLeafRequest\x1a\x17.fgboost.UploadResponse\"\x00\x12\x41\n\x08\x65valuate\x12\x18.fgboost.EvaluateRequest\x1a\x19.fgboost.EvaluateResponse\"\x00\x12>\n\x07predict\x12\x17.fgboost.PredictRequest\x1a\x18.fgboost.PredictResponse\"\x00\x12J\n\x0fsaveServerModel\x12\x19.fgboost.SaveModelRequest\x1a\x1a.fgboost.SaveModelResponse\"\x00\x12J\n\x0floadServerModel\x12\x19.fgboost.LoadModelRequest\x1a\x1a.fgboost.LoadModelResponse\"\x00\x42\x42\n+com.intel.analytics.bigdl.ppml.fl.generatedB\x13\x46GBoostServiceProtob\x06proto3') @@ -38,6 +38,10 @@ _SPLITREQUEST = DESCRIPTOR.message_types_by_name['SplitRequest'] _PREDICTRESPONSE = DESCRIPTOR.message_types_by_name['PredictResponse'] _SPLITRESPONSE = DESCRIPTOR.message_types_by_name['SplitResponse'] +_SAVEMODELREQUEST = DESCRIPTOR.message_types_by_name['SaveModelRequest'] +_SAVEMODELRESPONSE = DESCRIPTOR.message_types_by_name['SaveModelResponse'] +_LOADMODELREQUEST = DESCRIPTOR.message_types_by_name['LoadModelRequest'] +_LOADMODELRESPONSE = DESCRIPTOR.message_types_by_name['LoadModelResponse'] UploadLabelRequest = _reflection.GeneratedProtocolMessageType('UploadLabelRequest', (_message.Message,), { 'DESCRIPTOR' : _UPLOADLABELREQUEST, '__module__' : 'fgboost_service_pb2' @@ -171,6 +175,34 @@ }) _sym_db.RegisterMessage(SplitResponse) +SaveModelRequest = _reflection.GeneratedProtocolMessageType('SaveModelRequest', (_message.Message,), { + 'DESCRIPTOR' : _SAVEMODELREQUEST, + '__module__' : 'fgboost_service_pb2' + # @@protoc_insertion_point(class_scope:fgboost.SaveModelRequest) + }) +_sym_db.RegisterMessage(SaveModelRequest) + +SaveModelResponse = _reflection.GeneratedProtocolMessageType('SaveModelResponse', (_message.Message,), { + 'DESCRIPTOR' : _SAVEMODELRESPONSE, + '__module__' : 'fgboost_service_pb2' + # @@protoc_insertion_point(class_scope:fgboost.SaveModelResponse) + }) +_sym_db.RegisterMessage(SaveModelResponse) + +LoadModelRequest = _reflection.GeneratedProtocolMessageType('LoadModelRequest', (_message.Message,), { + 'DESCRIPTOR' : _LOADMODELREQUEST, + '__module__' : 'fgboost_service_pb2' + # @@protoc_insertion_point(class_scope:fgboost.LoadModelRequest) + }) +_sym_db.RegisterMessage(LoadModelRequest) + +LoadModelResponse = _reflection.GeneratedProtocolMessageType('LoadModelResponse', (_message.Message,), { + 'DESCRIPTOR' : _LOADMODELRESPONSE, + '__module__' : 'fgboost_service_pb2' + # @@protoc_insertion_point(class_scope:fgboost.LoadModelResponse) + }) +_sym_db.RegisterMessage(LoadModelResponse) + _FGBOOSTSERVICE = DESCRIPTOR.services_by_name['FGBoostService'] if _descriptor._USE_C_DESCRIPTORS == False: @@ -214,6 +246,14 @@ _PREDICTRESPONSE._serialized_end=1504 _SPLITRESPONSE._serialized_start=1506 _SPLITRESPONSE._serialized_end=1588 - _FGBOOSTSERVICE._serialized_start=1591 - _FGBOOSTSERVICE._serialized_end=2088 + _SAVEMODELREQUEST._serialized_start=1590 + _SAVEMODELREQUEST._serialized_end=1647 + _SAVEMODELRESPONSE._serialized_start=1649 + _SAVEMODELRESPONSE._serialized_end=1699 + _LOADMODELREQUEST._serialized_start=1701 + _LOADMODELREQUEST._serialized_end=1758 + _LOADMODELRESPONSE._serialized_start=1760 + _LOADMODELRESPONSE._serialized_end=1810 + _FGBOOSTSERVICE._serialized_start=1813 + _FGBOOSTSERVICE._serialized_end=2462 # @@protoc_insertion_point(module_scope) diff --git a/python/ppml/src/bigdl/ppml/fl/nn/generated/fgboost_service_pb2_grpc.py b/python/ppml/src/bigdl/ppml/fl/nn/generated/fgboost_service_pb2_grpc.py index ddfcf12c06c..58b2fb48700 100644 --- a/python/ppml/src/bigdl/ppml/fl/nn/generated/fgboost_service_pb2_grpc.py +++ b/python/ppml/src/bigdl/ppml/fl/nn/generated/fgboost_service_pb2_grpc.py @@ -4,6 +4,7 @@ import fgboost_service_pb2 as fgboost__service__pb2 + class FGBoostServiceStub(object): """Missing associated documentation comment in .proto file.""" @@ -48,6 +49,16 @@ def __init__(self, channel): request_serializer=fgboost__service__pb2.PredictRequest.SerializeToString, response_deserializer=fgboost__service__pb2.PredictResponse.FromString, ) + self.saveServerModel = channel.unary_unary( + '/fgboost.FGBoostService/saveServerModel', + request_serializer=fgboost__service__pb2.SaveModelRequest.SerializeToString, + response_deserializer=fgboost__service__pb2.SaveModelResponse.FromString, + ) + self.loadServerModel = channel.unary_unary( + '/fgboost.FGBoostService/loadServerModel', + request_serializer=fgboost__service__pb2.LoadModelRequest.SerializeToString, + response_deserializer=fgboost__service__pb2.LoadModelResponse.FromString, + ) class FGBoostServiceServicer(object): @@ -95,6 +106,18 @@ def predict(self, request, context): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') + def saveServerModel(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!') + + def loadServerModel(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!') + def add_FGBoostServiceServicer_to_server(servicer, server): rpc_method_handlers = { @@ -133,6 +156,16 @@ def add_FGBoostServiceServicer_to_server(servicer, server): request_deserializer=fgboost__service__pb2.PredictRequest.FromString, response_serializer=fgboost__service__pb2.PredictResponse.SerializeToString, ), + 'saveServerModel': grpc.unary_unary_rpc_method_handler( + servicer.saveServerModel, + request_deserializer=fgboost__service__pb2.SaveModelRequest.FromString, + response_serializer=fgboost__service__pb2.SaveModelResponse.SerializeToString, + ), + 'loadServerModel': grpc.unary_unary_rpc_method_handler( + servicer.loadServerModel, + request_deserializer=fgboost__service__pb2.LoadModelRequest.FromString, + response_serializer=fgboost__service__pb2.LoadModelResponse.SerializeToString, + ), } generic_handler = grpc.method_handlers_generic_handler( 'fgboost.FGBoostService', rpc_method_handlers) @@ -261,3 +294,37 @@ def predict(request, fgboost__service__pb2.PredictResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def saveServerModel(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, '/fgboost.FGBoostService/saveServerModel', + fgboost__service__pb2.SaveModelRequest.SerializeToString, + fgboost__service__pb2.SaveModelResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def loadServerModel(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, '/fgboost.FGBoostService/loadServerModel', + fgboost__service__pb2.LoadModelRequest.SerializeToString, + fgboost__service__pb2.LoadModelResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) diff --git a/python/ppml/src/bigdl/ppml/fl/nn/generated/nn_service_pb2.py b/python/ppml/src/bigdl/ppml/fl/nn/generated/nn_service_pb2.py index 5aae2c2171b..7dd3dfcbfbd 100644 --- a/python/ppml/src/bigdl/ppml/fl/nn/generated/nn_service_pb2.py +++ b/python/ppml/src/bigdl/ppml/fl/nn/generated/nn_service_pb2.py @@ -15,7 +15,7 @@ import fl_base_pb2 as fl__base__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x10nn_service.proto\x12\x02nn\x1a\rfl_base.proto\"O\n\x0cTrainRequest\x12\x12\n\nclientuuid\x18\x01 \x01(\t\x12\x18\n\x04\x64\x61ta\x18\x02 \x01(\x0b\x32\n.TensorMap\x12\x11\n\talgorithm\x18\x03 \x01(\t\"I\n\rTrainResponse\x12\x10\n\x08response\x18\x01 \x01(\t\x12\x18\n\x04\x64\x61ta\x18\x02 \x01(\x0b\x32\n.TensorMap\x12\x0c\n\x04\x63ode\x18\x03 \x01(\x05\"b\n\x0f\x45valuateRequest\x12\x12\n\nclientuuid\x18\x01 \x01(\t\x12\x18\n\x04\x64\x61ta\x18\x02 \x01(\x0b\x32\n.TensorMap\x12\x11\n\talgorithm\x18\x03 \x01(\t\x12\x0e\n\x06return\x18\x04 \x01(\x08\"]\n\x10\x45valuateResponse\x12\x10\n\x08response\x18\x01 \x01(\t\x12\x18\n\x04\x64\x61ta\x18\x02 \x01(\x0b\x32\n.TensorMap\x12\x0c\n\x04\x63ode\x18\x03 \x01(\x05\x12\x0f\n\x07message\x18\x04 \x01(\t\"Q\n\x0ePredictRequest\x12\x12\n\nclientuuid\x18\x01 \x01(\t\x12\x18\n\x04\x64\x61ta\x18\x02 \x01(\x0b\x32\n.TensorMap\x12\x11\n\talgorithm\x18\x03 \x01(\t\"K\n\x0fPredictResponse\x12\x10\n\x08response\x18\x01 \x01(\t\x12\x18\n\x04\x64\x61ta\x18\x02 \x01(\x0b\x32\n.TensorMap\x12\x0c\n\x04\x63ode\x18\x03 \x01(\x05\"r\n\x11UploadMetaRequest\x12\x13\n\x0b\x63lient_uuid\x18\x01 \x01(\t\x12\x0f\n\x07loss_fn\x18\x02 \x01(\x0c\x12#\n\toptimizer\x18\x03 \x01(\x0b\x32\x10.nn.ClassAndArgs\x12\x12\n\naggregator\x18\x04 \x01(\t\"\x1b\n\tByteChunk\x12\x0e\n\x06\x62uffer\x18\x01 \x01(\x0c\")\n\x0c\x43lassAndArgs\x12\x0b\n\x03\x63ls\x18\x01 \x01(\x0c\x12\x0c\n\x04\x61rgs\x18\x02 \x01(\x0c\"3\n\x12UploadMetaResponse\x12\x0f\n\x07message\x18\x01 \x01(\t\x12\x0c\n\x04\x63ode\x18\x02 \x01(\x05\"J\n\x10LoadModelRequest\x12\x11\n\tclient_id\x18\x01 \x01(\t\x12\x0f\n\x07\x62\x61\x63kend\x18\x02 \x01(\t\x12\x12\n\nmodel_path\x18\x03 \x01(\t\"2\n\x11LoadModelResponse\x12\x0f\n\x07message\x18\x01 \x01(\t\x12\x0c\n\x04\x63ode\x18\x02 \x01(\x05\"J\n\x10SaveModelRequest\x12\x11\n\tclient_id\x18\x01 \x01(\t\x12\x0f\n\x07\x62\x61\x63kend\x18\x02 \x01(\t\x12\x12\n\nmodel_path\x18\x03 \x01(\t\"$\n\x11SaveModelResponse\x12\x0f\n\x07message\x18\x01 \x01(\t2\xac\x03\n\tNNService\x12.\n\x05train\x12\x10.nn.TrainRequest\x1a\x11.nn.TrainResponse\"\x00\x12\x37\n\x08\x65valuate\x12\x13.nn.EvaluateRequest\x1a\x14.nn.EvaluateResponse\"\x00\x12\x34\n\x07predict\x12\x12.nn.PredictRequest\x1a\x13.nn.PredictResponse\"\x00\x12>\n\x0bupload_meta\x12\x15.nn.UploadMetaRequest\x1a\x16.nn.UploadMetaResponse\"\x00\x12\x38\n\x0bupload_file\x12\r.nn.ByteChunk\x1a\x16.nn.UploadMetaResponse\"\x00(\x01\x12\x42\n\x11save_server_model\x12\x14.nn.SaveModelRequest\x1a\x15.nn.SaveModelResponse\"\x00\x12\x42\n\x11load_server_model\x12\x14.nn.LoadModelRequest\x1a\x15.nn.LoadModelResponse\"\x00\x42=\n+com.intel.analytics.bigdl.ppml.fl.generatedB\x0eNNServiceProtob\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x10nn_service.proto\x12\x02nn\x1a\rfl_base.proto\"O\n\x0cTrainRequest\x12\x12\n\nclientuuid\x18\x01 \x01(\x05\x12\x18\n\x04\x64\x61ta\x18\x02 \x01(\x0b\x32\n.TensorMap\x12\x11\n\talgorithm\x18\x03 \x01(\t\"I\n\rTrainResponse\x12\x10\n\x08response\x18\x01 \x01(\t\x12\x18\n\x04\x64\x61ta\x18\x02 \x01(\x0b\x32\n.TensorMap\x12\x0c\n\x04\x63ode\x18\x03 \x01(\x05\"b\n\x0f\x45valuateRequest\x12\x12\n\nclientuuid\x18\x01 \x01(\x05\x12\x18\n\x04\x64\x61ta\x18\x02 \x01(\x0b\x32\n.TensorMap\x12\x11\n\talgorithm\x18\x03 \x01(\t\x12\x0e\n\x06return\x18\x04 \x01(\x08\"]\n\x10\x45valuateResponse\x12\x10\n\x08response\x18\x01 \x01(\t\x12\x18\n\x04\x64\x61ta\x18\x02 \x01(\x0b\x32\n.TensorMap\x12\x0c\n\x04\x63ode\x18\x03 \x01(\x05\x12\x0f\n\x07message\x18\x04 \x01(\t\"Q\n\x0ePredictRequest\x12\x12\n\nclientuuid\x18\x01 \x01(\x05\x12\x18\n\x04\x64\x61ta\x18\x02 \x01(\x0b\x32\n.TensorMap\x12\x11\n\talgorithm\x18\x03 \x01(\t\"K\n\x0fPredictResponse\x12\x10\n\x08response\x18\x01 \x01(\t\x12\x18\n\x04\x64\x61ta\x18\x02 \x01(\x0b\x32\n.TensorMap\x12\x0c\n\x04\x63ode\x18\x03 \x01(\x05\"r\n\x11UploadMetaRequest\x12\x13\n\x0b\x63lient_uuid\x18\x01 \x01(\x05\x12\x0f\n\x07loss_fn\x18\x02 \x01(\x0c\x12#\n\toptimizer\x18\x03 \x01(\x0b\x32\x10.nn.ClassAndArgs\x12\x12\n\naggregator\x18\x04 \x01(\t\"\x1b\n\tByteChunk\x12\x0e\n\x06\x62uffer\x18\x01 \x01(\x0c\")\n\x0c\x43lassAndArgs\x12\x0b\n\x03\x63ls\x18\x01 \x01(\x0c\x12\x0c\n\x04\x61rgs\x18\x02 \x01(\x0c\"3\n\x12UploadMetaResponse\x12\x0f\n\x07message\x18\x01 \x01(\t\x12\x0c\n\x04\x63ode\x18\x02 \x01(\x05\"J\n\x10LoadModelRequest\x12\x11\n\tclient_id\x18\x01 \x01(\x05\x12\x0f\n\x07\x62\x61\x63kend\x18\x02 \x01(\t\x12\x12\n\nmodel_path\x18\x03 \x01(\t\"2\n\x11LoadModelResponse\x12\x0f\n\x07message\x18\x01 \x01(\t\x12\x0c\n\x04\x63ode\x18\x02 \x01(\x05\"J\n\x10SaveModelRequest\x12\x11\n\tclient_id\x18\x01 \x01(\x05\x12\x0f\n\x07\x62\x61\x63kend\x18\x02 \x01(\t\x12\x12\n\nmodel_path\x18\x03 \x01(\t\"$\n\x11SaveModelResponse\x12\x0f\n\x07message\x18\x01 \x01(\t2\xac\x03\n\tNNService\x12.\n\x05train\x12\x10.nn.TrainRequest\x1a\x11.nn.TrainResponse\"\x00\x12\x37\n\x08\x65valuate\x12\x13.nn.EvaluateRequest\x1a\x14.nn.EvaluateResponse\"\x00\x12\x34\n\x07predict\x12\x12.nn.PredictRequest\x1a\x13.nn.PredictResponse\"\x00\x12>\n\x0bupload_meta\x12\x15.nn.UploadMetaRequest\x1a\x16.nn.UploadMetaResponse\"\x00\x12\x38\n\x0bupload_file\x12\r.nn.ByteChunk\x1a\x16.nn.UploadMetaResponse\"\x00(\x01\x12\x42\n\x11save_server_model\x12\x14.nn.SaveModelRequest\x1a\x15.nn.SaveModelResponse\"\x00\x12\x42\n\x11load_server_model\x12\x14.nn.LoadModelRequest\x1a\x15.nn.LoadModelResponse\"\x00\x42=\n+com.intel.analytics.bigdl.ppml.fl.generatedB\x0eNNServiceProtob\x06proto3') diff --git a/python/ppml/src/bigdl/ppml/fl/nn/generated/psi_service_pb2.py b/python/ppml/src/bigdl/ppml/fl/nn/generated/psi_service_pb2.py index 5b0c85e9902..17bb2ca8769 100644 --- a/python/ppml/src/bigdl/ppml/fl/nn/generated/psi_service_pb2.py +++ b/python/ppml/src/bigdl/ppml/fl/nn/generated/psi_service_pb2.py @@ -15,7 +15,7 @@ import fl_base_pb2 as fl__base__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x11psi_service.proto\x1a\rfl_base.proto\"G\n\x0bSaltRequest\x12\x0f\n\x07task_id\x18\x01 \x01(\t\x12\x12\n\nclient_num\x18\x02 \x01(\x05\x12\x13\n\x0bsecure_code\x18\x03 \x01(\t\"\x1f\n\tSaltReply\x12\x12\n\nsalt_reply\x18\x01 \x01(\t\"\x96\x01\n\x10UploadSetRequest\x12\x0f\n\x07task_id\x18\x01 \x01(\t\x12\x11\n\tclient_id\x18\x02 \x01(\t\x12\r\n\x05split\x18\x03 \x01(\x05\x12\x11\n\tnum_split\x18\x04 \x01(\x05\x12\x14\n\x0csplit_length\x18\x05 \x01(\x05\x12\x14\n\x0ctotal_length\x18\x06 \x01(\x05\x12\x10\n\x08hashedID\x18\x07 \x03(\t\"=\n\x11UploadSetResponse\x12\x0f\n\x07task_id\x18\x01 \x01(\t\x12\x17\n\x06status\x18\x02 \x01(\x0e\x32\x07.SIGNAL\"=\n\x1b\x44ownloadIntersectionRequest\x12\x0f\n\x07task_id\x18\x01 \x01(\t\x12\r\n\x05split\x18\x02 \x01(\x05\"\xac\x01\n\x1c\x44ownloadIntersectionResponse\x12\x0f\n\x07task_id\x18\x01 \x01(\t\x12\x17\n\x06status\x18\x02 \x01(\x0e\x32\x07.SIGNAL\x12\r\n\x05split\x18\x03 \x01(\x05\x12\x11\n\tnum_split\x18\x04 \x01(\x05\x12\x14\n\x0csplit_length\x18\x05 \x01(\x05\x12\x14\n\x0ctotal_length\x18\x06 \x01(\x05\x12\x14\n\x0cintersection\x18\x07 \x03(\t2\xc0\x01\n\nPSIService\x12%\n\x07getSalt\x12\x0c.SaltRequest\x1a\n.SaltReply\"\x00\x12\x34\n\tuploadSet\x12\x11.UploadSetRequest\x1a\x12.UploadSetResponse\"\x00\x12U\n\x14\x64ownloadIntersection\x12\x1c.DownloadIntersectionRequest\x1a\x1d.DownloadIntersectionResponse\"\x00\x42>\n+com.intel.analytics.bigdl.ppml.fl.generatedB\x0fPSIServiceProtob\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x11psi_service.proto\x1a\rfl_base.proto\"G\n\x0bSaltRequest\x12\x0f\n\x07task_id\x18\x01 \x01(\t\x12\x12\n\nclient_num\x18\x02 \x01(\x05\x12\x13\n\x0bsecure_code\x18\x03 \x01(\t\"\x1f\n\tSaltReply\x12\x12\n\nsalt_reply\x18\x01 \x01(\t\"\x96\x01\n\x10UploadSetRequest\x12\x0f\n\x07task_id\x18\x01 \x01(\t\x12\x11\n\tclient_id\x18\x02 \x01(\x05\x12\r\n\x05split\x18\x03 \x01(\x05\x12\x11\n\tnum_split\x18\x04 \x01(\x05\x12\x14\n\x0csplit_length\x18\x05 \x01(\x05\x12\x14\n\x0ctotal_length\x18\x06 \x01(\x05\x12\x10\n\x08hashedID\x18\x07 \x03(\t\"=\n\x11UploadSetResponse\x12\x0f\n\x07task_id\x18\x01 \x01(\t\x12\x17\n\x06status\x18\x02 \x01(\x0e\x32\x07.SIGNAL\"=\n\x1b\x44ownloadIntersectionRequest\x12\x0f\n\x07task_id\x18\x01 \x01(\t\x12\r\n\x05split\x18\x02 \x01(\x05\"\xac\x01\n\x1c\x44ownloadIntersectionResponse\x12\x0f\n\x07task_id\x18\x01 \x01(\t\x12\x17\n\x06status\x18\x02 \x01(\x0e\x32\x07.SIGNAL\x12\r\n\x05split\x18\x03 \x01(\x05\x12\x11\n\tnum_split\x18\x04 \x01(\x05\x12\x14\n\x0csplit_length\x18\x05 \x01(\x05\x12\x14\n\x0ctotal_length\x18\x06 \x01(\x05\x12\x14\n\x0cintersection\x18\x07 \x03(\t2\xc0\x01\n\nPSIService\x12%\n\x07getSalt\x12\x0c.SaltRequest\x1a\n.SaltReply\"\x00\x12\x34\n\tuploadSet\x12\x11.UploadSetRequest\x1a\x12.UploadSetResponse\"\x00\x12U\n\x14\x64ownloadIntersection\x12\x1c.DownloadIntersectionRequest\x1a\x1d.DownloadIntersectionResponse\"\x00\x42>\n+com.intel.analytics.bigdl.ppml.fl.generatedB\x0fPSIServiceProtob\x06proto3') diff --git a/python/ppml/test/bigdl/ppml/fl/nn/pytorch/test_logistic_regression.py b/python/ppml/test/bigdl/ppml/fl/nn/pytorch/test_logistic_regression.py index 4f0a70b933d..a6122aa6a2a 100644 --- a/python/ppml/test/bigdl/ppml/fl/nn/pytorch/test_logistic_regression.py +++ b/python/ppml/test/bigdl/ppml/fl/nn/pytorch/test_logistic_regression.py @@ -121,11 +121,11 @@ def test_two_party_logistic_regression(self) -> None: pytorch_loss_list.append(np.array(loss)) mock_party2 = Process(target=mock_process, - args=('diabetes-vfl-2.csv', self.target, '2', False)) + args=('diabetes-vfl-2.csv', self.target, 2, False)) mock_party2.start() ppl = mock_process(data_train='diabetes-vfl-1.csv', target=self.target, - client_id='1', + client_id=1, upload_server_model=True) mock_party2.join() assert np.allclose(pytorch_loss_list, ppl.loss_history), \ diff --git a/python/ppml/test/bigdl/ppml/fl/nn/pytorch/test_mnist.py b/python/ppml/test/bigdl/ppml/fl/nn/pytorch/test_mnist.py index ec756075746..1b7572d42fb 100644 --- a/python/ppml/test/bigdl/ppml/fl/nn/pytorch/test_mnist.py +++ b/python/ppml/test/bigdl/ppml/fl/nn/pytorch/test_mnist.py @@ -42,7 +42,7 @@ class TestMnist(FLTest): fmt = '%(asctime)s %(levelname)s {%(module)s:%(lineno)d} - %(message)s' logging.basicConfig(format=fmt, level=logging.INFO) def setUp(self) -> None: - self.fl_server = FLServer() + self.fl_server = FLServer(1) self.fl_server.set_port(self.port) self.fl_server.build() self.fl_server.start() @@ -108,7 +108,7 @@ def train(dataloader, model, loss_fn, optimizer): train(train_dataloader, model, loss_fn, optimizer) - init_fl_context('1', self.target) + init_fl_context(1, self.target) vfl_model_1 = NeuralNetworkPart1() set_one_like_parameter(vfl_model_1) vfl_model_2 = NeuralNetworkPart2() diff --git a/python/ppml/test/bigdl/ppml/fl/nn/pytorch/test_save_load.py b/python/ppml/test/bigdl/ppml/fl/nn/pytorch/test_save_load.py index 7d015971f3d..945ed0d0ee4 100644 --- a/python/ppml/test/bigdl/ppml/fl/nn/pytorch/test_save_load.py +++ b/python/ppml/test/bigdl/ppml/fl/nn/pytorch/test_save_load.py @@ -90,7 +90,7 @@ def test_mnist(self) -> None: loss_fn = nn.CrossEntropyLoss() # list for result validation - init_fl_context('1', self.target) + init_fl_context(1, self.target) vfl_model_1 = NeuralNetworkPart1() vfl_model_2 = NeuralNetworkPart2() vfl_client_ppl = Estimator.from_torch(client_model=vfl_model_1, diff --git a/python/ppml/test/bigdl/ppml/fl/nn/tensorflow/test_mnist.py b/python/ppml/test/bigdl/ppml/fl/nn/tensorflow/test_mnist.py index fa54e8387dc..43c19ab8b17 100644 --- a/python/ppml/test/bigdl/ppml/fl/nn/tensorflow/test_mnist.py +++ b/python/ppml/test/bigdl/ppml/fl/nn/tensorflow/test_mnist.py @@ -131,7 +131,7 @@ def test_step(images, labels): ) # TODO: set fixed parameters - init_fl_context('1', self.target) + init_fl_context(1, self.target) vfl_model_1 = build_client_model() set_one_like_parameter(vfl_model_1) vfl_model_2 = build_server_model() diff --git a/python/ppml/test/bigdl/ppml/fl/psi/test_psi.py b/python/ppml/test/bigdl/ppml/fl/psi/test_psi.py index 817cc9aae60..21274e2e2c1 100644 --- a/python/ppml/test/bigdl/ppml/fl/psi/test_psi.py +++ b/python/ppml/test/bigdl/ppml/fl/psi/test_psi.py @@ -34,13 +34,13 @@ def tearDown(self) -> None: def test_psi_get_salt(self): - init_fl_context("1", self.target) + init_fl_context(1, self.target) psi = PSI() salt = psi.get_salt() assert (isinstance(salt, str)) def test_psi_pipeline(self): - init_fl_context("1", self.target) + init_fl_context(1, self.target) psi = PSI() salt = psi.get_salt() key = ["k1", "k2"] diff --git a/python/ppml/test/bigdl/ppml/fl/py4j/test_fgboost_regression.py b/python/ppml/test/bigdl/ppml/fl/py4j/test_fgboost_regression.py index afbb21572d8..6e5f67512f2 100644 --- a/python/ppml/test/bigdl/ppml/fl/py4j/test_fgboost_regression.py +++ b/python/ppml/test/bigdl/ppml/fl/py4j/test_fgboost_regression.py @@ -62,7 +62,7 @@ def setUp(self) -> None: self.update_available_port() self.fl_server = FLServer() self.fl_server.set_port(self.port) - init_fl_context("1", self.target) + init_fl_context(1, self.target) # this explicit set is needed, default value is 'fork' on Unix # if 'fork', the resources would be inherited and thread crash would occur # (to be verified) @@ -112,10 +112,10 @@ def test_three_party(self): self.fl_server.build() self.fl_server.start() mock_party1 = Process(target=mock_process, - args=('2', 'house-prices-train-preprocessed-1.csv', 'house-prices-test-preprocessed-1.csv', self.target)) + args=(2, 'house-prices-train-preprocessed-1.csv', 'house-prices-test-preprocessed-1.csv', self.target)) mock_party1.start() mock_party2 = Process(target=mock_process, - args=('3', 'house-prices-train-preprocessed-2.csv', 'house-prices-test-preprocessed-2.csv', self.target)) + args=(3, 'house-prices-train-preprocessed-2.csv', 'house-prices-test-preprocessed-2.csv', self.target)) mock_party2.start() df_train = pd.read_csv( diff --git a/python/ppml/test/bigdl/ppml/fl/py4j/test_psi.py b/python/ppml/test/bigdl/ppml/fl/py4j/test_psi.py index a229336d056..1550ee655d2 100644 --- a/python/ppml/test/bigdl/ppml/fl/py4j/test_psi.py +++ b/python/ppml/test/bigdl/ppml/fl/py4j/test_psi.py @@ -34,13 +34,13 @@ def tearDown(self) -> None: def test_psi_get_salt(self): - init_fl_context("1", self.target) + init_fl_context(1, self.target) psi = PSI() salt = psi.get_salt() assert (isinstance(salt, str)) def test_psi_pipeline(self): - init_fl_context("1", self.target) + init_fl_context(1, self.target) psi = PSI() salt = psi.get_salt() key = ["k1", "k2"] diff --git a/scala/ppml/src/main/java/com/intel/analytics/bigdl/ppml/fl/common/Aggregator.java b/scala/ppml/src/main/java/com/intel/analytics/bigdl/ppml/fl/common/Aggregator.java index 7aa0cc07778..d716fb98c7a 100644 --- a/scala/ppml/src/main/java/com/intel/analytics/bigdl/ppml/fl/common/Aggregator.java +++ b/scala/ppml/src/main/java/com/intel/analytics/bigdl/ppml/fl/common/Aggregator.java @@ -61,8 +61,7 @@ public void setClientNum(Integer clientNum) { public abstract void aggregate(FLPhase flPhase); - public void putClientData(FLPhase flPhase, - String clientUUID, int version, DataHolder dataHolder) + public void putClientData(FLPhase flPhase, int clientUUID, int version, DataHolder dataHolder) throws IllegalArgumentException, InterruptedException { StorageHolder storageHolder = aggregateTypeMap.get(flPhase); synchronized (this) { diff --git a/scala/ppml/src/main/java/com/intel/analytics/bigdl/ppml/fl/common/Storage.java b/scala/ppml/src/main/java/com/intel/analytics/bigdl/ppml/fl/common/Storage.java index 38812cff796..e60a7e47a35 100644 --- a/scala/ppml/src/main/java/com/intel/analytics/bigdl/ppml/fl/common/Storage.java +++ b/scala/ppml/src/main/java/com/intel/analytics/bigdl/ppml/fl/common/Storage.java @@ -33,7 +33,7 @@ public class Storage { public String name; public int version; public T serverData = null; - public Map clientData; + public Map clientData; public Storage (String name) { version = 0; this.name = name; diff --git a/scala/ppml/src/main/java/com/intel/analytics/bigdl/ppml/fl/generated/FGBoostServiceProto.java b/scala/ppml/src/main/java/com/intel/analytics/bigdl/ppml/fl/generated/FGBoostServiceProto.java index a000e1802d7..432a4803887 100644 --- a/scala/ppml/src/main/java/com/intel/analytics/bigdl/ppml/fl/generated/FGBoostServiceProto.java +++ b/scala/ppml/src/main/java/com/intel/analytics/bigdl/ppml/fl/generated/FGBoostServiceProto.java @@ -19,16 +19,10 @@ public interface UploadLabelRequestOrBuilder extends com.google.protobuf.MessageOrBuilder { /** - * string clientuuid = 1; + * int32 clientuuid = 1; * @return The clientuuid. */ - java.lang.String getClientuuid(); - /** - * string clientuuid = 1; - * @return The bytes for clientuuid. - */ - com.google.protobuf.ByteString - getClientuuidBytes(); + int getClientuuid(); /** * .TensorMap data = 2; @@ -70,7 +64,6 @@ private UploadLabelRequest(com.google.protobuf.GeneratedMessageV3.Builder bui super(builder); } private UploadLabelRequest() { - clientuuid_ = ""; algorithm_ = ""; } @@ -104,10 +97,9 @@ private UploadLabelRequest( case 0: done = true; break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); + case 8: { - clientuuid_ = s; + clientuuid_ = input.readInt32(); break; } case 18: { @@ -162,41 +154,14 @@ private UploadLabelRequest( } public static final int CLIENTUUID_FIELD_NUMBER = 1; - private volatile java.lang.Object clientuuid_; + private int clientuuid_; /** - * string clientuuid = 1; + * int32 clientuuid = 1; * @return The clientuuid. */ @java.lang.Override - public java.lang.String getClientuuid() { - java.lang.Object ref = clientuuid_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - clientuuid_ = s; - return s; - } - } - /** - * string clientuuid = 1; - * @return The bytes for clientuuid. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getClientuuidBytes() { - java.lang.Object ref = clientuuid_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - clientuuid_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + public int getClientuuid() { + return clientuuid_; } public static final int DATA_FIELD_NUMBER = 2; @@ -277,8 +242,8 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getClientuuidBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, clientuuid_); + if (clientuuid_ != 0) { + output.writeInt32(1, clientuuid_); } if (data_ != null) { output.writeMessage(2, getData()); @@ -295,8 +260,9 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!getClientuuidBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, clientuuid_); + if (clientuuid_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, clientuuid_); } if (data_ != null) { size += com.google.protobuf.CodedOutputStream @@ -320,8 +286,8 @@ public boolean equals(final java.lang.Object obj) { } com.intel.analytics.bigdl.ppml.fl.generated.FGBoostServiceProto.UploadLabelRequest other = (com.intel.analytics.bigdl.ppml.fl.generated.FGBoostServiceProto.UploadLabelRequest) obj; - if (!getClientuuid() - .equals(other.getClientuuid())) return false; + if (getClientuuid() + != other.getClientuuid()) return false; if (hasData() != other.hasData()) return false; if (hasData()) { if (!getData() @@ -341,7 +307,7 @@ public int hashCode() { int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + CLIENTUUID_FIELD_NUMBER; - hash = (53 * hash) + getClientuuid().hashCode(); + hash = (53 * hash) + getClientuuid(); if (hasData()) { hash = (37 * hash) + DATA_FIELD_NUMBER; hash = (53 * hash) + getData().hashCode(); @@ -481,7 +447,7 @@ private void maybeForceBuilderInitialization() { @java.lang.Override public Builder clear() { super.clear(); - clientuuid_ = ""; + clientuuid_ = 0; if (dataBuilder_ == null) { data_ = null; @@ -572,9 +538,8 @@ public Builder mergeFrom(com.google.protobuf.Message other) { public Builder mergeFrom(com.intel.analytics.bigdl.ppml.fl.generated.FGBoostServiceProto.UploadLabelRequest other) { if (other == com.intel.analytics.bigdl.ppml.fl.generated.FGBoostServiceProto.UploadLabelRequest.getDefaultInstance()) return this; - if (!other.getClientuuid().isEmpty()) { - clientuuid_ = other.clientuuid_; - onChanged(); + if (other.getClientuuid() != 0) { + setClientuuid(other.getClientuuid()); } if (other.hasData()) { mergeData(other.getData()); @@ -612,78 +577,33 @@ public Builder mergeFrom( return this; } - private java.lang.Object clientuuid_ = ""; + private int clientuuid_ ; /** - * string clientuuid = 1; + * int32 clientuuid = 1; * @return The clientuuid. */ - public java.lang.String getClientuuid() { - java.lang.Object ref = clientuuid_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - clientuuid_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string clientuuid = 1; - * @return The bytes for clientuuid. - */ - public com.google.protobuf.ByteString - getClientuuidBytes() { - java.lang.Object ref = clientuuid_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - clientuuid_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + @java.lang.Override + public int getClientuuid() { + return clientuuid_; } /** - * string clientuuid = 1; + * int32 clientuuid = 1; * @param value The clientuuid to set. * @return This builder for chaining. */ - public Builder setClientuuid( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - + public Builder setClientuuid(int value) { + clientuuid_ = value; onChanged(); return this; } /** - * string clientuuid = 1; + * int32 clientuuid = 1; * @return This builder for chaining. */ public Builder clearClientuuid() { - clientuuid_ = getDefaultInstance().getClientuuid(); - onChanged(); - return this; - } - /** - * string clientuuid = 1; - * @param value The bytes for clientuuid to set. - * @return This builder for chaining. - */ - public Builder setClientuuidBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - clientuuid_ = value; + clientuuid_ = 0; onChanged(); return this; } @@ -3577,16 +3497,10 @@ public interface UploadTreeLeafRequestOrBuilder extends com.google.protobuf.MessageOrBuilder { /** - * string clientuuid = 1; + * int32 clientuuid = 1; * @return The clientuuid. */ - java.lang.String getClientuuid(); - /** - * string clientuuid = 1; - * @return The bytes for clientuuid. - */ - com.google.protobuf.ByteString - getClientuuidBytes(); + int getClientuuid(); /** * .fgboost.TreeLeaf treeLeaf = 2; @@ -3616,7 +3530,6 @@ private UploadTreeLeafRequest(com.google.protobuf.GeneratedMessageV3.Builder super(builder); } private UploadTreeLeafRequest() { - clientuuid_ = ""; } @java.lang.Override @@ -3649,10 +3562,9 @@ private UploadTreeLeafRequest( case 0: done = true; break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); + case 8: { - clientuuid_ = s; + clientuuid_ = input.readInt32(); break; } case 18: { @@ -3701,41 +3613,14 @@ private UploadTreeLeafRequest( } public static final int CLIENTUUID_FIELD_NUMBER = 1; - private volatile java.lang.Object clientuuid_; + private int clientuuid_; /** - * string clientuuid = 1; + * int32 clientuuid = 1; * @return The clientuuid. */ @java.lang.Override - public java.lang.String getClientuuid() { - java.lang.Object ref = clientuuid_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - clientuuid_ = s; - return s; - } - } - /** - * string clientuuid = 1; - * @return The bytes for clientuuid. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getClientuuidBytes() { - java.lang.Object ref = clientuuid_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - clientuuid_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + public int getClientuuid() { + return clientuuid_; } public static final int TREELEAF_FIELD_NUMBER = 2; @@ -3778,8 +3663,8 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getClientuuidBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, clientuuid_); + if (clientuuid_ != 0) { + output.writeInt32(1, clientuuid_); } if (treeLeaf_ != null) { output.writeMessage(2, getTreeLeaf()); @@ -3793,8 +3678,9 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!getClientuuidBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, clientuuid_); + if (clientuuid_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, clientuuid_); } if (treeLeaf_ != null) { size += com.google.protobuf.CodedOutputStream @@ -3815,8 +3701,8 @@ public boolean equals(final java.lang.Object obj) { } com.intel.analytics.bigdl.ppml.fl.generated.FGBoostServiceProto.UploadTreeLeafRequest other = (com.intel.analytics.bigdl.ppml.fl.generated.FGBoostServiceProto.UploadTreeLeafRequest) obj; - if (!getClientuuid() - .equals(other.getClientuuid())) return false; + if (getClientuuid() + != other.getClientuuid()) return false; if (hasTreeLeaf() != other.hasTreeLeaf()) return false; if (hasTreeLeaf()) { if (!getTreeLeaf() @@ -3834,7 +3720,7 @@ public int hashCode() { int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + CLIENTUUID_FIELD_NUMBER; - hash = (53 * hash) + getClientuuid().hashCode(); + hash = (53 * hash) + getClientuuid(); if (hasTreeLeaf()) { hash = (37 * hash) + TREELEAF_FIELD_NUMBER; hash = (53 * hash) + getTreeLeaf().hashCode(); @@ -3972,7 +3858,7 @@ private void maybeForceBuilderInitialization() { @java.lang.Override public Builder clear() { super.clear(); - clientuuid_ = ""; + clientuuid_ = 0; if (treeLeafBuilder_ == null) { treeLeaf_ = null; @@ -4060,9 +3946,8 @@ public Builder mergeFrom(com.google.protobuf.Message other) { public Builder mergeFrom(com.intel.analytics.bigdl.ppml.fl.generated.FGBoostServiceProto.UploadTreeLeafRequest other) { if (other == com.intel.analytics.bigdl.ppml.fl.generated.FGBoostServiceProto.UploadTreeLeafRequest.getDefaultInstance()) return this; - if (!other.getClientuuid().isEmpty()) { - clientuuid_ = other.clientuuid_; - onChanged(); + if (other.getClientuuid() != 0) { + setClientuuid(other.getClientuuid()); } if (other.hasTreeLeaf()) { mergeTreeLeaf(other.getTreeLeaf()); @@ -4096,78 +3981,33 @@ public Builder mergeFrom( return this; } - private java.lang.Object clientuuid_ = ""; + private int clientuuid_ ; /** - * string clientuuid = 1; + * int32 clientuuid = 1; * @return The clientuuid. */ - public java.lang.String getClientuuid() { - java.lang.Object ref = clientuuid_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - clientuuid_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string clientuuid = 1; - * @return The bytes for clientuuid. - */ - public com.google.protobuf.ByteString - getClientuuidBytes() { - java.lang.Object ref = clientuuid_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - clientuuid_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + @java.lang.Override + public int getClientuuid() { + return clientuuid_; } /** - * string clientuuid = 1; + * int32 clientuuid = 1; * @param value The clientuuid to set. * @return This builder for chaining. */ - public Builder setClientuuid( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - + public Builder setClientuuid(int value) { + clientuuid_ = value; onChanged(); return this; } /** - * string clientuuid = 1; + * int32 clientuuid = 1; * @return This builder for chaining. */ public Builder clearClientuuid() { - clientuuid_ = getDefaultInstance().getClientuuid(); - onChanged(); - return this; - } - /** - * string clientuuid = 1; - * @param value The bytes for clientuuid to set. - * @return This builder for chaining. - */ - public Builder setClientuuidBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - clientuuid_ = value; + clientuuid_ = 0; onChanged(); return this; } @@ -8753,16 +8593,10 @@ public interface RegisterRequestOrBuilder extends com.google.protobuf.MessageOrBuilder { /** - * string clientuuid = 1; + * int32 clientuuid = 1; * @return The clientuuid. */ - java.lang.String getClientuuid(); - /** - * string clientuuid = 1; - * @return The bytes for clientuuid. - */ - com.google.protobuf.ByteString - getClientuuidBytes(); + int getClientuuid(); /** * string token = 2; @@ -8789,7 +8623,6 @@ private RegisterRequest(com.google.protobuf.GeneratedMessageV3.Builder builde super(builder); } private RegisterRequest() { - clientuuid_ = ""; token_ = ""; } @@ -8823,10 +8656,9 @@ private RegisterRequest( case 0: done = true; break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); + case 8: { - clientuuid_ = s; + clientuuid_ = input.readInt32(); break; } case 18: { @@ -8868,41 +8700,14 @@ private RegisterRequest( } public static final int CLIENTUUID_FIELD_NUMBER = 1; - private volatile java.lang.Object clientuuid_; + private int clientuuid_; /** - * string clientuuid = 1; + * int32 clientuuid = 1; * @return The clientuuid. */ @java.lang.Override - public java.lang.String getClientuuid() { - java.lang.Object ref = clientuuid_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - clientuuid_ = s; - return s; - } - } - /** - * string clientuuid = 1; - * @return The bytes for clientuuid. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getClientuuidBytes() { - java.lang.Object ref = clientuuid_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - clientuuid_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + public int getClientuuid() { + return clientuuid_; } public static final int TOKEN_FIELD_NUMBER = 2; @@ -8957,8 +8762,8 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getClientuuidBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, clientuuid_); + if (clientuuid_ != 0) { + output.writeInt32(1, clientuuid_); } if (!getTokenBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, token_); @@ -8972,8 +8777,9 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!getClientuuidBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, clientuuid_); + if (clientuuid_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, clientuuid_); } if (!getTokenBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, token_); @@ -8993,8 +8799,8 @@ public boolean equals(final java.lang.Object obj) { } com.intel.analytics.bigdl.ppml.fl.generated.FGBoostServiceProto.RegisterRequest other = (com.intel.analytics.bigdl.ppml.fl.generated.FGBoostServiceProto.RegisterRequest) obj; - if (!getClientuuid() - .equals(other.getClientuuid())) return false; + if (getClientuuid() + != other.getClientuuid()) return false; if (!getToken() .equals(other.getToken())) return false; if (!unknownFields.equals(other.unknownFields)) return false; @@ -9009,7 +8815,7 @@ public int hashCode() { int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + CLIENTUUID_FIELD_NUMBER; - hash = (53 * hash) + getClientuuid().hashCode(); + hash = (53 * hash) + getClientuuid(); hash = (37 * hash) + TOKEN_FIELD_NUMBER; hash = (53 * hash) + getToken().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); @@ -9145,7 +8951,7 @@ private void maybeForceBuilderInitialization() { @java.lang.Override public Builder clear() { super.clear(); - clientuuid_ = ""; + clientuuid_ = 0; token_ = ""; @@ -9225,9 +9031,8 @@ public Builder mergeFrom(com.google.protobuf.Message other) { public Builder mergeFrom(com.intel.analytics.bigdl.ppml.fl.generated.FGBoostServiceProto.RegisterRequest other) { if (other == com.intel.analytics.bigdl.ppml.fl.generated.FGBoostServiceProto.RegisterRequest.getDefaultInstance()) return this; - if (!other.getClientuuid().isEmpty()) { - clientuuid_ = other.clientuuid_; - onChanged(); + if (other.getClientuuid() != 0) { + setClientuuid(other.getClientuuid()); } if (!other.getToken().isEmpty()) { token_ = other.token_; @@ -9262,78 +9067,33 @@ public Builder mergeFrom( return this; } - private java.lang.Object clientuuid_ = ""; + private int clientuuid_ ; /** - * string clientuuid = 1; + * int32 clientuuid = 1; * @return The clientuuid. */ - public java.lang.String getClientuuid() { - java.lang.Object ref = clientuuid_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - clientuuid_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string clientuuid = 1; - * @return The bytes for clientuuid. - */ - public com.google.protobuf.ByteString - getClientuuidBytes() { - java.lang.Object ref = clientuuid_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - clientuuid_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + @java.lang.Override + public int getClientuuid() { + return clientuuid_; } /** - * string clientuuid = 1; + * int32 clientuuid = 1; * @param value The clientuuid to set. * @return This builder for chaining. */ - public Builder setClientuuid( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - + public Builder setClientuuid(int value) { + clientuuid_ = value; onChanged(); return this; } /** - * string clientuuid = 1; + * int32 clientuuid = 1; * @return This builder for chaining. */ public Builder clearClientuuid() { - clientuuid_ = getDefaultInstance().getClientuuid(); - onChanged(); - return this; - } - /** - * string clientuuid = 1; - * @param value The bytes for clientuuid to set. - * @return This builder for chaining. - */ - public Builder setClientuuidBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - clientuuid_ = value; + clientuuid_ = 0; onChanged(); return this; } @@ -10109,16 +9869,10 @@ public interface UploadTreeEvalRequestOrBuilder extends com.google.protobuf.MessageOrBuilder { /** - * string clientuuid = 1; + * int32 clientuuid = 1; * @return The clientuuid. */ - java.lang.String getClientuuid(); - /** - * string clientuuid = 1; - * @return The bytes for clientuuid. - */ - com.google.protobuf.ByteString - getClientuuidBytes(); + int getClientuuid(); /** * int32 version = 2; @@ -10163,7 +9917,6 @@ private UploadTreeEvalRequest(com.google.protobuf.GeneratedMessageV3.Builder super(builder); } private UploadTreeEvalRequest() { - clientuuid_ = ""; treeEval_ = java.util.Collections.emptyList(); } @@ -10198,10 +9951,9 @@ private UploadTreeEvalRequest( case 0: done = true; break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); + case 8: { - clientuuid_ = s; + clientuuid_ = input.readInt32(); break; } case 16: { @@ -10254,41 +10006,14 @@ private UploadTreeEvalRequest( } public static final int CLIENTUUID_FIELD_NUMBER = 1; - private volatile java.lang.Object clientuuid_; + private int clientuuid_; /** - * string clientuuid = 1; + * int32 clientuuid = 1; * @return The clientuuid. */ @java.lang.Override - public java.lang.String getClientuuid() { - java.lang.Object ref = clientuuid_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - clientuuid_ = s; - return s; - } - } - /** - * string clientuuid = 1; - * @return The bytes for clientuuid. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getClientuuidBytes() { - java.lang.Object ref = clientuuid_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - clientuuid_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + public int getClientuuid() { + return clientuuid_; } public static final int VERSION_FIELD_NUMBER = 2; @@ -10356,8 +10081,8 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getClientuuidBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, clientuuid_); + if (clientuuid_ != 0) { + output.writeInt32(1, clientuuid_); } if (version_ != 0) { output.writeInt32(2, version_); @@ -10374,8 +10099,9 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!getClientuuidBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, clientuuid_); + if (clientuuid_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, clientuuid_); } if (version_ != 0) { size += com.google.protobuf.CodedOutputStream @@ -10400,8 +10126,8 @@ public boolean equals(final java.lang.Object obj) { } com.intel.analytics.bigdl.ppml.fl.generated.FGBoostServiceProto.UploadTreeEvalRequest other = (com.intel.analytics.bigdl.ppml.fl.generated.FGBoostServiceProto.UploadTreeEvalRequest) obj; - if (!getClientuuid() - .equals(other.getClientuuid())) return false; + if (getClientuuid() + != other.getClientuuid()) return false; if (getVersion() != other.getVersion()) return false; if (!getTreeEvalList() @@ -10418,7 +10144,7 @@ public int hashCode() { int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + CLIENTUUID_FIELD_NUMBER; - hash = (53 * hash) + getClientuuid().hashCode(); + hash = (53 * hash) + getClientuuid(); hash = (37 * hash) + VERSION_FIELD_NUMBER; hash = (53 * hash) + getVersion(); if (getTreeEvalCount() > 0) { @@ -10559,7 +10285,7 @@ private void maybeForceBuilderInitialization() { @java.lang.Override public Builder clear() { super.clear(); - clientuuid_ = ""; + clientuuid_ = 0; version_ = 0; @@ -10655,9 +10381,8 @@ public Builder mergeFrom(com.google.protobuf.Message other) { public Builder mergeFrom(com.intel.analytics.bigdl.ppml.fl.generated.FGBoostServiceProto.UploadTreeEvalRequest other) { if (other == com.intel.analytics.bigdl.ppml.fl.generated.FGBoostServiceProto.UploadTreeEvalRequest.getDefaultInstance()) return this; - if (!other.getClientuuid().isEmpty()) { - clientuuid_ = other.clientuuid_; - onChanged(); + if (other.getClientuuid() != 0) { + setClientuuid(other.getClientuuid()); } if (other.getVersion() != 0) { setVersion(other.getVersion()); @@ -10718,78 +10443,33 @@ public Builder mergeFrom( } private int bitField0_; - private java.lang.Object clientuuid_ = ""; + private int clientuuid_ ; /** - * string clientuuid = 1; + * int32 clientuuid = 1; * @return The clientuuid. */ - public java.lang.String getClientuuid() { - java.lang.Object ref = clientuuid_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - clientuuid_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string clientuuid = 1; - * @return The bytes for clientuuid. - */ - public com.google.protobuf.ByteString - getClientuuidBytes() { - java.lang.Object ref = clientuuid_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - clientuuid_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + @java.lang.Override + public int getClientuuid() { + return clientuuid_; } /** - * string clientuuid = 1; + * int32 clientuuid = 1; * @param value The clientuuid to set. * @return This builder for chaining. */ - public Builder setClientuuid( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - + public Builder setClientuuid(int value) { + clientuuid_ = value; onChanged(); return this; } /** - * string clientuuid = 1; + * int32 clientuuid = 1; * @return This builder for chaining. */ public Builder clearClientuuid() { - clientuuid_ = getDefaultInstance().getClientuuid(); - onChanged(); - return this; - } - /** - * string clientuuid = 1; - * @param value The bytes for clientuuid to set. - * @return This builder for chaining. - */ - public Builder setClientuuidBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - clientuuid_ = value; + clientuuid_ = 0; onChanged(); return this; } @@ -11122,16 +10802,10 @@ public interface EvaluateRequestOrBuilder extends com.google.protobuf.MessageOrBuilder { /** - * string clientuuid = 1; + * int32 clientuuid = 1; * @return The clientuuid. */ - java.lang.String getClientuuid(); - /** - * string clientuuid = 1; - * @return The bytes for clientuuid. - */ - com.google.protobuf.ByteString - getClientuuidBytes(); + int getClientuuid(); /** * repeated .fgboost.BoostEval treeEval = 2; @@ -11182,7 +10856,6 @@ private EvaluateRequest(com.google.protobuf.GeneratedMessageV3.Builder builde super(builder); } private EvaluateRequest() { - clientuuid_ = ""; treeEval_ = java.util.Collections.emptyList(); } @@ -11217,10 +10890,9 @@ private EvaluateRequest( case 0: done = true; break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); + case 8: { - clientuuid_ = s; + clientuuid_ = input.readInt32(); break; } case 18: { @@ -11278,41 +10950,14 @@ private EvaluateRequest( } public static final int CLIENTUUID_FIELD_NUMBER = 1; - private volatile java.lang.Object clientuuid_; + private int clientuuid_; /** - * string clientuuid = 1; + * int32 clientuuid = 1; * @return The clientuuid. */ @java.lang.Override - public java.lang.String getClientuuid() { - java.lang.Object ref = clientuuid_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - clientuuid_ = s; - return s; - } - } - /** - * string clientuuid = 1; - * @return The bytes for clientuuid. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getClientuuidBytes() { - java.lang.Object ref = clientuuid_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - clientuuid_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + public int getClientuuid() { + return clientuuid_; } public static final int TREEEVAL_FIELD_NUMBER = 2; @@ -11391,8 +11036,8 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getClientuuidBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, clientuuid_); + if (clientuuid_ != 0) { + output.writeInt32(1, clientuuid_); } for (int i = 0; i < treeEval_.size(); i++) { output.writeMessage(2, treeEval_.get(i)); @@ -11412,8 +11057,9 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!getClientuuidBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, clientuuid_); + if (clientuuid_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, clientuuid_); } for (int i = 0; i < treeEval_.size(); i++) { size += com.google.protobuf.CodedOutputStream @@ -11442,8 +11088,8 @@ public boolean equals(final java.lang.Object obj) { } com.intel.analytics.bigdl.ppml.fl.generated.FGBoostServiceProto.EvaluateRequest other = (com.intel.analytics.bigdl.ppml.fl.generated.FGBoostServiceProto.EvaluateRequest) obj; - if (!getClientuuid() - .equals(other.getClientuuid())) return false; + if (getClientuuid() + != other.getClientuuid()) return false; if (!getTreeEvalList() .equals(other.getTreeEvalList())) return false; if (getVersion() @@ -11462,7 +11108,7 @@ public int hashCode() { int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + CLIENTUUID_FIELD_NUMBER; - hash = (53 * hash) + getClientuuid().hashCode(); + hash = (53 * hash) + getClientuuid(); if (getTreeEvalCount() > 0) { hash = (37 * hash) + TREEEVAL_FIELD_NUMBER; hash = (53 * hash) + getTreeEvalList().hashCode(); @@ -11606,7 +11252,7 @@ private void maybeForceBuilderInitialization() { @java.lang.Override public Builder clear() { super.clear(); - clientuuid_ = ""; + clientuuid_ = 0; if (treeEvalBuilder_ == null) { treeEval_ = java.util.Collections.emptyList(); @@ -11705,9 +11351,8 @@ public Builder mergeFrom(com.google.protobuf.Message other) { public Builder mergeFrom(com.intel.analytics.bigdl.ppml.fl.generated.FGBoostServiceProto.EvaluateRequest other) { if (other == com.intel.analytics.bigdl.ppml.fl.generated.FGBoostServiceProto.EvaluateRequest.getDefaultInstance()) return this; - if (!other.getClientuuid().isEmpty()) { - clientuuid_ = other.clientuuid_; - onChanged(); + if (other.getClientuuid() != 0) { + setClientuuid(other.getClientuuid()); } if (treeEvalBuilder_ == null) { if (!other.treeEval_.isEmpty()) { @@ -11771,78 +11416,33 @@ public Builder mergeFrom( } private int bitField0_; - private java.lang.Object clientuuid_ = ""; + private int clientuuid_ ; /** - * string clientuuid = 1; + * int32 clientuuid = 1; * @return The clientuuid. */ - public java.lang.String getClientuuid() { - java.lang.Object ref = clientuuid_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - clientuuid_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string clientuuid = 1; - * @return The bytes for clientuuid. - */ - public com.google.protobuf.ByteString - getClientuuidBytes() { - java.lang.Object ref = clientuuid_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - clientuuid_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + @java.lang.Override + public int getClientuuid() { + return clientuuid_; } /** - * string clientuuid = 1; + * int32 clientuuid = 1; * @param value The clientuuid to set. * @return This builder for chaining. */ - public Builder setClientuuid( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - + public Builder setClientuuid(int value) { + clientuuid_ = value; onChanged(); return this; } /** - * string clientuuid = 1; + * int32 clientuuid = 1; * @return This builder for chaining. */ public Builder clearClientuuid() { - clientuuid_ = getDefaultInstance().getClientuuid(); - onChanged(); - return this; - } - /** - * string clientuuid = 1; - * @param value The bytes for clientuuid to set. - * @return This builder for chaining. - */ - public Builder setClientuuidBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - clientuuid_ = value; + clientuuid_ = 0; onChanged(); return this; } @@ -13197,16 +12797,10 @@ public interface PredictRequestOrBuilder extends com.google.protobuf.MessageOrBuilder { /** - * string clientuuid = 1; + * int32 clientuuid = 1; * @return The clientuuid. */ - java.lang.String getClientuuid(); - /** - * string clientuuid = 1; - * @return The bytes for clientuuid. - */ - com.google.protobuf.ByteString - getClientuuidBytes(); + int getClientuuid(); /** * repeated .fgboost.BoostEval treeEval = 2; @@ -13257,7 +12851,6 @@ private PredictRequest(com.google.protobuf.GeneratedMessageV3.Builder builder super(builder); } private PredictRequest() { - clientuuid_ = ""; treeEval_ = java.util.Collections.emptyList(); } @@ -13292,10 +12885,9 @@ private PredictRequest( case 0: done = true; break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); + case 8: { - clientuuid_ = s; + clientuuid_ = input.readInt32(); break; } case 18: { @@ -13353,41 +12945,14 @@ private PredictRequest( } public static final int CLIENTUUID_FIELD_NUMBER = 1; - private volatile java.lang.Object clientuuid_; + private int clientuuid_; /** - * string clientuuid = 1; + * int32 clientuuid = 1; * @return The clientuuid. */ @java.lang.Override - public java.lang.String getClientuuid() { - java.lang.Object ref = clientuuid_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - clientuuid_ = s; - return s; - } - } - /** - * string clientuuid = 1; - * @return The bytes for clientuuid. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getClientuuidBytes() { - java.lang.Object ref = clientuuid_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - clientuuid_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + public int getClientuuid() { + return clientuuid_; } public static final int TREEEVAL_FIELD_NUMBER = 2; @@ -13466,8 +13031,8 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getClientuuidBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, clientuuid_); + if (clientuuid_ != 0) { + output.writeInt32(1, clientuuid_); } for (int i = 0; i < treeEval_.size(); i++) { output.writeMessage(2, treeEval_.get(i)); @@ -13487,8 +13052,9 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!getClientuuidBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, clientuuid_); + if (clientuuid_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, clientuuid_); } for (int i = 0; i < treeEval_.size(); i++) { size += com.google.protobuf.CodedOutputStream @@ -13517,8 +13083,8 @@ public boolean equals(final java.lang.Object obj) { } com.intel.analytics.bigdl.ppml.fl.generated.FGBoostServiceProto.PredictRequest other = (com.intel.analytics.bigdl.ppml.fl.generated.FGBoostServiceProto.PredictRequest) obj; - if (!getClientuuid() - .equals(other.getClientuuid())) return false; + if (getClientuuid() + != other.getClientuuid()) return false; if (!getTreeEvalList() .equals(other.getTreeEvalList())) return false; if (getVersion() @@ -13537,7 +13103,7 @@ public int hashCode() { int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + CLIENTUUID_FIELD_NUMBER; - hash = (53 * hash) + getClientuuid().hashCode(); + hash = (53 * hash) + getClientuuid(); if (getTreeEvalCount() > 0) { hash = (37 * hash) + TREEEVAL_FIELD_NUMBER; hash = (53 * hash) + getTreeEvalList().hashCode(); @@ -13681,7 +13247,7 @@ private void maybeForceBuilderInitialization() { @java.lang.Override public Builder clear() { super.clear(); - clientuuid_ = ""; + clientuuid_ = 0; if (treeEvalBuilder_ == null) { treeEval_ = java.util.Collections.emptyList(); @@ -13780,9 +13346,8 @@ public Builder mergeFrom(com.google.protobuf.Message other) { public Builder mergeFrom(com.intel.analytics.bigdl.ppml.fl.generated.FGBoostServiceProto.PredictRequest other) { if (other == com.intel.analytics.bigdl.ppml.fl.generated.FGBoostServiceProto.PredictRequest.getDefaultInstance()) return this; - if (!other.getClientuuid().isEmpty()) { - clientuuid_ = other.clientuuid_; - onChanged(); + if (other.getClientuuid() != 0) { + setClientuuid(other.getClientuuid()); } if (treeEvalBuilder_ == null) { if (!other.treeEval_.isEmpty()) { @@ -13846,78 +13411,33 @@ public Builder mergeFrom( } private int bitField0_; - private java.lang.Object clientuuid_ = ""; + private int clientuuid_ ; /** - * string clientuuid = 1; + * int32 clientuuid = 1; * @return The clientuuid. */ - public java.lang.String getClientuuid() { - java.lang.Object ref = clientuuid_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - clientuuid_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string clientuuid = 1; - * @return The bytes for clientuuid. - */ - public com.google.protobuf.ByteString - getClientuuidBytes() { - java.lang.Object ref = clientuuid_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - clientuuid_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + @java.lang.Override + public int getClientuuid() { + return clientuuid_; } /** - * string clientuuid = 1; + * int32 clientuuid = 1; * @param value The clientuuid to set. * @return This builder for chaining. */ - public Builder setClientuuid( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - + public Builder setClientuuid(int value) { + clientuuid_ = value; onChanged(); return this; } /** - * string clientuuid = 1; + * int32 clientuuid = 1; * @return This builder for chaining. */ public Builder clearClientuuid() { - clientuuid_ = getDefaultInstance().getClientuuid(); - onChanged(); - return this; - } - /** - * string clientuuid = 1; - * @param value The bytes for clientuuid to set. - * @return This builder for chaining. - */ - public Builder setClientuuidBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - clientuuid_ = value; + clientuuid_ = 0; onChanged(); return this; } @@ -14281,16 +13801,10 @@ public interface SplitRequestOrBuilder extends com.google.protobuf.MessageOrBuilder { /** - * string clientuuid = 1; + * int32 clientuuid = 1; * @return The clientuuid. */ - java.lang.String getClientuuid(); - /** - * string clientuuid = 1; - * @return The bytes for clientuuid. - */ - com.google.protobuf.ByteString - getClientuuidBytes(); + int getClientuuid(); /** * .fgboost.DataSplit split = 2; @@ -14320,7 +13834,6 @@ private SplitRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) super(builder); } private SplitRequest() { - clientuuid_ = ""; } @java.lang.Override @@ -14353,10 +13866,9 @@ private SplitRequest( case 0: done = true; break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); + case 8: { - clientuuid_ = s; + clientuuid_ = input.readInt32(); break; } case 18: { @@ -14405,41 +13917,14 @@ private SplitRequest( } public static final int CLIENTUUID_FIELD_NUMBER = 1; - private volatile java.lang.Object clientuuid_; + private int clientuuid_; /** - * string clientuuid = 1; + * int32 clientuuid = 1; * @return The clientuuid. */ @java.lang.Override - public java.lang.String getClientuuid() { - java.lang.Object ref = clientuuid_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - clientuuid_ = s; - return s; - } - } - /** - * string clientuuid = 1; - * @return The bytes for clientuuid. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getClientuuidBytes() { - java.lang.Object ref = clientuuid_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - clientuuid_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + public int getClientuuid() { + return clientuuid_; } public static final int SPLIT_FIELD_NUMBER = 2; @@ -14482,8 +13967,8 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getClientuuidBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, clientuuid_); + if (clientuuid_ != 0) { + output.writeInt32(1, clientuuid_); } if (split_ != null) { output.writeMessage(2, getSplit()); @@ -14497,8 +13982,9 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!getClientuuidBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, clientuuid_); + if (clientuuid_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, clientuuid_); } if (split_ != null) { size += com.google.protobuf.CodedOutputStream @@ -14519,8 +14005,8 @@ public boolean equals(final java.lang.Object obj) { } com.intel.analytics.bigdl.ppml.fl.generated.FGBoostServiceProto.SplitRequest other = (com.intel.analytics.bigdl.ppml.fl.generated.FGBoostServiceProto.SplitRequest) obj; - if (!getClientuuid() - .equals(other.getClientuuid())) return false; + if (getClientuuid() + != other.getClientuuid()) return false; if (hasSplit() != other.hasSplit()) return false; if (hasSplit()) { if (!getSplit() @@ -14538,7 +14024,7 @@ public int hashCode() { int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + CLIENTUUID_FIELD_NUMBER; - hash = (53 * hash) + getClientuuid().hashCode(); + hash = (53 * hash) + getClientuuid(); if (hasSplit()) { hash = (37 * hash) + SPLIT_FIELD_NUMBER; hash = (53 * hash) + getSplit().hashCode(); @@ -14676,7 +14162,7 @@ private void maybeForceBuilderInitialization() { @java.lang.Override public Builder clear() { super.clear(); - clientuuid_ = ""; + clientuuid_ = 0; if (splitBuilder_ == null) { split_ = null; @@ -14764,9 +14250,8 @@ public Builder mergeFrom(com.google.protobuf.Message other) { public Builder mergeFrom(com.intel.analytics.bigdl.ppml.fl.generated.FGBoostServiceProto.SplitRequest other) { if (other == com.intel.analytics.bigdl.ppml.fl.generated.FGBoostServiceProto.SplitRequest.getDefaultInstance()) return this; - if (!other.getClientuuid().isEmpty()) { - clientuuid_ = other.clientuuid_; - onChanged(); + if (other.getClientuuid() != 0) { + setClientuuid(other.getClientuuid()); } if (other.hasSplit()) { mergeSplit(other.getSplit()); @@ -14800,78 +14285,33 @@ public Builder mergeFrom( return this; } - private java.lang.Object clientuuid_ = ""; + private int clientuuid_ ; /** - * string clientuuid = 1; + * int32 clientuuid = 1; * @return The clientuuid. */ - public java.lang.String getClientuuid() { - java.lang.Object ref = clientuuid_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - clientuuid_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string clientuuid = 1; - * @return The bytes for clientuuid. - */ - public com.google.protobuf.ByteString - getClientuuidBytes() { - java.lang.Object ref = clientuuid_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - clientuuid_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + @java.lang.Override + public int getClientuuid() { + return clientuuid_; } /** - * string clientuuid = 1; + * int32 clientuuid = 1; * @param value The clientuuid to set. * @return This builder for chaining. */ - public Builder setClientuuid( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - + public Builder setClientuuid(int value) { + clientuuid_ = value; onChanged(); return this; } /** - * string clientuuid = 1; + * int32 clientuuid = 1; * @return This builder for chaining. */ public Builder clearClientuuid() { - clientuuid_ = getDefaultInstance().getClientuuid(); - onChanged(); - return this; - } - /** - * string clientuuid = 1; - * @param value The bytes for clientuuid to set. - * @return This builder for chaining. - */ - public Builder setClientuuidBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - clientuuid_ = value; + clientuuid_ = 0; onChanged(); return this; } @@ -16734,16 +16174,10 @@ public interface SaveModelRequestOrBuilder extends com.google.protobuf.MessageOrBuilder { /** - * string clientuuid = 1; + * int32 clientuuid = 1; * @return The clientuuid. */ - java.lang.String getClientuuid(); - /** - * string clientuuid = 1; - * @return The bytes for clientuuid. - */ - com.google.protobuf.ByteString - getClientuuidBytes(); + int getClientuuid(); /** * string modelPath = 2; @@ -16770,7 +16204,6 @@ private SaveModelRequest(com.google.protobuf.GeneratedMessageV3.Builder build super(builder); } private SaveModelRequest() { - clientuuid_ = ""; modelPath_ = ""; } @@ -16804,10 +16237,9 @@ private SaveModelRequest( case 0: done = true; break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); + case 8: { - clientuuid_ = s; + clientuuid_ = input.readInt32(); break; } case 18: { @@ -16849,41 +16281,14 @@ private SaveModelRequest( } public static final int CLIENTUUID_FIELD_NUMBER = 1; - private volatile java.lang.Object clientuuid_; + private int clientuuid_; /** - * string clientuuid = 1; + * int32 clientuuid = 1; * @return The clientuuid. */ @java.lang.Override - public java.lang.String getClientuuid() { - java.lang.Object ref = clientuuid_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - clientuuid_ = s; - return s; - } - } - /** - * string clientuuid = 1; - * @return The bytes for clientuuid. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getClientuuidBytes() { - java.lang.Object ref = clientuuid_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - clientuuid_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + public int getClientuuid() { + return clientuuid_; } public static final int MODELPATH_FIELD_NUMBER = 2; @@ -16938,8 +16343,8 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getClientuuidBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, clientuuid_); + if (clientuuid_ != 0) { + output.writeInt32(1, clientuuid_); } if (!getModelPathBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, modelPath_); @@ -16953,8 +16358,9 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!getClientuuidBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, clientuuid_); + if (clientuuid_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, clientuuid_); } if (!getModelPathBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, modelPath_); @@ -16974,8 +16380,8 @@ public boolean equals(final java.lang.Object obj) { } com.intel.analytics.bigdl.ppml.fl.generated.FGBoostServiceProto.SaveModelRequest other = (com.intel.analytics.bigdl.ppml.fl.generated.FGBoostServiceProto.SaveModelRequest) obj; - if (!getClientuuid() - .equals(other.getClientuuid())) return false; + if (getClientuuid() + != other.getClientuuid()) return false; if (!getModelPath() .equals(other.getModelPath())) return false; if (!unknownFields.equals(other.unknownFields)) return false; @@ -16990,7 +16396,7 @@ public int hashCode() { int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + CLIENTUUID_FIELD_NUMBER; - hash = (53 * hash) + getClientuuid().hashCode(); + hash = (53 * hash) + getClientuuid(); hash = (37 * hash) + MODELPATH_FIELD_NUMBER; hash = (53 * hash) + getModelPath().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); @@ -17126,7 +16532,7 @@ private void maybeForceBuilderInitialization() { @java.lang.Override public Builder clear() { super.clear(); - clientuuid_ = ""; + clientuuid_ = 0; modelPath_ = ""; @@ -17206,9 +16612,8 @@ public Builder mergeFrom(com.google.protobuf.Message other) { public Builder mergeFrom(com.intel.analytics.bigdl.ppml.fl.generated.FGBoostServiceProto.SaveModelRequest other) { if (other == com.intel.analytics.bigdl.ppml.fl.generated.FGBoostServiceProto.SaveModelRequest.getDefaultInstance()) return this; - if (!other.getClientuuid().isEmpty()) { - clientuuid_ = other.clientuuid_; - onChanged(); + if (other.getClientuuid() != 0) { + setClientuuid(other.getClientuuid()); } if (!other.getModelPath().isEmpty()) { modelPath_ = other.modelPath_; @@ -17243,78 +16648,33 @@ public Builder mergeFrom( return this; } - private java.lang.Object clientuuid_ = ""; + private int clientuuid_ ; /** - * string clientuuid = 1; + * int32 clientuuid = 1; * @return The clientuuid. */ - public java.lang.String getClientuuid() { - java.lang.Object ref = clientuuid_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - clientuuid_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string clientuuid = 1; - * @return The bytes for clientuuid. - */ - public com.google.protobuf.ByteString - getClientuuidBytes() { - java.lang.Object ref = clientuuid_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - clientuuid_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + @java.lang.Override + public int getClientuuid() { + return clientuuid_; } /** - * string clientuuid = 1; + * int32 clientuuid = 1; * @param value The clientuuid to set. * @return This builder for chaining. */ - public Builder setClientuuid( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - + public Builder setClientuuid(int value) { + clientuuid_ = value; onChanged(); return this; } /** - * string clientuuid = 1; + * int32 clientuuid = 1; * @return This builder for chaining. */ public Builder clearClientuuid() { - clientuuid_ = getDefaultInstance().getClientuuid(); - onChanged(); - return this; - } - /** - * string clientuuid = 1; - * @param value The bytes for clientuuid to set. - * @return This builder for chaining. - */ - public Builder setClientuuidBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - clientuuid_ = value; + clientuuid_ = 0; onChanged(); return this; } @@ -18090,16 +17450,10 @@ public interface LoadModelRequestOrBuilder extends com.google.protobuf.MessageOrBuilder { /** - * string client_id = 1; + * int32 client_id = 1; * @return The clientId. */ - java.lang.String getClientId(); - /** - * string client_id = 1; - * @return The bytes for clientId. - */ - com.google.protobuf.ByteString - getClientIdBytes(); + int getClientId(); /** * string model_path = 2; @@ -18126,7 +17480,6 @@ private LoadModelRequest(com.google.protobuf.GeneratedMessageV3.Builder build super(builder); } private LoadModelRequest() { - clientId_ = ""; modelPath_ = ""; } @@ -18160,10 +17513,9 @@ private LoadModelRequest( case 0: done = true; break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); + case 8: { - clientId_ = s; + clientId_ = input.readInt32(); break; } case 18: { @@ -18205,41 +17557,14 @@ private LoadModelRequest( } public static final int CLIENT_ID_FIELD_NUMBER = 1; - private volatile java.lang.Object clientId_; + private int clientId_; /** - * string client_id = 1; + * int32 client_id = 1; * @return The clientId. */ @java.lang.Override - public java.lang.String getClientId() { - java.lang.Object ref = clientId_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - clientId_ = s; - return s; - } - } - /** - * string client_id = 1; - * @return The bytes for clientId. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getClientIdBytes() { - java.lang.Object ref = clientId_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - clientId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + public int getClientId() { + return clientId_; } public static final int MODEL_PATH_FIELD_NUMBER = 2; @@ -18294,8 +17619,8 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getClientIdBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, clientId_); + if (clientId_ != 0) { + output.writeInt32(1, clientId_); } if (!getModelPathBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, modelPath_); @@ -18309,8 +17634,9 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!getClientIdBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, clientId_); + if (clientId_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, clientId_); } if (!getModelPathBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, modelPath_); @@ -18330,8 +17656,8 @@ public boolean equals(final java.lang.Object obj) { } com.intel.analytics.bigdl.ppml.fl.generated.FGBoostServiceProto.LoadModelRequest other = (com.intel.analytics.bigdl.ppml.fl.generated.FGBoostServiceProto.LoadModelRequest) obj; - if (!getClientId() - .equals(other.getClientId())) return false; + if (getClientId() + != other.getClientId()) return false; if (!getModelPath() .equals(other.getModelPath())) return false; if (!unknownFields.equals(other.unknownFields)) return false; @@ -18346,7 +17672,7 @@ public int hashCode() { int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + CLIENT_ID_FIELD_NUMBER; - hash = (53 * hash) + getClientId().hashCode(); + hash = (53 * hash) + getClientId(); hash = (37 * hash) + MODEL_PATH_FIELD_NUMBER; hash = (53 * hash) + getModelPath().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); @@ -18482,7 +17808,7 @@ private void maybeForceBuilderInitialization() { @java.lang.Override public Builder clear() { super.clear(); - clientId_ = ""; + clientId_ = 0; modelPath_ = ""; @@ -18562,9 +17888,8 @@ public Builder mergeFrom(com.google.protobuf.Message other) { public Builder mergeFrom(com.intel.analytics.bigdl.ppml.fl.generated.FGBoostServiceProto.LoadModelRequest other) { if (other == com.intel.analytics.bigdl.ppml.fl.generated.FGBoostServiceProto.LoadModelRequest.getDefaultInstance()) return this; - if (!other.getClientId().isEmpty()) { - clientId_ = other.clientId_; - onChanged(); + if (other.getClientId() != 0) { + setClientId(other.getClientId()); } if (!other.getModelPath().isEmpty()) { modelPath_ = other.modelPath_; @@ -18599,78 +17924,33 @@ public Builder mergeFrom( return this; } - private java.lang.Object clientId_ = ""; + private int clientId_ ; /** - * string client_id = 1; + * int32 client_id = 1; * @return The clientId. */ - public java.lang.String getClientId() { - java.lang.Object ref = clientId_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - clientId_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string client_id = 1; - * @return The bytes for clientId. - */ - public com.google.protobuf.ByteString - getClientIdBytes() { - java.lang.Object ref = clientId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - clientId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + @java.lang.Override + public int getClientId() { + return clientId_; } /** - * string client_id = 1; + * int32 client_id = 1; * @param value The clientId to set. * @return This builder for chaining. */ - public Builder setClientId( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - + public Builder setClientId(int value) { + clientId_ = value; onChanged(); return this; } /** - * string client_id = 1; + * int32 client_id = 1; * @return This builder for chaining. */ public Builder clearClientId() { - clientId_ = getDefaultInstance().getClientId(); - onChanged(); - return this; - } - /** - * string client_id = 1; - * @param value The bytes for clientId to set. - * @return This builder for chaining. - */ - public Builder setClientIdBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - clientId_ = value; + clientId_ = 0; onChanged(); return this; } @@ -19567,7 +18847,7 @@ public com.intel.analytics.bigdl.ppml.fl.generated.FGBoostServiceProto.LoadModel java.lang.String[] descriptorData = { "\n\025fgboost_service.proto\022\007fgboost\032\rfl_bas" + "e.proto\"U\n\022UploadLabelRequest\022\022\n\nclientu" + - "uid\030\001 \001(\t\022\030\n\004data\030\002 \001(\0132\n.TensorMap\022\021\n\ta" + + "uid\030\001 \001(\005\022\030\n\004data\030\002 \001(\0132\n.TensorMap\022\021\n\ta" + "lgorithm\030\003 \001(\t\"F\n\024DownloadLabelRequest\022\033" + "\n\010metaData\030\001 \001(\0132\t.MetaData\022\021\n\talgorithm" + "\030\002 \001(\t\"L\n\020DownloadResponse\022\030\n\004data\030\001 \001(\013" + @@ -19575,7 +18855,7 @@ public com.intel.analytics.bigdl.ppml.fl.generated.FGBoostServiceProto.LoadModel " \001(\005\"R\n\010TreeLeaf\022\016\n\006treeID\030\001 \001(\t\022\021\n\tleaf" + "Index\030\002 \003(\005\022\022\n\nleafOutput\030\003 \003(\002\022\017\n\007versi" + "on\030\004 \001(\005\"P\n\025UploadTreeLeafRequest\022\022\n\ncli" + - "entuuid\030\001 \001(\t\022#\n\010treeLeaf\030\002 \001(\0132\021.fgboos" + + "entuuid\030\001 \001(\005\022#\n\010treeLeaf\030\002 \001(\0132\021.fgboos" + "t.TreeLeaf\"\250\001\n\tDataSplit\022\016\n\006treeID\030\001 \001(\t" + "\022\016\n\006nodeID\030\002 \001(\t\022\021\n\tfeatureID\030\003 \001(\005\022\022\n\ns" + "plitValue\030\004 \001(\002\022\014\n\004gain\030\005 \001(\002\022\021\n\tsetLeng" + @@ -19586,29 +18866,29 @@ public com.intel.analytics.bigdl.ppml.fl.generated.FGBoostServiceProto.LoadModel "\"6\n\014BoostPredict\022&\n\010predicts\030\001 \003(\0132\024.fgb" + "oost.TreePredict\"4\n\tBoostEval\022\'\n\tevaluat" + "es\030\001 \003(\0132\024.fgboost.TreePredict\"4\n\017Regist" + - "erRequest\022\022\n\nclientuuid\030\001 \001(\t\022\r\n\005token\030\002" + + "erRequest\022\022\n\nclientuuid\030\001 \001(\005\022\r\n\005token\030\002" + " \001(\t\"2\n\020RegisterResponse\022\020\n\010response\030\001 \001" + "(\t\022\014\n\004code\030\002 \001(\005\"b\n\025UploadTreeEvalReques" + - "t\022\022\n\nclientuuid\030\001 \001(\t\022\017\n\007version\030\002 \001(\005\022$" + + "t\022\022\n\nclientuuid\030\001 \001(\005\022\017\n\007version\030\002 \001(\005\022$" + "\n\010treeEval\030\003 \003(\0132\022.fgboost.BoostEval\"o\n\017" + - "EvaluateRequest\022\022\n\nclientuuid\030\001 \001(\t\022$\n\010t" + + "EvaluateRequest\022\022\n\nclientuuid\030\001 \001(\005\022$\n\010t" + "reeEval\030\002 \003(\0132\022.fgboost.BoostEval\022\017\n\007ver" + "sion\030\003 \001(\005\022\021\n\tlastBatch\030\004 \001(\010\"]\n\020Evaluat" + "eResponse\022\020\n\010response\030\001 \001(\t\022\030\n\004data\030\002 \001(" + "\0132\n.TensorMap\022\014\n\004code\030\003 \001(\005\022\017\n\007message\030\004" + " \001(\t\"n\n\016PredictRequest\022\022\n\nclientuuid\030\001 \001" + - "(\t\022$\n\010treeEval\030\002 \003(\0132\022.fgboost.BoostEval" + + "(\005\022$\n\010treeEval\030\002 \003(\0132\022.fgboost.BoostEval" + "\022\017\n\007version\030\003 \001(\005\022\021\n\tlastBatch\030\004 \001(\010\"E\n\014" + - "SplitRequest\022\022\n\nclientuuid\030\001 \001(\t\022!\n\005spli" + + "SplitRequest\022\022\n\nclientuuid\030\001 \001(\005\022!\n\005spli" + "t\030\002 \001(\0132\022.fgboost.DataSplit\"K\n\017PredictRe" + "sponse\022\020\n\010response\030\001 \001(\t\022\030\n\004data\030\002 \001(\0132\n" + ".TensorMap\022\014\n\004code\030\003 \001(\005\"R\n\rSplitRespons" + "e\022!\n\005split\030\001 \001(\0132\022.fgboost.DataSplit\022\020\n\010" + "response\030\002 \001(\t\022\014\n\004code\030\003 \001(\005\"9\n\020SaveMode" + - "lRequest\022\022\n\nclientuuid\030\001 \001(\t\022\021\n\tmodelPat" + + "lRequest\022\022\n\nclientuuid\030\001 \001(\005\022\021\n\tmodelPat" + "h\030\002 \001(\t\"2\n\021SaveModelResponse\022\017\n\007message\030" + "\001 \001(\t\022\014\n\004code\030\002 \001(\005\"9\n\020LoadModelRequest\022" + - "\021\n\tclient_id\030\001 \001(\t\022\022\n\nmodel_path\030\002 \001(\t\"2" + + "\021\n\tclient_id\030\001 \001(\005\022\022\n\nmodel_path\030\002 \001(\t\"2" + "\n\021LoadModelResponse\022\017\n\007message\030\001 \001(\t\022\014\n\004" + "code\030\002 \001(\0052\211\005\n\016FGBoostService\022E\n\013uploadL" + "abel\022\033.fgboost.UploadLabelRequest\032\027.fgbo" + diff --git a/scala/ppml/src/main/java/com/intel/analytics/bigdl/ppml/fl/generated/NNServiceProto.java b/scala/ppml/src/main/java/com/intel/analytics/bigdl/ppml/fl/generated/NNServiceProto.java index 5de5535404b..41f18ca8e5f 100644 --- a/scala/ppml/src/main/java/com/intel/analytics/bigdl/ppml/fl/generated/NNServiceProto.java +++ b/scala/ppml/src/main/java/com/intel/analytics/bigdl/ppml/fl/generated/NNServiceProto.java @@ -19,16 +19,10 @@ public interface TrainRequestOrBuilder extends com.google.protobuf.MessageOrBuilder { /** - * string clientuuid = 1; + * int32 clientuuid = 1; * @return The clientuuid. */ - java.lang.String getClientuuid(); - /** - * string clientuuid = 1; - * @return The bytes for clientuuid. - */ - com.google.protobuf.ByteString - getClientuuidBytes(); + int getClientuuid(); /** * .TensorMap data = 2; @@ -70,7 +64,6 @@ private TrainRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) super(builder); } private TrainRequest() { - clientuuid_ = ""; algorithm_ = ""; } @@ -104,10 +97,9 @@ private TrainRequest( case 0: done = true; break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); + case 8: { - clientuuid_ = s; + clientuuid_ = input.readInt32(); break; } case 18: { @@ -162,41 +154,14 @@ private TrainRequest( } public static final int CLIENTUUID_FIELD_NUMBER = 1; - private volatile java.lang.Object clientuuid_; + private int clientuuid_; /** - * string clientuuid = 1; + * int32 clientuuid = 1; * @return The clientuuid. */ @java.lang.Override - public java.lang.String getClientuuid() { - java.lang.Object ref = clientuuid_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - clientuuid_ = s; - return s; - } - } - /** - * string clientuuid = 1; - * @return The bytes for clientuuid. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getClientuuidBytes() { - java.lang.Object ref = clientuuid_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - clientuuid_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + public int getClientuuid() { + return clientuuid_; } public static final int DATA_FIELD_NUMBER = 2; @@ -277,8 +242,8 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getClientuuidBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, clientuuid_); + if (clientuuid_ != 0) { + output.writeInt32(1, clientuuid_); } if (data_ != null) { output.writeMessage(2, getData()); @@ -295,8 +260,9 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!getClientuuidBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, clientuuid_); + if (clientuuid_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, clientuuid_); } if (data_ != null) { size += com.google.protobuf.CodedOutputStream @@ -320,8 +286,8 @@ public boolean equals(final java.lang.Object obj) { } com.intel.analytics.bigdl.ppml.fl.generated.NNServiceProto.TrainRequest other = (com.intel.analytics.bigdl.ppml.fl.generated.NNServiceProto.TrainRequest) obj; - if (!getClientuuid() - .equals(other.getClientuuid())) return false; + if (getClientuuid() + != other.getClientuuid()) return false; if (hasData() != other.hasData()) return false; if (hasData()) { if (!getData() @@ -341,7 +307,7 @@ public int hashCode() { int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + CLIENTUUID_FIELD_NUMBER; - hash = (53 * hash) + getClientuuid().hashCode(); + hash = (53 * hash) + getClientuuid(); if (hasData()) { hash = (37 * hash) + DATA_FIELD_NUMBER; hash = (53 * hash) + getData().hashCode(); @@ -481,7 +447,7 @@ private void maybeForceBuilderInitialization() { @java.lang.Override public Builder clear() { super.clear(); - clientuuid_ = ""; + clientuuid_ = 0; if (dataBuilder_ == null) { data_ = null; @@ -572,9 +538,8 @@ public Builder mergeFrom(com.google.protobuf.Message other) { public Builder mergeFrom(com.intel.analytics.bigdl.ppml.fl.generated.NNServiceProto.TrainRequest other) { if (other == com.intel.analytics.bigdl.ppml.fl.generated.NNServiceProto.TrainRequest.getDefaultInstance()) return this; - if (!other.getClientuuid().isEmpty()) { - clientuuid_ = other.clientuuid_; - onChanged(); + if (other.getClientuuid() != 0) { + setClientuuid(other.getClientuuid()); } if (other.hasData()) { mergeData(other.getData()); @@ -612,78 +577,33 @@ public Builder mergeFrom( return this; } - private java.lang.Object clientuuid_ = ""; + private int clientuuid_ ; /** - * string clientuuid = 1; + * int32 clientuuid = 1; * @return The clientuuid. */ - public java.lang.String getClientuuid() { - java.lang.Object ref = clientuuid_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - clientuuid_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string clientuuid = 1; - * @return The bytes for clientuuid. - */ - public com.google.protobuf.ByteString - getClientuuidBytes() { - java.lang.Object ref = clientuuid_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - clientuuid_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + @java.lang.Override + public int getClientuuid() { + return clientuuid_; } /** - * string clientuuid = 1; + * int32 clientuuid = 1; * @param value The clientuuid to set. * @return This builder for chaining. */ - public Builder setClientuuid( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - + public Builder setClientuuid(int value) { + clientuuid_ = value; onChanged(); return this; } /** - * string clientuuid = 1; + * int32 clientuuid = 1; * @return This builder for chaining. */ public Builder clearClientuuid() { - clientuuid_ = getDefaultInstance().getClientuuid(); - onChanged(); - return this; - } - /** - * string clientuuid = 1; - * @param value The bytes for clientuuid to set. - * @return This builder for chaining. - */ - public Builder setClientuuidBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - clientuuid_ = value; + clientuuid_ = 0; onChanged(); return this; } @@ -1781,16 +1701,10 @@ public interface EvaluateRequestOrBuilder extends com.google.protobuf.MessageOrBuilder { /** - * string clientuuid = 1; + * int32 clientuuid = 1; * @return The clientuuid. */ - java.lang.String getClientuuid(); - /** - * string clientuuid = 1; - * @return The bytes for clientuuid. - */ - com.google.protobuf.ByteString - getClientuuidBytes(); + int getClientuuid(); /** * .TensorMap data = 2; @@ -1838,7 +1752,6 @@ private EvaluateRequest(com.google.protobuf.GeneratedMessageV3.Builder builde super(builder); } private EvaluateRequest() { - clientuuid_ = ""; algorithm_ = ""; } @@ -1872,10 +1785,9 @@ private EvaluateRequest( case 0: done = true; break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); + case 8: { - clientuuid_ = s; + clientuuid_ = input.readInt32(); break; } case 18: { @@ -1935,41 +1847,14 @@ private EvaluateRequest( } public static final int CLIENTUUID_FIELD_NUMBER = 1; - private volatile java.lang.Object clientuuid_; + private int clientuuid_; /** - * string clientuuid = 1; + * int32 clientuuid = 1; * @return The clientuuid. */ @java.lang.Override - public java.lang.String getClientuuid() { - java.lang.Object ref = clientuuid_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - clientuuid_ = s; - return s; - } - } - /** - * string clientuuid = 1; - * @return The bytes for clientuuid. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getClientuuidBytes() { - java.lang.Object ref = clientuuid_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - clientuuid_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + public int getClientuuid() { + return clientuuid_; } public static final int DATA_FIELD_NUMBER = 2; @@ -2061,8 +1946,8 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getClientuuidBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, clientuuid_); + if (clientuuid_ != 0) { + output.writeInt32(1, clientuuid_); } if (data_ != null) { output.writeMessage(2, getData()); @@ -2082,8 +1967,9 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!getClientuuidBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, clientuuid_); + if (clientuuid_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, clientuuid_); } if (data_ != null) { size += com.google.protobuf.CodedOutputStream @@ -2111,8 +1997,8 @@ public boolean equals(final java.lang.Object obj) { } com.intel.analytics.bigdl.ppml.fl.generated.NNServiceProto.EvaluateRequest other = (com.intel.analytics.bigdl.ppml.fl.generated.NNServiceProto.EvaluateRequest) obj; - if (!getClientuuid() - .equals(other.getClientuuid())) return false; + if (getClientuuid() + != other.getClientuuid()) return false; if (hasData() != other.hasData()) return false; if (hasData()) { if (!getData() @@ -2134,7 +2020,7 @@ public int hashCode() { int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + CLIENTUUID_FIELD_NUMBER; - hash = (53 * hash) + getClientuuid().hashCode(); + hash = (53 * hash) + getClientuuid(); if (hasData()) { hash = (37 * hash) + DATA_FIELD_NUMBER; hash = (53 * hash) + getData().hashCode(); @@ -2277,7 +2163,7 @@ private void maybeForceBuilderInitialization() { @java.lang.Override public Builder clear() { super.clear(); - clientuuid_ = ""; + clientuuid_ = 0; if (dataBuilder_ == null) { data_ = null; @@ -2371,9 +2257,8 @@ public Builder mergeFrom(com.google.protobuf.Message other) { public Builder mergeFrom(com.intel.analytics.bigdl.ppml.fl.generated.NNServiceProto.EvaluateRequest other) { if (other == com.intel.analytics.bigdl.ppml.fl.generated.NNServiceProto.EvaluateRequest.getDefaultInstance()) return this; - if (!other.getClientuuid().isEmpty()) { - clientuuid_ = other.clientuuid_; - onChanged(); + if (other.getClientuuid() != 0) { + setClientuuid(other.getClientuuid()); } if (other.hasData()) { mergeData(other.getData()); @@ -2414,78 +2299,33 @@ public Builder mergeFrom( return this; } - private java.lang.Object clientuuid_ = ""; + private int clientuuid_ ; /** - * string clientuuid = 1; + * int32 clientuuid = 1; * @return The clientuuid. */ - public java.lang.String getClientuuid() { - java.lang.Object ref = clientuuid_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - clientuuid_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string clientuuid = 1; - * @return The bytes for clientuuid. - */ - public com.google.protobuf.ByteString - getClientuuidBytes() { - java.lang.Object ref = clientuuid_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - clientuuid_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + @java.lang.Override + public int getClientuuid() { + return clientuuid_; } /** - * string clientuuid = 1; + * int32 clientuuid = 1; * @param value The clientuuid to set. * @return This builder for chaining. */ - public Builder setClientuuid( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - + public Builder setClientuuid(int value) { + clientuuid_ = value; onChanged(); return this; } /** - * string clientuuid = 1; + * int32 clientuuid = 1; * @return This builder for chaining. */ public Builder clearClientuuid() { - clientuuid_ = getDefaultInstance().getClientuuid(); - onChanged(); - return this; - } - /** - * string clientuuid = 1; - * @param value The bytes for clientuuid to set. - * @return This builder for chaining. - */ - public Builder setClientuuidBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - clientuuid_ = value; + clientuuid_ = 0; onChanged(); return this; } @@ -3764,16 +3604,10 @@ public interface PredictRequestOrBuilder extends com.google.protobuf.MessageOrBuilder { /** - * string clientuuid = 1; + * int32 clientuuid = 1; * @return The clientuuid. */ - java.lang.String getClientuuid(); - /** - * string clientuuid = 1; - * @return The bytes for clientuuid. - */ - com.google.protobuf.ByteString - getClientuuidBytes(); + int getClientuuid(); /** * .TensorMap data = 2; @@ -3815,7 +3649,6 @@ private PredictRequest(com.google.protobuf.GeneratedMessageV3.Builder builder super(builder); } private PredictRequest() { - clientuuid_ = ""; algorithm_ = ""; } @@ -3849,10 +3682,9 @@ private PredictRequest( case 0: done = true; break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); + case 8: { - clientuuid_ = s; + clientuuid_ = input.readInt32(); break; } case 18: { @@ -3907,41 +3739,14 @@ private PredictRequest( } public static final int CLIENTUUID_FIELD_NUMBER = 1; - private volatile java.lang.Object clientuuid_; + private int clientuuid_; /** - * string clientuuid = 1; + * int32 clientuuid = 1; * @return The clientuuid. */ @java.lang.Override - public java.lang.String getClientuuid() { - java.lang.Object ref = clientuuid_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - clientuuid_ = s; - return s; - } - } - /** - * string clientuuid = 1; - * @return The bytes for clientuuid. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getClientuuidBytes() { - java.lang.Object ref = clientuuid_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - clientuuid_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + public int getClientuuid() { + return clientuuid_; } public static final int DATA_FIELD_NUMBER = 2; @@ -4022,8 +3827,8 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getClientuuidBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, clientuuid_); + if (clientuuid_ != 0) { + output.writeInt32(1, clientuuid_); } if (data_ != null) { output.writeMessage(2, getData()); @@ -4040,8 +3845,9 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!getClientuuidBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, clientuuid_); + if (clientuuid_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, clientuuid_); } if (data_ != null) { size += com.google.protobuf.CodedOutputStream @@ -4065,8 +3871,8 @@ public boolean equals(final java.lang.Object obj) { } com.intel.analytics.bigdl.ppml.fl.generated.NNServiceProto.PredictRequest other = (com.intel.analytics.bigdl.ppml.fl.generated.NNServiceProto.PredictRequest) obj; - if (!getClientuuid() - .equals(other.getClientuuid())) return false; + if (getClientuuid() + != other.getClientuuid()) return false; if (hasData() != other.hasData()) return false; if (hasData()) { if (!getData() @@ -4086,7 +3892,7 @@ public int hashCode() { int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + CLIENTUUID_FIELD_NUMBER; - hash = (53 * hash) + getClientuuid().hashCode(); + hash = (53 * hash) + getClientuuid(); if (hasData()) { hash = (37 * hash) + DATA_FIELD_NUMBER; hash = (53 * hash) + getData().hashCode(); @@ -4226,7 +4032,7 @@ private void maybeForceBuilderInitialization() { @java.lang.Override public Builder clear() { super.clear(); - clientuuid_ = ""; + clientuuid_ = 0; if (dataBuilder_ == null) { data_ = null; @@ -4317,9 +4123,8 @@ public Builder mergeFrom(com.google.protobuf.Message other) { public Builder mergeFrom(com.intel.analytics.bigdl.ppml.fl.generated.NNServiceProto.PredictRequest other) { if (other == com.intel.analytics.bigdl.ppml.fl.generated.NNServiceProto.PredictRequest.getDefaultInstance()) return this; - if (!other.getClientuuid().isEmpty()) { - clientuuid_ = other.clientuuid_; - onChanged(); + if (other.getClientuuid() != 0) { + setClientuuid(other.getClientuuid()); } if (other.hasData()) { mergeData(other.getData()); @@ -4357,78 +4162,33 @@ public Builder mergeFrom( return this; } - private java.lang.Object clientuuid_ = ""; + private int clientuuid_ ; /** - * string clientuuid = 1; + * int32 clientuuid = 1; * @return The clientuuid. */ - public java.lang.String getClientuuid() { - java.lang.Object ref = clientuuid_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - clientuuid_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string clientuuid = 1; - * @return The bytes for clientuuid. - */ - public com.google.protobuf.ByteString - getClientuuidBytes() { - java.lang.Object ref = clientuuid_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - clientuuid_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + @java.lang.Override + public int getClientuuid() { + return clientuuid_; } /** - * string clientuuid = 1; + * int32 clientuuid = 1; * @param value The clientuuid to set. * @return This builder for chaining. */ - public Builder setClientuuid( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - + public Builder setClientuuid(int value) { + clientuuid_ = value; onChanged(); return this; } /** - * string clientuuid = 1; + * int32 clientuuid = 1; * @return This builder for chaining. */ public Builder clearClientuuid() { - clientuuid_ = getDefaultInstance().getClientuuid(); - onChanged(); - return this; - } - /** - * string clientuuid = 1; - * @param value The bytes for clientuuid to set. - * @return This builder for chaining. - */ - public Builder setClientuuidBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - clientuuid_ = value; + clientuuid_ = 0; onChanged(); return this; } @@ -5526,16 +5286,10 @@ public interface UploadMetaRequestOrBuilder extends com.google.protobuf.MessageOrBuilder { /** - * string client_uuid = 1; + * int32 client_uuid = 1; * @return The clientUuid. */ - java.lang.String getClientUuid(); - /** - * string client_uuid = 1; - * @return The bytes for clientUuid. - */ - com.google.protobuf.ByteString - getClientUuidBytes(); + int getClientUuid(); /** * bytes loss_fn = 2; @@ -5583,7 +5337,6 @@ private UploadMetaRequest(com.google.protobuf.GeneratedMessageV3.Builder buil super(builder); } private UploadMetaRequest() { - clientUuid_ = ""; lossFn_ = com.google.protobuf.ByteString.EMPTY; aggregator_ = ""; } @@ -5618,10 +5371,9 @@ private UploadMetaRequest( case 0: done = true; break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); + case 8: { - clientUuid_ = s; + clientUuid_ = input.readInt32(); break; } case 18: { @@ -5681,41 +5433,14 @@ private UploadMetaRequest( } public static final int CLIENT_UUID_FIELD_NUMBER = 1; - private volatile java.lang.Object clientUuid_; + private int clientUuid_; /** - * string client_uuid = 1; + * int32 client_uuid = 1; * @return The clientUuid. */ @java.lang.Override - public java.lang.String getClientUuid() { - java.lang.Object ref = clientUuid_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - clientUuid_ = s; - return s; - } - } - /** - * string client_uuid = 1; - * @return The bytes for clientUuid. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getClientUuidBytes() { - java.lang.Object ref = clientUuid_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - clientUuid_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + public int getClientUuid() { + return clientUuid_; } public static final int LOSS_FN_FIELD_NUMBER = 2; @@ -5807,8 +5532,8 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getClientUuidBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, clientUuid_); + if (clientUuid_ != 0) { + output.writeInt32(1, clientUuid_); } if (!lossFn_.isEmpty()) { output.writeBytes(2, lossFn_); @@ -5828,8 +5553,9 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!getClientUuidBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, clientUuid_); + if (clientUuid_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, clientUuid_); } if (!lossFn_.isEmpty()) { size += com.google.protobuf.CodedOutputStream @@ -5857,8 +5583,8 @@ public boolean equals(final java.lang.Object obj) { } com.intel.analytics.bigdl.ppml.fl.generated.NNServiceProto.UploadMetaRequest other = (com.intel.analytics.bigdl.ppml.fl.generated.NNServiceProto.UploadMetaRequest) obj; - if (!getClientUuid() - .equals(other.getClientUuid())) return false; + if (getClientUuid() + != other.getClientUuid()) return false; if (!getLossFn() .equals(other.getLossFn())) return false; if (hasOptimizer() != other.hasOptimizer()) return false; @@ -5880,7 +5606,7 @@ public int hashCode() { int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + CLIENT_UUID_FIELD_NUMBER; - hash = (53 * hash) + getClientUuid().hashCode(); + hash = (53 * hash) + getClientUuid(); hash = (37 * hash) + LOSS_FN_FIELD_NUMBER; hash = (53 * hash) + getLossFn().hashCode(); if (hasOptimizer()) { @@ -6022,7 +5748,7 @@ private void maybeForceBuilderInitialization() { @java.lang.Override public Builder clear() { super.clear(); - clientUuid_ = ""; + clientUuid_ = 0; lossFn_ = com.google.protobuf.ByteString.EMPTY; @@ -6116,9 +5842,8 @@ public Builder mergeFrom(com.google.protobuf.Message other) { public Builder mergeFrom(com.intel.analytics.bigdl.ppml.fl.generated.NNServiceProto.UploadMetaRequest other) { if (other == com.intel.analytics.bigdl.ppml.fl.generated.NNServiceProto.UploadMetaRequest.getDefaultInstance()) return this; - if (!other.getClientUuid().isEmpty()) { - clientUuid_ = other.clientUuid_; - onChanged(); + if (other.getClientUuid() != 0) { + setClientUuid(other.getClientUuid()); } if (other.getLossFn() != com.google.protobuf.ByteString.EMPTY) { setLossFn(other.getLossFn()); @@ -6159,78 +5884,33 @@ public Builder mergeFrom( return this; } - private java.lang.Object clientUuid_ = ""; + private int clientUuid_ ; /** - * string client_uuid = 1; + * int32 client_uuid = 1; * @return The clientUuid. */ - public java.lang.String getClientUuid() { - java.lang.Object ref = clientUuid_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - clientUuid_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string client_uuid = 1; - * @return The bytes for clientUuid. - */ - public com.google.protobuf.ByteString - getClientUuidBytes() { - java.lang.Object ref = clientUuid_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - clientUuid_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + @java.lang.Override + public int getClientUuid() { + return clientUuid_; } /** - * string client_uuid = 1; + * int32 client_uuid = 1; * @param value The clientUuid to set. * @return This builder for chaining. */ - public Builder setClientUuid( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - + public Builder setClientUuid(int value) { + clientUuid_ = value; onChanged(); return this; } /** - * string client_uuid = 1; + * int32 client_uuid = 1; * @return This builder for chaining. */ public Builder clearClientUuid() { - clientUuid_ = getDefaultInstance().getClientUuid(); - onChanged(); - return this; - } - /** - * string client_uuid = 1; - * @param value The bytes for clientUuid to set. - * @return This builder for chaining. - */ - public Builder setClientUuidBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - clientUuid_ = value; + clientUuid_ = 0; onChanged(); return this; } @@ -8217,16 +7897,10 @@ public interface LoadModelRequestOrBuilder extends com.google.protobuf.MessageOrBuilder { /** - * string client_id = 1; + * int32 client_id = 1; * @return The clientId. */ - java.lang.String getClientId(); - /** - * string client_id = 1; - * @return The bytes for clientId. - */ - com.google.protobuf.ByteString - getClientIdBytes(); + int getClientId(); /** * string backend = 2; @@ -8265,7 +7939,6 @@ private LoadModelRequest(com.google.protobuf.GeneratedMessageV3.Builder build super(builder); } private LoadModelRequest() { - clientId_ = ""; backend_ = ""; modelPath_ = ""; } @@ -8300,10 +7973,9 @@ private LoadModelRequest( case 0: done = true; break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); + case 8: { - clientId_ = s; + clientId_ = input.readInt32(); break; } case 18: { @@ -8351,41 +8023,14 @@ private LoadModelRequest( } public static final int CLIENT_ID_FIELD_NUMBER = 1; - private volatile java.lang.Object clientId_; + private int clientId_; /** - * string client_id = 1; + * int32 client_id = 1; * @return The clientId. */ @java.lang.Override - public java.lang.String getClientId() { - java.lang.Object ref = clientId_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - clientId_ = s; - return s; - } - } - /** - * string client_id = 1; - * @return The bytes for clientId. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getClientIdBytes() { - java.lang.Object ref = clientId_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - clientId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + public int getClientId() { + return clientId_; } public static final int BACKEND_FIELD_NUMBER = 2; @@ -8478,8 +8123,8 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getClientIdBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, clientId_); + if (clientId_ != 0) { + output.writeInt32(1, clientId_); } if (!getBackendBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, backend_); @@ -8496,8 +8141,9 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!getClientIdBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, clientId_); + if (clientId_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, clientId_); } if (!getBackendBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, backend_); @@ -8520,8 +8166,8 @@ public boolean equals(final java.lang.Object obj) { } com.intel.analytics.bigdl.ppml.fl.generated.NNServiceProto.LoadModelRequest other = (com.intel.analytics.bigdl.ppml.fl.generated.NNServiceProto.LoadModelRequest) obj; - if (!getClientId() - .equals(other.getClientId())) return false; + if (getClientId() + != other.getClientId()) return false; if (!getBackend() .equals(other.getBackend())) return false; if (!getModelPath() @@ -8538,7 +8184,7 @@ public int hashCode() { int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + CLIENT_ID_FIELD_NUMBER; - hash = (53 * hash) + getClientId().hashCode(); + hash = (53 * hash) + getClientId(); hash = (37 * hash) + BACKEND_FIELD_NUMBER; hash = (53 * hash) + getBackend().hashCode(); hash = (37 * hash) + MODEL_PATH_FIELD_NUMBER; @@ -8676,7 +8322,7 @@ private void maybeForceBuilderInitialization() { @java.lang.Override public Builder clear() { super.clear(); - clientId_ = ""; + clientId_ = 0; backend_ = ""; @@ -8759,9 +8405,8 @@ public Builder mergeFrom(com.google.protobuf.Message other) { public Builder mergeFrom(com.intel.analytics.bigdl.ppml.fl.generated.NNServiceProto.LoadModelRequest other) { if (other == com.intel.analytics.bigdl.ppml.fl.generated.NNServiceProto.LoadModelRequest.getDefaultInstance()) return this; - if (!other.getClientId().isEmpty()) { - clientId_ = other.clientId_; - onChanged(); + if (other.getClientId() != 0) { + setClientId(other.getClientId()); } if (!other.getBackend().isEmpty()) { backend_ = other.backend_; @@ -8800,78 +8445,33 @@ public Builder mergeFrom( return this; } - private java.lang.Object clientId_ = ""; + private int clientId_ ; /** - * string client_id = 1; + * int32 client_id = 1; * @return The clientId. */ - public java.lang.String getClientId() { - java.lang.Object ref = clientId_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - clientId_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string client_id = 1; - * @return The bytes for clientId. - */ - public com.google.protobuf.ByteString - getClientIdBytes() { - java.lang.Object ref = clientId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - clientId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + @java.lang.Override + public int getClientId() { + return clientId_; } /** - * string client_id = 1; + * int32 client_id = 1; * @param value The clientId to set. * @return This builder for chaining. */ - public Builder setClientId( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - + public Builder setClientId(int value) { + clientId_ = value; onChanged(); return this; } /** - * string client_id = 1; + * int32 client_id = 1; * @return This builder for chaining. */ public Builder clearClientId() { - clientId_ = getDefaultInstance().getClientId(); - onChanged(); - return this; - } - /** - * string client_id = 1; - * @param value The bytes for clientId to set. - * @return This builder for chaining. - */ - public Builder setClientIdBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - clientId_ = value; + clientId_ = 0; onChanged(); return this; } @@ -9723,16 +9323,10 @@ public interface SaveModelRequestOrBuilder extends com.google.protobuf.MessageOrBuilder { /** - * string client_id = 1; + * int32 client_id = 1; * @return The clientId. */ - java.lang.String getClientId(); - /** - * string client_id = 1; - * @return The bytes for clientId. - */ - com.google.protobuf.ByteString - getClientIdBytes(); + int getClientId(); /** * string backend = 2; @@ -9771,7 +9365,6 @@ private SaveModelRequest(com.google.protobuf.GeneratedMessageV3.Builder build super(builder); } private SaveModelRequest() { - clientId_ = ""; backend_ = ""; modelPath_ = ""; } @@ -9806,10 +9399,9 @@ private SaveModelRequest( case 0: done = true; break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); + case 8: { - clientId_ = s; + clientId_ = input.readInt32(); break; } case 18: { @@ -9857,41 +9449,14 @@ private SaveModelRequest( } public static final int CLIENT_ID_FIELD_NUMBER = 1; - private volatile java.lang.Object clientId_; + private int clientId_; /** - * string client_id = 1; + * int32 client_id = 1; * @return The clientId. */ @java.lang.Override - public java.lang.String getClientId() { - java.lang.Object ref = clientId_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - clientId_ = s; - return s; - } - } - /** - * string client_id = 1; - * @return The bytes for clientId. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getClientIdBytes() { - java.lang.Object ref = clientId_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - clientId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + public int getClientId() { + return clientId_; } public static final int BACKEND_FIELD_NUMBER = 2; @@ -9984,8 +9549,8 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getClientIdBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, clientId_); + if (clientId_ != 0) { + output.writeInt32(1, clientId_); } if (!getBackendBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, backend_); @@ -10002,8 +9567,9 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!getClientIdBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, clientId_); + if (clientId_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, clientId_); } if (!getBackendBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, backend_); @@ -10026,8 +9592,8 @@ public boolean equals(final java.lang.Object obj) { } com.intel.analytics.bigdl.ppml.fl.generated.NNServiceProto.SaveModelRequest other = (com.intel.analytics.bigdl.ppml.fl.generated.NNServiceProto.SaveModelRequest) obj; - if (!getClientId() - .equals(other.getClientId())) return false; + if (getClientId() + != other.getClientId()) return false; if (!getBackend() .equals(other.getBackend())) return false; if (!getModelPath() @@ -10044,7 +9610,7 @@ public int hashCode() { int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + CLIENT_ID_FIELD_NUMBER; - hash = (53 * hash) + getClientId().hashCode(); + hash = (53 * hash) + getClientId(); hash = (37 * hash) + BACKEND_FIELD_NUMBER; hash = (53 * hash) + getBackend().hashCode(); hash = (37 * hash) + MODEL_PATH_FIELD_NUMBER; @@ -10182,7 +9748,7 @@ private void maybeForceBuilderInitialization() { @java.lang.Override public Builder clear() { super.clear(); - clientId_ = ""; + clientId_ = 0; backend_ = ""; @@ -10265,9 +9831,8 @@ public Builder mergeFrom(com.google.protobuf.Message other) { public Builder mergeFrom(com.intel.analytics.bigdl.ppml.fl.generated.NNServiceProto.SaveModelRequest other) { if (other == com.intel.analytics.bigdl.ppml.fl.generated.NNServiceProto.SaveModelRequest.getDefaultInstance()) return this; - if (!other.getClientId().isEmpty()) { - clientId_ = other.clientId_; - onChanged(); + if (other.getClientId() != 0) { + setClientId(other.getClientId()); } if (!other.getBackend().isEmpty()) { backend_ = other.backend_; @@ -10306,78 +9871,33 @@ public Builder mergeFrom( return this; } - private java.lang.Object clientId_ = ""; + private int clientId_ ; /** - * string client_id = 1; + * int32 client_id = 1; * @return The clientId. */ - public java.lang.String getClientId() { - java.lang.Object ref = clientId_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - clientId_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string client_id = 1; - * @return The bytes for clientId. - */ - public com.google.protobuf.ByteString - getClientIdBytes() { - java.lang.Object ref = clientId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - clientId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + @java.lang.Override + public int getClientId() { + return clientId_; } /** - * string client_id = 1; + * int32 client_id = 1; * @param value The clientId to set. * @return This builder for chaining. */ - public Builder setClientId( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - + public Builder setClientId(int value) { + clientId_ = value; onChanged(); return this; } /** - * string client_id = 1; + * int32 client_id = 1; * @return This builder for chaining. */ public Builder clearClientId() { - clientId_ = getDefaultInstance().getClientId(); - onChanged(); - return this; - } - /** - * string client_id = 1; - * @param value The bytes for clientId to set. - * @return This builder for chaining. - */ - public Builder setClientIdBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - clientId_ = value; + clientId_ = 0; onChanged(); return this; } @@ -11234,29 +10754,29 @@ public com.intel.analytics.bigdl.ppml.fl.generated.NNServiceProto.SaveModelRespo static { java.lang.String[] descriptorData = { "\n\020nn_service.proto\022\002nn\032\rfl_base.proto\"O\n" + - "\014TrainRequest\022\022\n\nclientuuid\030\001 \001(\t\022\030\n\004dat" + + "\014TrainRequest\022\022\n\nclientuuid\030\001 \001(\005\022\030\n\004dat" + "a\030\002 \001(\0132\n.TensorMap\022\021\n\talgorithm\030\003 \001(\t\"I" + "\n\rTrainResponse\022\020\n\010response\030\001 \001(\t\022\030\n\004dat" + "a\030\002 \001(\0132\n.TensorMap\022\014\n\004code\030\003 \001(\005\"b\n\017Eva" + - "luateRequest\022\022\n\nclientuuid\030\001 \001(\t\022\030\n\004data" + + "luateRequest\022\022\n\nclientuuid\030\001 \001(\005\022\030\n\004data" + "\030\002 \001(\0132\n.TensorMap\022\021\n\talgorithm\030\003 \001(\t\022\016\n" + "\006return\030\004 \001(\010\"]\n\020EvaluateResponse\022\020\n\010res" + "ponse\030\001 \001(\t\022\030\n\004data\030\002 \001(\0132\n.TensorMap\022\014\n" + "\004code\030\003 \001(\005\022\017\n\007message\030\004 \001(\t\"Q\n\016PredictR" + - "equest\022\022\n\nclientuuid\030\001 \001(\t\022\030\n\004data\030\002 \001(\013" + + "equest\022\022\n\nclientuuid\030\001 \001(\005\022\030\n\004data\030\002 \001(\013" + "2\n.TensorMap\022\021\n\talgorithm\030\003 \001(\t\"K\n\017Predi" + "ctResponse\022\020\n\010response\030\001 \001(\t\022\030\n\004data\030\002 \001" + "(\0132\n.TensorMap\022\014\n\004code\030\003 \001(\005\"r\n\021UploadMe" + - "taRequest\022\023\n\013client_uuid\030\001 \001(\t\022\017\n\007loss_f" + + "taRequest\022\023\n\013client_uuid\030\001 \001(\005\022\017\n\007loss_f" + "n\030\002 \001(\014\022#\n\toptimizer\030\003 \001(\0132\020.nn.ClassAnd" + "Args\022\022\n\naggregator\030\004 \001(\t\"\033\n\tByteChunk\022\016\n" + "\006buffer\030\001 \001(\014\")\n\014ClassAndArgs\022\013\n\003cls\030\001 \001" + "(\014\022\014\n\004args\030\002 \001(\014\"3\n\022UploadMetaResponse\022\017" + "\n\007message\030\001 \001(\t\022\014\n\004code\030\002 \001(\005\"J\n\020LoadMod" + - "elRequest\022\021\n\tclient_id\030\001 \001(\t\022\017\n\007backend\030" + + "elRequest\022\021\n\tclient_id\030\001 \001(\005\022\017\n\007backend\030" + "\002 \001(\t\022\022\n\nmodel_path\030\003 \001(\t\"2\n\021LoadModelRe" + "sponse\022\017\n\007message\030\001 \001(\t\022\014\n\004code\030\002 \001(\005\"J\n" + - "\020SaveModelRequest\022\021\n\tclient_id\030\001 \001(\t\022\017\n\007" + + "\020SaveModelRequest\022\021\n\tclient_id\030\001 \001(\005\022\017\n\007" + "backend\030\002 \001(\t\022\022\n\nmodel_path\030\003 \001(\t\"$\n\021Sav" + "eModelResponse\022\017\n\007message\030\001 \001(\t2\254\003\n\tNNSe" + "rvice\022.\n\005train\022\020.nn.TrainRequest\032\021.nn.Tr" + diff --git a/scala/ppml/src/main/java/com/intel/analytics/bigdl/ppml/fl/generated/PSIServiceProto.java b/scala/ppml/src/main/java/com/intel/analytics/bigdl/ppml/fl/generated/PSIServiceProto.java index d37b9624266..274e1e068a1 100644 --- a/scala/ppml/src/main/java/com/intel/analytics/bigdl/ppml/fl/generated/PSIServiceProto.java +++ b/scala/ppml/src/main/java/com/intel/analytics/bigdl/ppml/fl/generated/PSIServiceProto.java @@ -1387,16 +1387,10 @@ public interface UploadSetRequestOrBuilder extends getTaskIdBytes(); /** - * string client_id = 2; + * int32 client_id = 2; * @return The clientId. */ - java.lang.String getClientId(); - /** - * string client_id = 2; - * @return The bytes for clientId. - */ - com.google.protobuf.ByteString - getClientIdBytes(); + int getClientId(); /** * int32 split = 3; @@ -1461,7 +1455,6 @@ private UploadSetRequest(com.google.protobuf.GeneratedMessageV3.Builder build } private UploadSetRequest() { taskId_ = ""; - clientId_ = ""; hashedID_ = com.google.protobuf.LazyStringArrayList.EMPTY; } @@ -1502,10 +1495,9 @@ private UploadSetRequest( taskId_ = s; break; } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); + case 16: { - clientId_ = s; + clientId_ = input.readInt32(); break; } case 24: { @@ -1611,41 +1603,14 @@ public java.lang.String getTaskId() { } public static final int CLIENT_ID_FIELD_NUMBER = 2; - private volatile java.lang.Object clientId_; + private int clientId_; /** - * string client_id = 2; + * int32 client_id = 2; * @return The clientId. */ @java.lang.Override - public java.lang.String getClientId() { - java.lang.Object ref = clientId_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - clientId_ = s; - return s; - } - } - /** - * string client_id = 2; - * @return The bytes for clientId. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getClientIdBytes() { - java.lang.Object ref = clientId_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - clientId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + public int getClientId() { + return clientId_; } public static final int SPLIT_FIELD_NUMBER = 3; @@ -1744,8 +1709,8 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (!getTaskIdBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, taskId_); } - if (!getClientIdBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, clientId_); + if (clientId_ != 0) { + output.writeInt32(2, clientId_); } if (split_ != 0) { output.writeInt32(3, split_); @@ -1774,8 +1739,9 @@ public int getSerializedSize() { if (!getTaskIdBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, taskId_); } - if (!getClientIdBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, clientId_); + if (clientId_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, clientId_); } if (split_ != 0) { size += com.google.protobuf.CodedOutputStream @@ -1818,8 +1784,8 @@ public boolean equals(final java.lang.Object obj) { if (!getTaskId() .equals(other.getTaskId())) return false; - if (!getClientId() - .equals(other.getClientId())) return false; + if (getClientId() + != other.getClientId()) return false; if (getSplit() != other.getSplit()) return false; if (getNumSplit() @@ -1844,7 +1810,7 @@ public int hashCode() { hash = (37 * hash) + TASK_ID_FIELD_NUMBER; hash = (53 * hash) + getTaskId().hashCode(); hash = (37 * hash) + CLIENT_ID_FIELD_NUMBER; - hash = (53 * hash) + getClientId().hashCode(); + hash = (53 * hash) + getClientId(); hash = (37 * hash) + SPLIT_FIELD_NUMBER; hash = (53 * hash) + getSplit(); hash = (37 * hash) + NUM_SPLIT_FIELD_NUMBER; @@ -1992,7 +1958,7 @@ public Builder clear() { super.clear(); taskId_ = ""; - clientId_ = ""; + clientId_ = 0; split_ = 0; @@ -2094,9 +2060,8 @@ public Builder mergeFrom(com.intel.analytics.bigdl.ppml.fl.generated.PSIServiceP taskId_ = other.taskId_; onChanged(); } - if (!other.getClientId().isEmpty()) { - clientId_ = other.clientId_; - onChanged(); + if (other.getClientId() != 0) { + setClientId(other.getClientId()); } if (other.getSplit() != 0) { setSplit(other.getSplit()); @@ -2226,78 +2191,33 @@ public Builder setTaskIdBytes( return this; } - private java.lang.Object clientId_ = ""; + private int clientId_ ; /** - * string client_id = 2; + * int32 client_id = 2; * @return The clientId. */ - public java.lang.String getClientId() { - java.lang.Object ref = clientId_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - clientId_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string client_id = 2; - * @return The bytes for clientId. - */ - public com.google.protobuf.ByteString - getClientIdBytes() { - java.lang.Object ref = clientId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - clientId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + @java.lang.Override + public int getClientId() { + return clientId_; } /** - * string client_id = 2; + * int32 client_id = 2; * @param value The clientId to set. * @return This builder for chaining. */ - public Builder setClientId( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - + public Builder setClientId(int value) { + clientId_ = value; onChanged(); return this; } /** - * string client_id = 2; + * int32 client_id = 2; * @return This builder for chaining. */ public Builder clearClientId() { - clientId_ = getDefaultInstance().getClientId(); - onChanged(); - return this; - } - /** - * string client_id = 2; - * @param value The bytes for clientId to set. - * @return This builder for chaining. - */ - public Builder setClientIdBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - clientId_ = value; + clientId_ = 0; onChanged(); return this; } @@ -5119,7 +5039,7 @@ public com.intel.analytics.bigdl.ppml.fl.generated.PSIServiceProto.DownloadInter "ltRequest\022\017\n\007task_id\030\001 \001(\t\022\022\n\nclient_num" + "\030\002 \001(\005\022\023\n\013secure_code\030\003 \001(\t\"\037\n\tSaltReply" + "\022\022\n\nsalt_reply\030\001 \001(\t\"\226\001\n\020UploadSetReques" + - "t\022\017\n\007task_id\030\001 \001(\t\022\021\n\tclient_id\030\002 \001(\t\022\r\n" + + "t\022\017\n\007task_id\030\001 \001(\t\022\021\n\tclient_id\030\002 \001(\005\022\r\n" + "\005split\030\003 \001(\005\022\021\n\tnum_split\030\004 \001(\005\022\024\n\014split" + "_length\030\005 \001(\005\022\024\n\014total_length\030\006 \001(\005\022\020\n\010h" + "ashedID\030\007 \003(\t\"=\n\021UploadSetResponse\022\017\n\007ta" + diff --git a/scala/ppml/src/main/java/com/intel/analytics/bigdl/ppml/fl/psi/PSIServiceImpl.java b/scala/ppml/src/main/java/com/intel/analytics/bigdl/ppml/fl/psi/PSIServiceImpl.java index 24a0b5ce526..d78c8bbd575 100644 --- a/scala/ppml/src/main/java/com/intel/analytics/bigdl/ppml/fl/psi/PSIServiceImpl.java +++ b/scala/ppml/src/main/java/com/intel/analytics/bigdl/ppml/fl/psi/PSIServiceImpl.java @@ -34,7 +34,7 @@ public class PSIServiceImpl extends PSIServiceGrpc.PSIServiceImplBase { protected PsiIntersection psiTask; // This psiCollections is // TaskId, ClientId, UploadRequest - protected Map psiCollections = new ConcurrentHashMap<>(); + protected Map psiCollections = new ConcurrentHashMap<>(); int clientNum; String clientSalt; String clientSecret; @@ -79,7 +79,7 @@ public void uploadSet(UploadSetRequest request, SIGNAL signal; signal= SIGNAL.SUCCESS; - String clientId = request.getClientId(); + int clientId = request.getClientId(); int numSplit = request.getNumSplit(); int splitLength = request.getSplitLength(); int totalLength = request.getTotalLength(); diff --git a/scala/ppml/src/main/java/com/intel/analytics/bigdl/ppml/fl/psi/PSIStub.java b/scala/ppml/src/main/java/com/intel/analytics/bigdl/ppml/fl/psi/PSIStub.java index 6d10d49c990..597210e3471 100644 --- a/scala/ppml/src/main/java/com/intel/analytics/bigdl/ppml/fl/psi/PSIStub.java +++ b/scala/ppml/src/main/java/com/intel/analytics/bigdl/ppml/fl/psi/PSIStub.java @@ -21,6 +21,7 @@ import com.intel.analytics.bigdl.ppml.fl.generated.PSIServiceProto.*; import io.grpc.Channel; +import io.grpc.Internal; import io.grpc.StatusRuntimeException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -32,10 +33,11 @@ public class PSIStub { private static final Logger logger = LoggerFactory.getLogger(PSIStub.class); private PSIServiceGrpc.PSIServiceBlockingStub stub; - public PSIStub(Channel channel) { + Integer clientID; + public PSIStub(Channel channel, Integer clientID) { + this.clientID = clientID; stub = PSIServiceGrpc.newBlockingStub(channel); } - protected String clientID = UUID.randomUUID().toString(); protected String salt; protected int splitSize = 1000000; diff --git a/scala/ppml/src/main/java/com/intel/analytics/bigdl/ppml/fl/psi/test/BenchmarkClient.java b/scala/ppml/src/main/java/com/intel/analytics/bigdl/ppml/fl/psi/test/BenchmarkClient.java index adf7a32667e..bd055eea607 100644 --- a/scala/ppml/src/main/java/com/intel/analytics/bigdl/ppml/fl/psi/test/BenchmarkClient.java +++ b/scala/ppml/src/main/java/com/intel/analytics/bigdl/ppml/fl/psi/test/BenchmarkClient.java @@ -63,7 +63,7 @@ public static void main(String[] args) throws Exception { logger.info("### Time of producing data: " + (etproduce - stproduce) + " ms ###"); List hashedIdArray; String salt; - FLContext.initFLContext("1", null); + FLContext.initFLContext(1, null); PSI psi = new PSI(); try { // Get salt from Server diff --git a/scala/ppml/src/main/java/com/intel/analytics/bigdl/ppml/fl/vfl/FGBoostStub.java b/scala/ppml/src/main/java/com/intel/analytics/bigdl/ppml/fl/vfl/FGBoostStub.java index 9e5506b2a90..fb89c96229b 100644 --- a/scala/ppml/src/main/java/com/intel/analytics/bigdl/ppml/fl/vfl/FGBoostStub.java +++ b/scala/ppml/src/main/java/com/intel/analytics/bigdl/ppml/fl/vfl/FGBoostStub.java @@ -29,8 +29,8 @@ public class FGBoostStub { private static final Logger logger = LoggerFactory.getLogger(FGBoostStub.class); private static FGBoostServiceGrpc.FGBoostServiceBlockingStub stub; - String clientID; - public FGBoostStub(Channel channel, String clientID) { + Integer clientID; + public FGBoostStub(Channel channel, Integer clientID) { this.clientID = clientID; stub = FGBoostServiceGrpc.newBlockingStub(channel); } diff --git a/scala/ppml/src/main/java/com/intel/analytics/bigdl/ppml/fl/vfl/NNStub.java b/scala/ppml/src/main/java/com/intel/analytics/bigdl/ppml/fl/vfl/NNStub.java index 1c79d8e29b9..da34a8ab431 100644 --- a/scala/ppml/src/main/java/com/intel/analytics/bigdl/ppml/fl/vfl/NNStub.java +++ b/scala/ppml/src/main/java/com/intel/analytics/bigdl/ppml/fl/vfl/NNStub.java @@ -26,8 +26,8 @@ public class NNStub { private static final Logger logger = LoggerFactory.getLogger(NNStub.class); private static NNServiceGrpc.NNServiceBlockingStub stub; - String clientID; - public NNStub(Channel channel, String clientID) { + Integer clientID; + public NNStub(Channel channel, Integer clientID) { this.clientID = clientID; stub = NNServiceGrpc.newBlockingStub(channel); } diff --git a/scala/ppml/src/main/proto/fgboost_service.proto b/scala/ppml/src/main/proto/fgboost_service.proto index 5c382610a72..f4524966b91 100644 --- a/scala/ppml/src/main/proto/fgboost_service.proto +++ b/scala/ppml/src/main/proto/fgboost_service.proto @@ -33,7 +33,7 @@ service FGBoostService { } message UploadLabelRequest { - string clientuuid = 1; + int32 clientuuid = 1; TensorMap data = 2; string algorithm = 3; } @@ -55,7 +55,7 @@ message TreeLeaf { } message UploadTreeLeafRequest { - string clientuuid = 1; + int32 clientuuid = 1; TreeLeaf treeLeaf = 2; } message DataSplit { @@ -88,7 +88,7 @@ message BoostEval { } message RegisterRequest { - string clientuuid = 1; + int32 clientuuid = 1; string token = 2; } @@ -98,7 +98,7 @@ message RegisterResponse { } message UploadTreeEvalRequest { - string clientuuid = 1; + int32 clientuuid = 1; int32 version = 2; repeated BoostEval treeEval = 3; } @@ -106,7 +106,7 @@ message UploadTreeEvalRequest { message EvaluateRequest { - string clientuuid = 1; + int32 clientuuid = 1; repeated BoostEval treeEval = 2; int32 version = 3; bool lastBatch = 4; @@ -119,13 +119,13 @@ message EvaluateResponse { string message = 4; } message PredictRequest { - string clientuuid = 1; + int32 clientuuid = 1; repeated BoostEval treeEval = 2; int32 version = 3; bool lastBatch = 4; } message SplitRequest { - string clientuuid = 1; + int32 clientuuid = 1; DataSplit split = 2; } message PredictResponse { @@ -142,7 +142,7 @@ message SplitResponse { int32 code = 3; } message SaveModelRequest { - string clientuuid = 1; + int32 clientuuid = 1; string modelPath = 2; } message SaveModelResponse { @@ -150,7 +150,7 @@ message SaveModelResponse { int32 code = 2; } message LoadModelRequest { - string client_id = 1; + int32 client_id = 1; string model_path = 2; } diff --git a/scala/ppml/src/main/proto/nn_service.proto b/scala/ppml/src/main/proto/nn_service.proto index eb5055b6c6a..ee6a670d7da 100644 --- a/scala/ppml/src/main/proto/nn_service.proto +++ b/scala/ppml/src/main/proto/nn_service.proto @@ -31,7 +31,7 @@ service NNService { } message TrainRequest { - string clientuuid = 1; + int32 clientuuid = 1; TensorMap data = 2; string algorithm = 3; } @@ -42,7 +42,7 @@ message TrainResponse { } message EvaluateRequest { - string clientuuid = 1; + int32 clientuuid = 1; TensorMap data = 2; string algorithm = 3; bool return = 4; @@ -55,7 +55,7 @@ message EvaluateResponse { } message PredictRequest { - string clientuuid = 1; + int32 clientuuid = 1; TensorMap data = 2; string algorithm = 3; } @@ -65,7 +65,7 @@ message PredictResponse { int32 code = 3; } message UploadMetaRequest { - string client_uuid = 1; + int32 client_uuid = 1; bytes loss_fn = 2; ClassAndArgs optimizer = 3; string aggregator = 4; @@ -85,7 +85,7 @@ message UploadMetaResponse { } message LoadModelRequest { - string client_id = 1; + int32 client_id = 1; string backend = 2; string model_path = 3; } @@ -96,7 +96,7 @@ message LoadModelResponse { } message SaveModelRequest { - string client_id = 1; + int32 client_id = 1; string backend = 2; string model_path = 3; } diff --git a/scala/ppml/src/main/proto/psi_service.proto b/scala/ppml/src/main/proto/psi_service.proto index bfc7ad7b009..49b41604b6a 100644 --- a/scala/ppml/src/main/proto/psi_service.proto +++ b/scala/ppml/src/main/proto/psi_service.proto @@ -39,7 +39,7 @@ message SaltReply { message UploadSetRequest { string task_id = 1; - string client_id = 2; + int32 client_id = 2; int32 split = 3; int32 num_split = 4; int32 split_length = 5; diff --git a/scala/ppml/src/main/scala/com/intel/analytics/bigdl/ppml/fl/FLClient.scala b/scala/ppml/src/main/scala/com/intel/analytics/bigdl/ppml/fl/FLClient.scala index 161d0a44cd4..b6d86a5cd30 100644 --- a/scala/ppml/src/main/scala/com/intel/analytics/bigdl/ppml/fl/FLClient.scala +++ b/scala/ppml/src/main/scala/com/intel/analytics/bigdl/ppml/fl/FLClient.scala @@ -38,14 +38,15 @@ class FLClient(val _args: Array[String]) extends GrpcClientBase(_args) { var fgbostStub: FGBoostStub = null var psiSalt: String = null privateKeyFilePath = null + var clientID: Int = 0 parseConfig() def this() { this(null) } - def setClientId(clientId: String): Unit = { - clientUUID = clientId + def setClientId(clientId: Int): Unit = { + clientID = clientId } @throws[IOException] @@ -62,9 +63,9 @@ class FLClient(val _args: Array[String]) extends GrpcClientBase(_args) { } override def loadServices(): Unit = { - psiStub = new PSIStub(channel) - nnStub = new NNStub(channel, clientUUID) - fgbostStub = new FGBoostStub(channel, clientUUID) + psiStub = new PSIStub(channel, clientID) + nnStub = new NNStub(channel, clientID) + fgbostStub = new FGBoostStub(channel, clientID) } override def shutdown(): Unit = { diff --git a/scala/ppml/src/main/scala/com/intel/analytics/bigdl/ppml/fl/FLContext.scala b/scala/ppml/src/main/scala/com/intel/analytics/bigdl/ppml/fl/FLContext.scala index 826e729837c..d6145db9c25 100644 --- a/scala/ppml/src/main/scala/com/intel/analytics/bigdl/ppml/fl/FLContext.scala +++ b/scala/ppml/src/main/scala/com/intel/analytics/bigdl/ppml/fl/FLContext.scala @@ -42,7 +42,7 @@ object FLContext { flClient.psiSalt } - def initFLContext(id: String, target: String = null): Unit = { + def initFLContext(id: Int, target: String = null): Unit = { createSparkSession() Engine.init diff --git a/scala/ppml/src/main/scala/com/intel/analytics/bigdl/ppml/fl/base/StorageHolder.scala b/scala/ppml/src/main/scala/com/intel/analytics/bigdl/ppml/fl/base/StorageHolder.scala index 6f08a3d80de..acc16eeaf9b 100644 --- a/scala/ppml/src/main/scala/com/intel/analytics/bigdl/ppml/fl/base/StorageHolder.scala +++ b/scala/ppml/src/main/scala/com/intel/analytics/bigdl/ppml/fl/base/StorageHolder.scala @@ -53,7 +53,7 @@ class StorageHolder(flDataType: FLDataType) { def getClientDataSize(): Int = this.clientDataSize - def putClientData(clientID: String, dataHolder: DataHolder): Unit = { + def putClientData(clientID: Int, dataHolder: DataHolder): Unit = { if (dataHolder.tensorMap != null) { tensorMapStorage.clientData.put(clientID, dataHolder.tensorMap) clientDataSize = tensorMapStorage.clientData.size() diff --git a/scala/ppml/src/main/scala/com/intel/analytics/bigdl/ppml/fl/example/benchmark/FGBoostDummyDataBenchmark.scala b/scala/ppml/src/main/scala/com/intel/analytics/bigdl/ppml/fl/example/benchmark/FGBoostDummyDataBenchmark.scala index 77e354ed34c..e4830960d61 100644 --- a/scala/ppml/src/main/scala/com/intel/analytics/bigdl/ppml/fl/example/benchmark/FGBoostDummyDataBenchmark.scala +++ b/scala/ppml/src/main/scala/com/intel/analytics/bigdl/ppml/fl/example/benchmark/FGBoostDummyDataBenchmark.scala @@ -42,7 +42,7 @@ object FGBoostDummyDataBenchmark extends TimingSupportive { val param = parser.parse(args, Params()).get - FLContext.initFLContext("1") + FLContext.initFLContext(1) val random = new Random() val data = (0 until param.dataSize).map(_ => Tensor[Float](param.dataDim).rand()).toArray val label = (0 until param.dataSize).map(_ => random.nextFloat()).toArray diff --git a/scala/ppml/src/main/scala/com/intel/analytics/bigdl/ppml/fl/example/benchmark/FGBoostRealDataBenchmark.scala b/scala/ppml/src/main/scala/com/intel/analytics/bigdl/ppml/fl/example/benchmark/FGBoostRealDataBenchmark.scala index 77ebb4322f9..6b81eb6ca65 100644 --- a/scala/ppml/src/main/scala/com/intel/analytics/bigdl/ppml/fl/example/benchmark/FGBoostRealDataBenchmark.scala +++ b/scala/ppml/src/main/scala/com/intel/analytics/bigdl/ppml/fl/example/benchmark/FGBoostRealDataBenchmark.scala @@ -67,7 +67,7 @@ object FGBoostRealDataBenchmark extends TimingSupportive { trainLabelStacked = trainLabelStacked ++ trainLabelArray }) - FLContext.initFLContext("1") + FLContext.initFLContext(1) val fGBoostRegression = new FGBoostRegression( learningRate = 0.1f, maxDepth = 7, minChildSize = 5) fGBoostRegression.fit( diff --git a/scala/ppml/src/main/scala/com/intel/analytics/bigdl/ppml/fl/example/fgboost_regression/FGBoostRegression.scala b/scala/ppml/src/main/scala/com/intel/analytics/bigdl/ppml/fl/example/fgboost_regression/FGBoostRegression.scala index 3c8817b2948..a6499981f61 100644 --- a/scala/ppml/src/main/scala/com/intel/analytics/bigdl/ppml/fl/example/fgboost_regression/FGBoostRegression.scala +++ b/scala/ppml/src/main/scala/com/intel/analytics/bigdl/ppml/fl/example/fgboost_regression/FGBoostRegression.scala @@ -60,7 +60,7 @@ object FGBoostRegression extends DebugLogger { /** * Usage of BigDL PPML starts from here */ - FLContext.initFLContext("1") + FLContext.initFLContext(1) val (trainData, testData) = getData(dataPath, rowKeyName) // create LogisticRegression object to train the model diff --git a/scala/ppml/src/main/scala/com/intel/analytics/bigdl/ppml/fl/example/hfl_logistic_regression/HFLLogisticRegression.scala b/scala/ppml/src/main/scala/com/intel/analytics/bigdl/ppml/fl/example/hfl_logistic_regression/HFLLogisticRegression.scala index 7835392d3f8..c8e64a52f7b 100644 --- a/scala/ppml/src/main/scala/com/intel/analytics/bigdl/ppml/fl/example/hfl_logistic_regression/HFLLogisticRegression.scala +++ b/scala/ppml/src/main/scala/com/intel/analytics/bigdl/ppml/fl/example/hfl_logistic_regression/HFLLogisticRegression.scala @@ -69,7 +69,7 @@ object HFLLogisticRegression extends DebugLogger { /** * Usage of BigDL PPML starts from here */ - FLContext.initFLContext("1") + FLContext.initFLContext(1) val (trainData, valData, testData) = getData(dataPath, rowKeyName, batchSize) // create LogisticRegression object to train the model val lr = new HFLLogisticRegression(trainData.columns.size - 1, learningRate) diff --git a/scala/ppml/src/main/scala/com/intel/analytics/bigdl/ppml/fl/example/psi/PSIExample.scala b/scala/ppml/src/main/scala/com/intel/analytics/bigdl/ppml/fl/example/psi/PSIExample.scala index 33bcadcdbfd..98961b250bc 100644 --- a/scala/ppml/src/main/scala/com/intel/analytics/bigdl/ppml/fl/example/psi/PSIExample.scala +++ b/scala/ppml/src/main/scala/com/intel/analytics/bigdl/ppml/fl/example/psi/PSIExample.scala @@ -39,7 +39,7 @@ object PSIExample { // Create a communication channel to the server, known as a Channel. Channels are thread-safe // and reusable. It is common to create channels at the beginning of your application and reuse // them until the application shuts down. - FLContext.initFLContext("1") + FLContext.initFLContext(1) val pSI = new PSI() try { // Get salt from Server diff --git a/scala/ppml/src/main/scala/com/intel/analytics/bigdl/ppml/fl/example/vfl_logistic_regression/VFLLogisticRegression.scala b/scala/ppml/src/main/scala/com/intel/analytics/bigdl/ppml/fl/example/vfl_logistic_regression/VFLLogisticRegression.scala index 2e48231fbd0..dce8ec0651c 100644 --- a/scala/ppml/src/main/scala/com/intel/analytics/bigdl/ppml/fl/example/vfl_logistic_regression/VFLLogisticRegression.scala +++ b/scala/ppml/src/main/scala/com/intel/analytics/bigdl/ppml/fl/example/vfl_logistic_regression/VFLLogisticRegression.scala @@ -41,13 +41,13 @@ object VFLLogisticRegression extends DebugLogger{ } def main(args: Array[String]): Unit = { - case class Params(clientId: String = "", + case class Params(clientId: Int = 0, dataPath: String = null, rowKeyName: String = "ID", learningRate: Float = 0.005f, batchSize: Int = 4) val parser: OptionParser[Params] = new OptionParser[Params]("VFL Logistic Regression") { - opt[String]('c', "clientId") + opt[Int]('c', "clientId") .text("data path to load") .action((x, params) => params.copy(clientId = x)) .required() @@ -83,9 +83,9 @@ object VFLLogisticRegression extends DebugLogger{ // Data pipeline from DataFrame to Tensor, and call fit, evaluate, predict val (featureColumns, labelColumns) = argv.clientId match { - case "1" => (Array("Pregnancies", "Glucose", "BloodPressure", "SkinThickness"), + case 1 => (Array("Pregnancies", "Glucose", "BloodPressure", "SkinThickness"), Array("Outcome")) - case "2" => (Array("Insulin", "BMI", "DiabetesPedigreeFunction"), null) + case 2 => (Array("Insulin", "BMI", "DiabetesPedigreeFunction"), null) case _ => throw new IllegalArgumentException("clientId only support 1, 2 in this example") } val xTrain = TensorUtils.fromDataFrame(trainData, featureColumns) diff --git a/scala/ppml/src/main/scala/com/intel/analytics/bigdl/ppml/fl/fgboost/FGBoostServiceImpl.scala b/scala/ppml/src/main/scala/com/intel/analytics/bigdl/ppml/fl/fgboost/FGBoostServiceImpl.scala index bf190cd4c5b..4c6757ec994 100644 --- a/scala/ppml/src/main/scala/com/intel/analytics/bigdl/ppml/fl/fgboost/FGBoostServiceImpl.scala +++ b/scala/ppml/src/main/scala/com/intel/analytics/bigdl/ppml/fl/fgboost/FGBoostServiceImpl.scala @@ -39,8 +39,8 @@ class FGBoostServiceImpl(clientNum: Int, config: FLConfig) aggregator.setClientNum(clientNum) // store client id as key and client data as value - val evalBufferMap = new ConcurrentHashMap[String, util.ArrayList[BoostEval]]() - var predBufferMap = new ConcurrentHashMap[String, util.ArrayList[BoostEval]]() + val evalBufferMap = new ConcurrentHashMap[Int, util.ArrayList[BoostEval]]() + var predBufferMap = new ConcurrentHashMap[Int, util.ArrayList[BoostEval]]() override def downloadLabel(request: DownloadLabelRequest, responseObserver: StreamObserver[DownloadResponse]): Unit = { diff --git a/scala/ppml/src/main/scala/com/intel/analytics/bigdl/ppml/fl/python/PythonPPML.scala b/scala/ppml/src/main/scala/com/intel/analytics/bigdl/ppml/fl/python/PythonPPML.scala index 99d73997cc9..f9e03e3fd39 100644 --- a/scala/ppml/src/main/scala/com/intel/analytics/bigdl/ppml/fl/python/PythonPPML.scala +++ b/scala/ppml/src/main/scala/com/intel/analytics/bigdl/ppml/fl/python/PythonPPML.scala @@ -40,7 +40,7 @@ object PythonPPML { } class PythonPPML[T: ClassTag](implicit ev: TensorNumeric[T]) extends PythonBigDL with TimingSupportive { - def initFLContext(id: String, target: String): Unit = { + def initFLContext(id: Int, target: String): Unit = { FLContext.initFLContext(id, target) } def setPsiSalt(psiSalt: String): Unit = { diff --git a/scala/ppml/src/main/scala/com/intel/analytics/bigdl/ppml/fl/utils/ProtoUtils.scala b/scala/ppml/src/main/scala/com/intel/analytics/bigdl/ppml/fl/utils/ProtoUtils.scala index c2c29cc9c47..fa649fc762c 100644 --- a/scala/ppml/src/main/scala/com/intel/analytics/bigdl/ppml/fl/utils/ProtoUtils.scala +++ b/scala/ppml/src/main/scala/com/intel/analytics/bigdl/ppml/fl/utils/ProtoUtils.scala @@ -68,7 +68,7 @@ object ProtoUtils { (T.seq(outputs.values.head.toSeq), target) } - def protoTableMapToTensorIterableMap(inputMap: java.util.Map[String, FlBaseProto.TensorMap]): + def protoTableMapToTensorIterableMap(inputMap: java.util.Map[Integer, FlBaseProto.TensorMap]): Map[String, Iterable[Tensor[Float]]] = { inputMap.asScala.mapValues(_.getTensorMapMap).values .flatMap(_.asScala).groupBy(_._1) diff --git a/scala/ppml/src/main/scala/com/intel/analytics/bigdl/ppml/fl/utils/ServerUtils.scala b/scala/ppml/src/main/scala/com/intel/analytics/bigdl/ppml/fl/utils/ServerUtils.scala index f512fdd85b5..0ed1a46f862 100644 --- a/scala/ppml/src/main/scala/com/intel/analytics/bigdl/ppml/fl/utils/ServerUtils.scala +++ b/scala/ppml/src/main/scala/com/intel/analytics/bigdl/ppml/fl/utils/ServerUtils.scala @@ -19,7 +19,7 @@ package com.intel.analytics.bigdl.ppml.fl.utils import com.intel.analytics.bigdl.dllib.utils.Log4Error object ServerUtils { - def checkClientId(clientNum: Int, id: String): Boolean = { + def checkClientId(clientNum: Int, id: Int): Boolean = { try { if (id.toInt <= 0 || id.toInt > clientNum) { throw new Exception("Invalid client ID") diff --git a/scala/ppml/src/test/scala/com/intel/analytics/bigdl/ppml/fl/PSISpec.scala b/scala/ppml/src/test/scala/com/intel/analytics/bigdl/ppml/fl/PSISpec.scala index 89a81cd4aba..c0429f570f3 100644 --- a/scala/ppml/src/test/scala/com/intel/analytics/bigdl/ppml/fl/PSISpec.scala +++ b/scala/ppml/src/test/scala/com/intel/analytics/bigdl/ppml/fl/PSISpec.scala @@ -30,7 +30,7 @@ class PSISpec extends FLSpec { flServer.setPort(port) flServer.build() flServer.start() - FLContext.initFLContext("1", target) + FLContext.initFLContext(1, target) val pSI = new PSI() val salt = pSI.getSalt() flServer.stop() @@ -41,7 +41,7 @@ class PSISpec extends FLSpec { flServer.setPort(port) flServer.build() flServer.start() - FLContext.initFLContext("1", target) + FLContext.initFLContext(1, target) val pSI = new PSI() val set = List("key1", "key2") val salt = pSI.getSalt() @@ -56,7 +56,7 @@ class PSISpec extends FLSpec { flServer.setClientNum(2) flServer.build() flServer.start() - FLContext.initFLContext("1", target) + FLContext.initFLContext(1, target) val pSI1 = new PSI() val pSI2 = new PSI() val set1 = List("key1", "key2") @@ -74,7 +74,7 @@ class PSISpec extends FLSpec { flServer.setPort(port) flServer.build() flServer.start() - FLContext.initFLContext("1", target) + FLContext.initFLContext(1, target) val pSI1 = new PSI() val set1 = List("key1", "key2") val salt1 = pSI1.getSalt() diff --git a/scala/ppml/src/test/scala/com/intel/analytics/bigdl/ppml/fl/fgboost/CorrectnessSpec.scala b/scala/ppml/src/test/scala/com/intel/analytics/bigdl/ppml/fl/fgboost/CorrectnessSpec.scala index 063a01f5df2..e705042d0e1 100644 --- a/scala/ppml/src/test/scala/com/intel/analytics/bigdl/ppml/fl/fgboost/CorrectnessSpec.scala +++ b/scala/ppml/src/test/scala/com/intel/analytics/bigdl/ppml/fl/fgboost/CorrectnessSpec.scala @@ -104,7 +104,7 @@ class CorrectnessSpec extends FLSpec { XGBoostFormatValidator.addHeaders(flattenHeaders) flServer.build() flServer.start() - FLContext.initFLContext("1", target) + FLContext.initFLContext(1, target) val fGBoostRegression = new FGBoostRegression( learningRate = 0.1f, maxDepth = 7, minChildSize = 5) fGBoostRegression.fit(trainFeatures, trainLabels, 15) @@ -178,9 +178,9 @@ class CorrectnessSpec extends FLSpec { flServer.setClientNum(2) flServer.build() flServer.start() - FLContext.initFLContext("1", target) + FLContext.initFLContext(1, target) val mockClient = new MockClient( - clientId = "2", + clientId = 2, dataPath = getClass.getClassLoader .getResource("two-party/house-prices-train-2.csv").getPath, testPath = getClass.getClassLoader @@ -250,9 +250,9 @@ class CorrectnessSpec extends FLSpec { flServer.setClientNum(3) flServer.build() flServer.start() - FLContext.initFLContext("1", target) + FLContext.initFLContext(1, target) val mockClient2 = new MockClient( - clientId = "2", + clientId = 2, dataPath = getClass.getClassLoader .getResource("three-party/house-prices-train-1.csv").getPath, testPath = getClass.getClassLoader @@ -260,7 +260,7 @@ class CorrectnessSpec extends FLSpec { rowKeyName = "Id", labelName = "SalePrice", dataFormat = "raw", target = target) mockClient2.start() val mockClient3 = new MockClient( - clientId = "3", + clientId = 3, dataPath = getClass.getClassLoader .getResource("three-party/house-prices-train-2.csv").getPath, testPath = getClass.getClassLoader diff --git a/scala/ppml/src/test/scala/com/intel/analytics/bigdl/ppml/fl/fgboost/FGBoostRegressionSepc.scala b/scala/ppml/src/test/scala/com/intel/analytics/bigdl/ppml/fl/fgboost/FGBoostRegressionSepc.scala index 5bd25023cc6..15aee57a6bc 100644 --- a/scala/ppml/src/test/scala/com/intel/analytics/bigdl/ppml/fl/fgboost/FGBoostRegressionSepc.scala +++ b/scala/ppml/src/test/scala/com/intel/analytics/bigdl/ppml/fl/fgboost/FGBoostRegressionSepc.scala @@ -48,7 +48,7 @@ class FGBoostRegressionSepc extends FLSpec { XGBoostFormatValidator.addHeaders(flattenHeaders) flServer.build() flServer.start() - FLContext.initFLContext("1", target) + FLContext.initFLContext(1, target) val fGBoostRegression = new FGBoostRegression( learningRate = 0.1f, maxDepth = 7, minChildSize = 5) fGBoostRegression.fit(trainFeatures, trainLabels, 1) @@ -83,7 +83,7 @@ class FGBoostRegressionSepc extends FLSpec { flServer.setClientNum(1) flServer.build() flServer.start() - FLContext.initFLContext("1", target) + FLContext.initFLContext(1, target) val fGBoostRegression = new FGBoostRegression( learningRate = 0.1f, maxDepth = 7, minChildSize = 5, "/tmp/fgboost-server-model") fGBoostRegression.fit(trainFeatures, trainLabels, 5) @@ -97,7 +97,7 @@ class FGBoostRegressionSepc extends FLSpec { flServer2.setClientNum(1) flServer2.build() flServer2.start() - FLContext.initFLContext("1", target) + FLContext.initFLContext(1, target) val fGBoostRegression2 = FGBoostRegression.loadModel(tmpFileName) fGBoostRegression2.loadServerModel("/tmp/fgboost-server-model") fGBoostRegression2.fit(trainFeatures, trainLabels, 5) diff --git a/scala/ppml/src/test/scala/com/intel/analytics/bigdl/ppml/fl/fgboost/MockClient.scala b/scala/ppml/src/test/scala/com/intel/analytics/bigdl/ppml/fl/fgboost/MockClient.scala index 5927c0c9486..0858a94e567 100644 --- a/scala/ppml/src/test/scala/com/intel/analytics/bigdl/ppml/fl/fgboost/MockClient.scala +++ b/scala/ppml/src/test/scala/com/intel/analytics/bigdl/ppml/fl/fgboost/MockClient.scala @@ -24,7 +24,7 @@ import org.apache.log4j.LogManager import scala.io.Source -class MockClient(clientId: String, +class MockClient(clientId: Int, dataPath: String, testPath: String = null, rowKeyName: String = null, diff --git a/scala/ppml/src/test/scala/com/intel/analytics/bigdl/ppml/fl/nn/CorrectnessSpec.scala b/scala/ppml/src/test/scala/com/intel/analytics/bigdl/ppml/fl/nn/CorrectnessSpec.scala index 483df4a5f06..0ba07ba51fc 100644 --- a/scala/ppml/src/test/scala/com/intel/analytics/bigdl/ppml/fl/nn/CorrectnessSpec.scala +++ b/scala/ppml/src/test/scala/com/intel/analytics/bigdl/ppml/fl/nn/CorrectnessSpec.scala @@ -40,14 +40,14 @@ class CorrectnessSpec extends FLSpec { flServer.build() flServer.start() val mockClient1 = new MockClient( - clientId = "1", + clientId = 1, dataPath = dataPath1, featureColumns = Array("Pregnancies", "Glucose", "BloodPressure", "SkinThickness"), labelColumns = Array("Outcome"), target = target ) val mockClient2 = new MockClient( - clientId = "2", + clientId = 2, dataPath = dataPath2, featureColumns = Array("Insulin", "BMI", "DiabetesPedigreeFunction"), labelColumns = null, diff --git a/scala/ppml/src/test/scala/com/intel/analytics/bigdl/ppml/fl/nn/HFLNNSpec.scala b/scala/ppml/src/test/scala/com/intel/analytics/bigdl/ppml/fl/nn/HFLNNSpec.scala index 02d85928f0a..72583b5d141 100644 --- a/scala/ppml/src/test/scala/com/intel/analytics/bigdl/ppml/fl/nn/HFLNNSpec.scala +++ b/scala/ppml/src/test/scala/com/intel/analytics/bigdl/ppml/fl/nn/HFLNNSpec.scala @@ -46,7 +46,7 @@ class NNSpec extends FLSpec { .csv(this.getClass.getClassLoader.getResource("diabetes-test.csv").getPath) val testDf = trainDf.drop("Outcome") trainDf.show() - FLContext.initFLContext("1", target) + FLContext.initFLContext(1, target) val lr = new HFLLogisticRegression(trainDf.columns.size - 1) lr.fitDataFrame(trainDf, valData = trainDf) lr.evaluateDataFrame(trainDf) diff --git a/scala/ppml/src/test/scala/com/intel/analytics/bigdl/ppml/fl/nn/MockClient.scala b/scala/ppml/src/test/scala/com/intel/analytics/bigdl/ppml/fl/nn/MockClient.scala index ebbb263b17d..b4a1722882e 100644 --- a/scala/ppml/src/test/scala/com/intel/analytics/bigdl/ppml/fl/nn/MockClient.scala +++ b/scala/ppml/src/test/scala/com/intel/analytics/bigdl/ppml/fl/nn/MockClient.scala @@ -24,7 +24,7 @@ import org.apache.log4j.LogManager import scala.io.Source -class MockClient(clientId: String, +class MockClient(clientId: Int, dataPath: String, featureColumns: Array[String] = null, labelColumns: Array[String] = null, diff --git a/scala/ppml/src/test/scala/com/intel/analytics/bigdl/ppml/fl/nn/VFLNNSpec.scala b/scala/ppml/src/test/scala/com/intel/analytics/bigdl/ppml/fl/nn/VFLNNSpec.scala index bd4d5059ab7..57e7f92e53a 100644 --- a/scala/ppml/src/test/scala/com/intel/analytics/bigdl/ppml/fl/nn/VFLNNSpec.scala +++ b/scala/ppml/src/test/scala/com/intel/analytics/bigdl/ppml/fl/nn/VFLNNSpec.scala @@ -31,7 +31,7 @@ class VFLNNSpec extends FLSpec { val df = spark.read.option("header", "true") .csv(this.getClass.getClassLoader.getResource("diabetes-test.csv").getPath) - FLContext.initFLContext("1", target) + FLContext.initFLContext(1, target) val psi = new PSI() val salt = psi.getSalt() val trainDf = psi.uploadSetAndDownloadIntersectionDataFrame(df, salt) @@ -48,7 +48,7 @@ class VFLNNSpec extends FLSpec { flServer.setPort(port) flServer.build() flServer.start() - FLContext.initFLContext("1", target) + FLContext.initFLContext(1, target) val xTrain = Tensor[Float](10, 10) val yTrain = Tensor[Float](10, 1) val lr = new VFLLogisticRegression(10) @@ -62,7 +62,7 @@ class VFLNNSpec extends FLSpec { flServer.setPort(port) flServer.build() flServer.start() - FLContext.initFLContext("1", target) + FLContext.initFLContext(1, target) val xTrain = Tensor[Float](10, 10) val yTrain = Tensor[Float](10, 1) val lr = new VFLLinearRegression(10) @@ -76,7 +76,7 @@ class VFLNNSpec extends FLSpec { flServer.setPort(port) flServer.build() flServer.start() - FLContext.initFLContext("1", target) + FLContext.initFLContext(1, target) val logisticRegression = new VFLLogisticRegression(featureNum = 1) val linearRegression = new VFLLinearRegression(featureNum = 1) flServer.stop() diff --git a/scala/ppml/src/test/scala/com/intel/analytics/bigdl/ppml/fl/utils/FlContextForTest.scala b/scala/ppml/src/test/scala/com/intel/analytics/bigdl/ppml/fl/utils/FlContextForTest.scala index 9ccdabd5468..020b4d76166 100644 --- a/scala/ppml/src/test/scala/com/intel/analytics/bigdl/ppml/fl/utils/FlContextForTest.scala +++ b/scala/ppml/src/test/scala/com/intel/analytics/bigdl/ppml/fl/utils/FlContextForTest.scala @@ -28,7 +28,7 @@ import org.apache.spark.sql.SparkSession class FlContextForTest { var flClient: FLClient = null var sparkSession: SparkSession = null - def initFLContext(clientId: String, target: String = null): Unit = { + def initFLContext(clientId: Int, target: String = null): Unit = { createSparkSession() Engine.init this.synchronized {