From bd07964ab425c5ac11d20adfe28098754b118bf2 Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Thu, 28 Mar 2024 15:27:07 -0400 Subject: [PATCH] Update protos and add ttl --- .../flwr/include/flwr/proto/fleet.grpc.pb.cc | 48 +- .../flwr/include/flwr/proto/fleet.grpc.pb.h | 201 ++++++- src/cc/flwr/include/flwr/proto/fleet.pb.cc | 537 ++++++++++++++++-- src/cc/flwr/include/flwr/proto/fleet.pb.h | 464 ++++++++++++++- src/cc/flwr/include/flwr/proto/task.pb.cc | 227 ++++---- src/cc/flwr/include/flwr/proto/task.pb.h | 203 +++---- src/cc/flwr/src/message_handler.cc | 6 +- 7 files changed, 1381 insertions(+), 305 deletions(-) diff --git a/src/cc/flwr/include/flwr/proto/fleet.grpc.pb.cc b/src/cc/flwr/include/flwr/proto/fleet.grpc.pb.cc index c71a6a3e1c4..a95fa23b6fb 100644 --- a/src/cc/flwr/include/flwr/proto/fleet.grpc.pb.cc +++ b/src/cc/flwr/include/flwr/proto/fleet.grpc.pb.cc @@ -25,6 +25,7 @@ namespace proto { static const char* Fleet_method_names[] = { "/flwr.proto.Fleet/CreateNode", "/flwr.proto.Fleet/DeleteNode", + "/flwr.proto.Fleet/Ping", "/flwr.proto.Fleet/PullTaskIns", "/flwr.proto.Fleet/PushTaskRes", }; @@ -38,8 +39,9 @@ std::unique_ptr< Fleet::Stub> Fleet::NewStub(const std::shared_ptr< ::grpc::Chan Fleet::Stub::Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options) : channel_(channel), rpcmethod_CreateNode_(Fleet_method_names[0], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) , rpcmethod_DeleteNode_(Fleet_method_names[1], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_PullTaskIns_(Fleet_method_names[2], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_PushTaskRes_(Fleet_method_names[3], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) + , rpcmethod_Ping_(Fleet_method_names[2], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) + , rpcmethod_PullTaskIns_(Fleet_method_names[3], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) + , rpcmethod_PushTaskRes_(Fleet_method_names[4], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) {} ::grpc::Status Fleet::Stub::CreateNode(::grpc::ClientContext* context, const ::flwr::proto::CreateNodeRequest& request, ::flwr::proto::CreateNodeResponse* response) { @@ -88,6 +90,29 @@ ::grpc::ClientAsyncResponseReader< ::flwr::proto::DeleteNodeResponse>* Fleet::St return result; } +::grpc::Status Fleet::Stub::Ping(::grpc::ClientContext* context, const ::flwr::proto::PingRequest& request, ::flwr::proto::PingResponse* response) { + return ::grpc::internal::BlockingUnaryCall< ::flwr::proto::PingRequest, ::flwr::proto::PingResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_Ping_, context, request, response); +} + +void Fleet::Stub::async::Ping(::grpc::ClientContext* context, const ::flwr::proto::PingRequest* request, ::flwr::proto::PingResponse* response, std::function f) { + ::grpc::internal::CallbackUnaryCall< ::flwr::proto::PingRequest, ::flwr::proto::PingResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_Ping_, context, request, response, std::move(f)); +} + +void Fleet::Stub::async::Ping(::grpc::ClientContext* context, const ::flwr::proto::PingRequest* request, ::flwr::proto::PingResponse* response, ::grpc::ClientUnaryReactor* reactor) { + ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_Ping_, context, request, response, reactor); +} + +::grpc::ClientAsyncResponseReader< ::flwr::proto::PingResponse>* Fleet::Stub::PrepareAsyncPingRaw(::grpc::ClientContext* context, const ::flwr::proto::PingRequest& request, ::grpc::CompletionQueue* cq) { + return ::grpc::internal::ClientAsyncResponseReaderHelper::Create< ::flwr::proto::PingResponse, ::flwr::proto::PingRequest, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), cq, rpcmethod_Ping_, context, request); +} + +::grpc::ClientAsyncResponseReader< ::flwr::proto::PingResponse>* Fleet::Stub::AsyncPingRaw(::grpc::ClientContext* context, const ::flwr::proto::PingRequest& request, ::grpc::CompletionQueue* cq) { + auto* result = + this->PrepareAsyncPingRaw(context, request, cq); + result->StartCall(); + return result; +} + ::grpc::Status Fleet::Stub::PullTaskIns(::grpc::ClientContext* context, const ::flwr::proto::PullTaskInsRequest& request, ::flwr::proto::PullTaskInsResponse* response) { return ::grpc::internal::BlockingUnaryCall< ::flwr::proto::PullTaskInsRequest, ::flwr::proto::PullTaskInsResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_PullTaskIns_, context, request, response); } @@ -158,6 +183,16 @@ Fleet::Service::Service() { AddMethod(new ::grpc::internal::RpcServiceMethod( Fleet_method_names[2], ::grpc::internal::RpcMethod::NORMAL_RPC, + new ::grpc::internal::RpcMethodHandler< Fleet::Service, ::flwr::proto::PingRequest, ::flwr::proto::PingResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( + [](Fleet::Service* service, + ::grpc::ServerContext* ctx, + const ::flwr::proto::PingRequest* req, + ::flwr::proto::PingResponse* resp) { + return service->Ping(ctx, req, resp); + }, this))); + AddMethod(new ::grpc::internal::RpcServiceMethod( + Fleet_method_names[3], + ::grpc::internal::RpcMethod::NORMAL_RPC, new ::grpc::internal::RpcMethodHandler< Fleet::Service, ::flwr::proto::PullTaskInsRequest, ::flwr::proto::PullTaskInsResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( [](Fleet::Service* service, ::grpc::ServerContext* ctx, @@ -166,7 +201,7 @@ Fleet::Service::Service() { return service->PullTaskIns(ctx, req, resp); }, this))); AddMethod(new ::grpc::internal::RpcServiceMethod( - Fleet_method_names[3], + Fleet_method_names[4], ::grpc::internal::RpcMethod::NORMAL_RPC, new ::grpc::internal::RpcMethodHandler< Fleet::Service, ::flwr::proto::PushTaskResRequest, ::flwr::proto::PushTaskResResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( [](Fleet::Service* service, @@ -194,6 +229,13 @@ ::grpc::Status Fleet::Service::DeleteNode(::grpc::ServerContext* context, const return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } +::grpc::Status Fleet::Service::Ping(::grpc::ServerContext* context, const ::flwr::proto::PingRequest* request, ::flwr::proto::PingResponse* response) { + (void) context; + (void) request; + (void) response; + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); +} + ::grpc::Status Fleet::Service::PullTaskIns(::grpc::ServerContext* context, const ::flwr::proto::PullTaskInsRequest* request, ::flwr::proto::PullTaskInsResponse* response) { (void) context; (void) request; diff --git a/src/cc/flwr/include/flwr/proto/fleet.grpc.pb.h b/src/cc/flwr/include/flwr/proto/fleet.grpc.pb.h index 03d445142c3..1513a3e41bf 100644 --- a/src/cc/flwr/include/flwr/proto/fleet.grpc.pb.h +++ b/src/cc/flwr/include/flwr/proto/fleet.grpc.pb.h @@ -66,6 +66,13 @@ class Fleet final { std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::flwr::proto::DeleteNodeResponse>> PrepareAsyncDeleteNode(::grpc::ClientContext* context, const ::flwr::proto::DeleteNodeRequest& request, ::grpc::CompletionQueue* cq) { return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::flwr::proto::DeleteNodeResponse>>(PrepareAsyncDeleteNodeRaw(context, request, cq)); } + virtual ::grpc::Status Ping(::grpc::ClientContext* context, const ::flwr::proto::PingRequest& request, ::flwr::proto::PingResponse* response) = 0; + std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::flwr::proto::PingResponse>> AsyncPing(::grpc::ClientContext* context, const ::flwr::proto::PingRequest& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::flwr::proto::PingResponse>>(AsyncPingRaw(context, request, cq)); + } + std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::flwr::proto::PingResponse>> PrepareAsyncPing(::grpc::ClientContext* context, const ::flwr::proto::PingRequest& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::flwr::proto::PingResponse>>(PrepareAsyncPingRaw(context, request, cq)); + } // Retrieve one or more tasks, if possible // // HTTP API path: /api/v1/fleet/pull-task-ins @@ -93,6 +100,8 @@ class Fleet final { virtual void CreateNode(::grpc::ClientContext* context, const ::flwr::proto::CreateNodeRequest* request, ::flwr::proto::CreateNodeResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; virtual void DeleteNode(::grpc::ClientContext* context, const ::flwr::proto::DeleteNodeRequest* request, ::flwr::proto::DeleteNodeResponse* response, std::function) = 0; virtual void DeleteNode(::grpc::ClientContext* context, const ::flwr::proto::DeleteNodeRequest* request, ::flwr::proto::DeleteNodeResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; + virtual void Ping(::grpc::ClientContext* context, const ::flwr::proto::PingRequest* request, ::flwr::proto::PingResponse* response, std::function) = 0; + virtual void Ping(::grpc::ClientContext* context, const ::flwr::proto::PingRequest* request, ::flwr::proto::PingResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; // Retrieve one or more tasks, if possible // // HTTP API path: /api/v1/fleet/pull-task-ins @@ -112,6 +121,8 @@ class Fleet final { virtual ::grpc::ClientAsyncResponseReaderInterface< ::flwr::proto::CreateNodeResponse>* PrepareAsyncCreateNodeRaw(::grpc::ClientContext* context, const ::flwr::proto::CreateNodeRequest& request, ::grpc::CompletionQueue* cq) = 0; virtual ::grpc::ClientAsyncResponseReaderInterface< ::flwr::proto::DeleteNodeResponse>* AsyncDeleteNodeRaw(::grpc::ClientContext* context, const ::flwr::proto::DeleteNodeRequest& request, ::grpc::CompletionQueue* cq) = 0; virtual ::grpc::ClientAsyncResponseReaderInterface< ::flwr::proto::DeleteNodeResponse>* PrepareAsyncDeleteNodeRaw(::grpc::ClientContext* context, const ::flwr::proto::DeleteNodeRequest& request, ::grpc::CompletionQueue* cq) = 0; + virtual ::grpc::ClientAsyncResponseReaderInterface< ::flwr::proto::PingResponse>* AsyncPingRaw(::grpc::ClientContext* context, const ::flwr::proto::PingRequest& request, ::grpc::CompletionQueue* cq) = 0; + virtual ::grpc::ClientAsyncResponseReaderInterface< ::flwr::proto::PingResponse>* PrepareAsyncPingRaw(::grpc::ClientContext* context, const ::flwr::proto::PingRequest& request, ::grpc::CompletionQueue* cq) = 0; virtual ::grpc::ClientAsyncResponseReaderInterface< ::flwr::proto::PullTaskInsResponse>* AsyncPullTaskInsRaw(::grpc::ClientContext* context, const ::flwr::proto::PullTaskInsRequest& request, ::grpc::CompletionQueue* cq) = 0; virtual ::grpc::ClientAsyncResponseReaderInterface< ::flwr::proto::PullTaskInsResponse>* PrepareAsyncPullTaskInsRaw(::grpc::ClientContext* context, const ::flwr::proto::PullTaskInsRequest& request, ::grpc::CompletionQueue* cq) = 0; virtual ::grpc::ClientAsyncResponseReaderInterface< ::flwr::proto::PushTaskResResponse>* AsyncPushTaskResRaw(::grpc::ClientContext* context, const ::flwr::proto::PushTaskResRequest& request, ::grpc::CompletionQueue* cq) = 0; @@ -134,6 +145,13 @@ class Fleet final { std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::flwr::proto::DeleteNodeResponse>> PrepareAsyncDeleteNode(::grpc::ClientContext* context, const ::flwr::proto::DeleteNodeRequest& request, ::grpc::CompletionQueue* cq) { return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::flwr::proto::DeleteNodeResponse>>(PrepareAsyncDeleteNodeRaw(context, request, cq)); } + ::grpc::Status Ping(::grpc::ClientContext* context, const ::flwr::proto::PingRequest& request, ::flwr::proto::PingResponse* response) override; + std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::flwr::proto::PingResponse>> AsyncPing(::grpc::ClientContext* context, const ::flwr::proto::PingRequest& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::flwr::proto::PingResponse>>(AsyncPingRaw(context, request, cq)); + } + std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::flwr::proto::PingResponse>> PrepareAsyncPing(::grpc::ClientContext* context, const ::flwr::proto::PingRequest& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::flwr::proto::PingResponse>>(PrepareAsyncPingRaw(context, request, cq)); + } ::grpc::Status PullTaskIns(::grpc::ClientContext* context, const ::flwr::proto::PullTaskInsRequest& request, ::flwr::proto::PullTaskInsResponse* response) override; std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::flwr::proto::PullTaskInsResponse>> AsyncPullTaskIns(::grpc::ClientContext* context, const ::flwr::proto::PullTaskInsRequest& request, ::grpc::CompletionQueue* cq) { return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::flwr::proto::PullTaskInsResponse>>(AsyncPullTaskInsRaw(context, request, cq)); @@ -155,6 +173,8 @@ class Fleet final { void CreateNode(::grpc::ClientContext* context, const ::flwr::proto::CreateNodeRequest* request, ::flwr::proto::CreateNodeResponse* response, ::grpc::ClientUnaryReactor* reactor) override; void DeleteNode(::grpc::ClientContext* context, const ::flwr::proto::DeleteNodeRequest* request, ::flwr::proto::DeleteNodeResponse* response, std::function) override; void DeleteNode(::grpc::ClientContext* context, const ::flwr::proto::DeleteNodeRequest* request, ::flwr::proto::DeleteNodeResponse* response, ::grpc::ClientUnaryReactor* reactor) override; + void Ping(::grpc::ClientContext* context, const ::flwr::proto::PingRequest* request, ::flwr::proto::PingResponse* response, std::function) override; + void Ping(::grpc::ClientContext* context, const ::flwr::proto::PingRequest* request, ::flwr::proto::PingResponse* response, ::grpc::ClientUnaryReactor* reactor) override; void PullTaskIns(::grpc::ClientContext* context, const ::flwr::proto::PullTaskInsRequest* request, ::flwr::proto::PullTaskInsResponse* response, std::function) override; void PullTaskIns(::grpc::ClientContext* context, const ::flwr::proto::PullTaskInsRequest* request, ::flwr::proto::PullTaskInsResponse* response, ::grpc::ClientUnaryReactor* reactor) override; void PushTaskRes(::grpc::ClientContext* context, const ::flwr::proto::PushTaskResRequest* request, ::flwr::proto::PushTaskResResponse* response, std::function) override; @@ -174,12 +194,15 @@ class Fleet final { ::grpc::ClientAsyncResponseReader< ::flwr::proto::CreateNodeResponse>* PrepareAsyncCreateNodeRaw(::grpc::ClientContext* context, const ::flwr::proto::CreateNodeRequest& request, ::grpc::CompletionQueue* cq) override; ::grpc::ClientAsyncResponseReader< ::flwr::proto::DeleteNodeResponse>* AsyncDeleteNodeRaw(::grpc::ClientContext* context, const ::flwr::proto::DeleteNodeRequest& request, ::grpc::CompletionQueue* cq) override; ::grpc::ClientAsyncResponseReader< ::flwr::proto::DeleteNodeResponse>* PrepareAsyncDeleteNodeRaw(::grpc::ClientContext* context, const ::flwr::proto::DeleteNodeRequest& request, ::grpc::CompletionQueue* cq) override; + ::grpc::ClientAsyncResponseReader< ::flwr::proto::PingResponse>* AsyncPingRaw(::grpc::ClientContext* context, const ::flwr::proto::PingRequest& request, ::grpc::CompletionQueue* cq) override; + ::grpc::ClientAsyncResponseReader< ::flwr::proto::PingResponse>* PrepareAsyncPingRaw(::grpc::ClientContext* context, const ::flwr::proto::PingRequest& request, ::grpc::CompletionQueue* cq) override; ::grpc::ClientAsyncResponseReader< ::flwr::proto::PullTaskInsResponse>* AsyncPullTaskInsRaw(::grpc::ClientContext* context, const ::flwr::proto::PullTaskInsRequest& request, ::grpc::CompletionQueue* cq) override; ::grpc::ClientAsyncResponseReader< ::flwr::proto::PullTaskInsResponse>* PrepareAsyncPullTaskInsRaw(::grpc::ClientContext* context, const ::flwr::proto::PullTaskInsRequest& request, ::grpc::CompletionQueue* cq) override; ::grpc::ClientAsyncResponseReader< ::flwr::proto::PushTaskResResponse>* AsyncPushTaskResRaw(::grpc::ClientContext* context, const ::flwr::proto::PushTaskResRequest& request, ::grpc::CompletionQueue* cq) override; ::grpc::ClientAsyncResponseReader< ::flwr::proto::PushTaskResResponse>* PrepareAsyncPushTaskResRaw(::grpc::ClientContext* context, const ::flwr::proto::PushTaskResRequest& request, ::grpc::CompletionQueue* cq) override; const ::grpc::internal::RpcMethod rpcmethod_CreateNode_; const ::grpc::internal::RpcMethod rpcmethod_DeleteNode_; + const ::grpc::internal::RpcMethod rpcmethod_Ping_; const ::grpc::internal::RpcMethod rpcmethod_PullTaskIns_; const ::grpc::internal::RpcMethod rpcmethod_PushTaskRes_; }; @@ -191,6 +214,7 @@ class Fleet final { virtual ~Service(); virtual ::grpc::Status CreateNode(::grpc::ServerContext* context, const ::flwr::proto::CreateNodeRequest* request, ::flwr::proto::CreateNodeResponse* response); virtual ::grpc::Status DeleteNode(::grpc::ServerContext* context, const ::flwr::proto::DeleteNodeRequest* request, ::flwr::proto::DeleteNodeResponse* response); + virtual ::grpc::Status Ping(::grpc::ServerContext* context, const ::flwr::proto::PingRequest* request, ::flwr::proto::PingResponse* response); // Retrieve one or more tasks, if possible // // HTTP API path: /api/v1/fleet/pull-task-ins @@ -241,12 +265,32 @@ class Fleet final { } }; template + class WithAsyncMethod_Ping : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithAsyncMethod_Ping() { + ::grpc::Service::MarkMethodAsync(2); + } + ~WithAsyncMethod_Ping() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status Ping(::grpc::ServerContext* /*context*/, const ::flwr::proto::PingRequest* /*request*/, ::flwr::proto::PingResponse* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + void RequestPing(::grpc::ServerContext* context, ::flwr::proto::PingRequest* request, ::grpc::ServerAsyncResponseWriter< ::flwr::proto::PingResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { + ::grpc::Service::RequestAsyncUnary(2, context, request, response, new_call_cq, notification_cq, tag); + } + }; + template class WithAsyncMethod_PullTaskIns : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithAsyncMethod_PullTaskIns() { - ::grpc::Service::MarkMethodAsync(2); + ::grpc::Service::MarkMethodAsync(3); } ~WithAsyncMethod_PullTaskIns() override { BaseClassMustBeDerivedFromService(this); @@ -257,7 +301,7 @@ class Fleet final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestPullTaskIns(::grpc::ServerContext* context, ::flwr::proto::PullTaskInsRequest* request, ::grpc::ServerAsyncResponseWriter< ::flwr::proto::PullTaskInsResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(2, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(3, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -266,7 +310,7 @@ class Fleet final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithAsyncMethod_PushTaskRes() { - ::grpc::Service::MarkMethodAsync(3); + ::grpc::Service::MarkMethodAsync(4); } ~WithAsyncMethod_PushTaskRes() override { BaseClassMustBeDerivedFromService(this); @@ -277,10 +321,10 @@ class Fleet final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestPushTaskRes(::grpc::ServerContext* context, ::flwr::proto::PushTaskResRequest* request, ::grpc::ServerAsyncResponseWriter< ::flwr::proto::PushTaskResResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(3, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(4, context, request, response, new_call_cq, notification_cq, tag); } }; - typedef WithAsyncMethod_CreateNode > > > AsyncService; + typedef WithAsyncMethod_CreateNode > > > > AsyncService; template class WithCallbackMethod_CreateNode : public BaseClass { private: @@ -336,18 +380,45 @@ class Fleet final { ::grpc::CallbackServerContext* /*context*/, const ::flwr::proto::DeleteNodeRequest* /*request*/, ::flwr::proto::DeleteNodeResponse* /*response*/) { return nullptr; } }; template + class WithCallbackMethod_Ping : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithCallbackMethod_Ping() { + ::grpc::Service::MarkMethodCallback(2, + new ::grpc::internal::CallbackUnaryHandler< ::flwr::proto::PingRequest, ::flwr::proto::PingResponse>( + [this]( + ::grpc::CallbackServerContext* context, const ::flwr::proto::PingRequest* request, ::flwr::proto::PingResponse* response) { return this->Ping(context, request, response); }));} + void SetMessageAllocatorFor_Ping( + ::grpc::MessageAllocator< ::flwr::proto::PingRequest, ::flwr::proto::PingResponse>* allocator) { + ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(2); + static_cast<::grpc::internal::CallbackUnaryHandler< ::flwr::proto::PingRequest, ::flwr::proto::PingResponse>*>(handler) + ->SetMessageAllocator(allocator); + } + ~WithCallbackMethod_Ping() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status Ping(::grpc::ServerContext* /*context*/, const ::flwr::proto::PingRequest* /*request*/, ::flwr::proto::PingResponse* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + virtual ::grpc::ServerUnaryReactor* Ping( + ::grpc::CallbackServerContext* /*context*/, const ::flwr::proto::PingRequest* /*request*/, ::flwr::proto::PingResponse* /*response*/) { return nullptr; } + }; + template class WithCallbackMethod_PullTaskIns : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithCallbackMethod_PullTaskIns() { - ::grpc::Service::MarkMethodCallback(2, + ::grpc::Service::MarkMethodCallback(3, new ::grpc::internal::CallbackUnaryHandler< ::flwr::proto::PullTaskInsRequest, ::flwr::proto::PullTaskInsResponse>( [this]( ::grpc::CallbackServerContext* context, const ::flwr::proto::PullTaskInsRequest* request, ::flwr::proto::PullTaskInsResponse* response) { return this->PullTaskIns(context, request, response); }));} void SetMessageAllocatorFor_PullTaskIns( ::grpc::MessageAllocator< ::flwr::proto::PullTaskInsRequest, ::flwr::proto::PullTaskInsResponse>* allocator) { - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(2); + ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(3); static_cast<::grpc::internal::CallbackUnaryHandler< ::flwr::proto::PullTaskInsRequest, ::flwr::proto::PullTaskInsResponse>*>(handler) ->SetMessageAllocator(allocator); } @@ -368,13 +439,13 @@ class Fleet final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithCallbackMethod_PushTaskRes() { - ::grpc::Service::MarkMethodCallback(3, + ::grpc::Service::MarkMethodCallback(4, new ::grpc::internal::CallbackUnaryHandler< ::flwr::proto::PushTaskResRequest, ::flwr::proto::PushTaskResResponse>( [this]( ::grpc::CallbackServerContext* context, const ::flwr::proto::PushTaskResRequest* request, ::flwr::proto::PushTaskResResponse* response) { return this->PushTaskRes(context, request, response); }));} void SetMessageAllocatorFor_PushTaskRes( ::grpc::MessageAllocator< ::flwr::proto::PushTaskResRequest, ::flwr::proto::PushTaskResResponse>* allocator) { - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(3); + ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(4); static_cast<::grpc::internal::CallbackUnaryHandler< ::flwr::proto::PushTaskResRequest, ::flwr::proto::PushTaskResResponse>*>(handler) ->SetMessageAllocator(allocator); } @@ -389,7 +460,7 @@ class Fleet final { virtual ::grpc::ServerUnaryReactor* PushTaskRes( ::grpc::CallbackServerContext* /*context*/, const ::flwr::proto::PushTaskResRequest* /*request*/, ::flwr::proto::PushTaskResResponse* /*response*/) { return nullptr; } }; - typedef WithCallbackMethod_CreateNode > > > CallbackService; + typedef WithCallbackMethod_CreateNode > > > > CallbackService; typedef CallbackService ExperimentalCallbackService; template class WithGenericMethod_CreateNode : public BaseClass { @@ -426,12 +497,29 @@ class Fleet final { } }; template + class WithGenericMethod_Ping : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithGenericMethod_Ping() { + ::grpc::Service::MarkMethodGeneric(2); + } + ~WithGenericMethod_Ping() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status Ping(::grpc::ServerContext* /*context*/, const ::flwr::proto::PingRequest* /*request*/, ::flwr::proto::PingResponse* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + }; + template class WithGenericMethod_PullTaskIns : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithGenericMethod_PullTaskIns() { - ::grpc::Service::MarkMethodGeneric(2); + ::grpc::Service::MarkMethodGeneric(3); } ~WithGenericMethod_PullTaskIns() override { BaseClassMustBeDerivedFromService(this); @@ -448,7 +536,7 @@ class Fleet final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithGenericMethod_PushTaskRes() { - ::grpc::Service::MarkMethodGeneric(3); + ::grpc::Service::MarkMethodGeneric(4); } ~WithGenericMethod_PushTaskRes() override { BaseClassMustBeDerivedFromService(this); @@ -500,12 +588,32 @@ class Fleet final { } }; template + class WithRawMethod_Ping : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithRawMethod_Ping() { + ::grpc::Service::MarkMethodRaw(2); + } + ~WithRawMethod_Ping() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status Ping(::grpc::ServerContext* /*context*/, const ::flwr::proto::PingRequest* /*request*/, ::flwr::proto::PingResponse* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + void RequestPing(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { + ::grpc::Service::RequestAsyncUnary(2, context, request, response, new_call_cq, notification_cq, tag); + } + }; + template class WithRawMethod_PullTaskIns : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawMethod_PullTaskIns() { - ::grpc::Service::MarkMethodRaw(2); + ::grpc::Service::MarkMethodRaw(3); } ~WithRawMethod_PullTaskIns() override { BaseClassMustBeDerivedFromService(this); @@ -516,7 +624,7 @@ class Fleet final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestPullTaskIns(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(2, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(3, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -525,7 +633,7 @@ class Fleet final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawMethod_PushTaskRes() { - ::grpc::Service::MarkMethodRaw(3); + ::grpc::Service::MarkMethodRaw(4); } ~WithRawMethod_PushTaskRes() override { BaseClassMustBeDerivedFromService(this); @@ -536,7 +644,7 @@ class Fleet final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestPushTaskRes(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(3, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(4, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -584,12 +692,34 @@ class Fleet final { ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } }; template + class WithRawCallbackMethod_Ping : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithRawCallbackMethod_Ping() { + ::grpc::Service::MarkMethodRawCallback(2, + new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( + [this]( + ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->Ping(context, request, response); })); + } + ~WithRawCallbackMethod_Ping() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status Ping(::grpc::ServerContext* /*context*/, const ::flwr::proto::PingRequest* /*request*/, ::flwr::proto::PingResponse* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + virtual ::grpc::ServerUnaryReactor* Ping( + ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } + }; + template class WithRawCallbackMethod_PullTaskIns : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawCallbackMethod_PullTaskIns() { - ::grpc::Service::MarkMethodRawCallback(2, + ::grpc::Service::MarkMethodRawCallback(3, new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->PullTaskIns(context, request, response); })); @@ -611,7 +741,7 @@ class Fleet final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawCallbackMethod_PushTaskRes() { - ::grpc::Service::MarkMethodRawCallback(3, + ::grpc::Service::MarkMethodRawCallback(4, new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->PushTaskRes(context, request, response); })); @@ -682,12 +812,39 @@ class Fleet final { virtual ::grpc::Status StreamedDeleteNode(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::flwr::proto::DeleteNodeRequest,::flwr::proto::DeleteNodeResponse>* server_unary_streamer) = 0; }; template + class WithStreamedUnaryMethod_Ping : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithStreamedUnaryMethod_Ping() { + ::grpc::Service::MarkMethodStreamed(2, + new ::grpc::internal::StreamedUnaryHandler< + ::flwr::proto::PingRequest, ::flwr::proto::PingResponse>( + [this](::grpc::ServerContext* context, + ::grpc::ServerUnaryStreamer< + ::flwr::proto::PingRequest, ::flwr::proto::PingResponse>* streamer) { + return this->StreamedPing(context, + streamer); + })); + } + ~WithStreamedUnaryMethod_Ping() override { + BaseClassMustBeDerivedFromService(this); + } + // disable regular version of this method + ::grpc::Status Ping(::grpc::ServerContext* /*context*/, const ::flwr::proto::PingRequest* /*request*/, ::flwr::proto::PingResponse* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + // replace default version of method with streamed unary + virtual ::grpc::Status StreamedPing(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::flwr::proto::PingRequest,::flwr::proto::PingResponse>* server_unary_streamer) = 0; + }; + template class WithStreamedUnaryMethod_PullTaskIns : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithStreamedUnaryMethod_PullTaskIns() { - ::grpc::Service::MarkMethodStreamed(2, + ::grpc::Service::MarkMethodStreamed(3, new ::grpc::internal::StreamedUnaryHandler< ::flwr::proto::PullTaskInsRequest, ::flwr::proto::PullTaskInsResponse>( [this](::grpc::ServerContext* context, @@ -714,7 +871,7 @@ class Fleet final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithStreamedUnaryMethod_PushTaskRes() { - ::grpc::Service::MarkMethodStreamed(3, + ::grpc::Service::MarkMethodStreamed(4, new ::grpc::internal::StreamedUnaryHandler< ::flwr::proto::PushTaskResRequest, ::flwr::proto::PushTaskResResponse>( [this](::grpc::ServerContext* context, @@ -735,9 +892,9 @@ class Fleet final { // replace default version of method with streamed unary virtual ::grpc::Status StreamedPushTaskRes(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::flwr::proto::PushTaskResRequest,::flwr::proto::PushTaskResResponse>* server_unary_streamer) = 0; }; - typedef WithStreamedUnaryMethod_CreateNode > > > StreamedUnaryService; + typedef WithStreamedUnaryMethod_CreateNode > > > > StreamedUnaryService; typedef Service SplitStreamedService; - typedef WithStreamedUnaryMethod_CreateNode > > > StreamedService; + typedef WithStreamedUnaryMethod_CreateNode > > > > StreamedService; }; } // namespace proto diff --git a/src/cc/flwr/include/flwr/proto/fleet.pb.cc b/src/cc/flwr/include/flwr/proto/fleet.pb.cc index 302331374db..b519b4f8736 100644 --- a/src/cc/flwr/include/flwr/proto/fleet.pb.cc +++ b/src/cc/flwr/include/flwr/proto/fleet.pb.cc @@ -64,6 +64,31 @@ struct DeleteNodeResponseDefaultTypeInternal { }; }; PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT DeleteNodeResponseDefaultTypeInternal _DeleteNodeResponse_default_instance_; +constexpr PingRequest::PingRequest( + ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) + : node_(nullptr) + , ping_interval_(0){} +struct PingRequestDefaultTypeInternal { + constexpr PingRequestDefaultTypeInternal() + : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + ~PingRequestDefaultTypeInternal() {} + union { + PingRequest _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PingRequestDefaultTypeInternal _PingRequest_default_instance_; +constexpr PingResponse::PingResponse( + ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) + : success_(false){} +struct PingResponseDefaultTypeInternal { + constexpr PingResponseDefaultTypeInternal() + : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + ~PingResponseDefaultTypeInternal() {} + union { + PingResponse _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PingResponseDefaultTypeInternal _PingResponse_default_instance_; constexpr PullTaskInsRequest::PullTaskInsRequest( ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) : task_ids_() @@ -140,7 +165,7 @@ struct ReconnectDefaultTypeInternal { PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT ReconnectDefaultTypeInternal _Reconnect_default_instance_; } // namespace proto } // namespace flwr -static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_flwr_2fproto_2ffleet_2eproto[10]; +static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_flwr_2fproto_2ffleet_2eproto[12]; static constexpr ::PROTOBUF_NAMESPACE_ID::EnumDescriptor const** file_level_enum_descriptors_flwr_2fproto_2ffleet_2eproto = nullptr; static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_flwr_2fproto_2ffleet_2eproto = nullptr; @@ -172,6 +197,21 @@ const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_flwr_2fproto_2ffleet_2eproto:: ~0u, // no _weak_field_map_ ~0u, // no _inlined_string_donated_ ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::flwr::proto::PingRequest, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::flwr::proto::PingRequest, node_), + PROTOBUF_FIELD_OFFSET(::flwr::proto::PingRequest, ping_interval_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::flwr::proto::PingResponse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::flwr::proto::PingResponse, success_), + ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::flwr::proto::PullTaskInsRequest, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ @@ -225,12 +265,14 @@ static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOB { 6, -1, -1, sizeof(::flwr::proto::CreateNodeResponse)}, { 13, -1, -1, sizeof(::flwr::proto::DeleteNodeRequest)}, { 20, -1, -1, sizeof(::flwr::proto::DeleteNodeResponse)}, - { 26, -1, -1, sizeof(::flwr::proto::PullTaskInsRequest)}, - { 34, -1, -1, sizeof(::flwr::proto::PullTaskInsResponse)}, - { 42, -1, -1, sizeof(::flwr::proto::PushTaskResRequest)}, - { 49, 57, -1, sizeof(::flwr::proto::PushTaskResResponse_ResultsEntry_DoNotUse)}, - { 59, -1, -1, sizeof(::flwr::proto::PushTaskResResponse)}, - { 67, -1, -1, sizeof(::flwr::proto::Reconnect)}, + { 26, -1, -1, sizeof(::flwr::proto::PingRequest)}, + { 34, -1, -1, sizeof(::flwr::proto::PingResponse)}, + { 41, -1, -1, sizeof(::flwr::proto::PullTaskInsRequest)}, + { 49, -1, -1, sizeof(::flwr::proto::PullTaskInsResponse)}, + { 57, -1, -1, sizeof(::flwr::proto::PushTaskResRequest)}, + { 64, 72, -1, sizeof(::flwr::proto::PushTaskResResponse_ResultsEntry_DoNotUse)}, + { 74, -1, -1, sizeof(::flwr::proto::PushTaskResResponse)}, + { 82, -1, -1, sizeof(::flwr::proto::Reconnect)}, }; static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = { @@ -238,6 +280,8 @@ static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = reinterpret_cast(&::flwr::proto::_CreateNodeResponse_default_instance_), reinterpret_cast(&::flwr::proto::_DeleteNodeRequest_default_instance_), reinterpret_cast(&::flwr::proto::_DeleteNodeResponse_default_instance_), + reinterpret_cast(&::flwr::proto::_PingRequest_default_instance_), + reinterpret_cast(&::flwr::proto::_PingResponse_default_instance_), reinterpret_cast(&::flwr::proto::_PullTaskInsRequest_default_instance_), reinterpret_cast(&::flwr::proto::_PullTaskInsResponse_default_instance_), reinterpret_cast(&::flwr::proto::_PushTaskResRequest_default_instance_), @@ -252,27 +296,31 @@ const char descriptor_table_protodef_flwr_2fproto_2ffleet_2eproto[] PROTOBUF_SEC "to\"\023\n\021CreateNodeRequest\"4\n\022CreateNodeRes" "ponse\022\036\n\004node\030\001 \001(\0132\020.flwr.proto.Node\"3\n" "\021DeleteNodeRequest\022\036\n\004node\030\001 \001(\0132\020.flwr." - "proto.Node\"\024\n\022DeleteNodeResponse\"F\n\022Pull" - "TaskInsRequest\022\036\n\004node\030\001 \001(\0132\020.flwr.prot" - "o.Node\022\020\n\010task_ids\030\002 \003(\t\"k\n\023PullTaskInsR" - "esponse\022(\n\treconnect\030\001 \001(\0132\025.flwr.proto." - "Reconnect\022*\n\rtask_ins_list\030\002 \003(\0132\023.flwr." - "proto.TaskIns\"@\n\022PushTaskResRequest\022*\n\rt" - "ask_res_list\030\001 \003(\0132\023.flwr.proto.TaskRes\"" - "\256\001\n\023PushTaskResResponse\022(\n\treconnect\030\001 \001" - "(\0132\025.flwr.proto.Reconnect\022=\n\007results\030\002 \003" - "(\0132,.flwr.proto.PushTaskResResponse.Resu" - "ltsEntry\032.\n\014ResultsEntry\022\013\n\003key\030\001 \001(\t\022\r\n" - "\005value\030\002 \001(\r:\0028\001\"\036\n\tReconnect\022\021\n\treconne" - "ct\030\001 \001(\0042\311\002\n\005Fleet\022M\n\nCreateNode\022\035.flwr." - "proto.CreateNodeRequest\032\036.flwr.proto.Cre" - "ateNodeResponse\"\000\022M\n\nDeleteNode\022\035.flwr.p" - "roto.DeleteNodeRequest\032\036.flwr.proto.Dele" - "teNodeResponse\"\000\022P\n\013PullTaskIns\022\036.flwr.p" - "roto.PullTaskInsRequest\032\037.flwr.proto.Pul" - "lTaskInsResponse\"\000\022P\n\013PushTaskRes\022\036.flwr" - ".proto.PushTaskResRequest\032\037.flwr.proto.P" - "ushTaskResResponse\"\000b\006proto3" + "proto.Node\"\024\n\022DeleteNodeResponse\"D\n\013Ping" + "Request\022\036\n\004node\030\001 \001(\0132\020.flwr.proto.Node\022" + "\025\n\rping_interval\030\002 \001(\001\"\037\n\014PingResponse\022\017" + "\n\007success\030\001 \001(\010\"F\n\022PullTaskInsRequest\022\036\n" + "\004node\030\001 \001(\0132\020.flwr.proto.Node\022\020\n\010task_id" + "s\030\002 \003(\t\"k\n\023PullTaskInsResponse\022(\n\treconn" + "ect\030\001 \001(\0132\025.flwr.proto.Reconnect\022*\n\rtask" + "_ins_list\030\002 \003(\0132\023.flwr.proto.TaskIns\"@\n\022" + "PushTaskResRequest\022*\n\rtask_res_list\030\001 \003(" + "\0132\023.flwr.proto.TaskRes\"\256\001\n\023PushTaskResRe" + "sponse\022(\n\treconnect\030\001 \001(\0132\025.flwr.proto.R" + "econnect\022=\n\007results\030\002 \003(\0132,.flwr.proto.P" + "ushTaskResResponse.ResultsEntry\032.\n\014Resul" + "tsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\r:\0028\001\"" + "\036\n\tReconnect\022\021\n\treconnect\030\001 \001(\0042\206\003\n\005Flee" + "t\022M\n\nCreateNode\022\035.flwr.proto.CreateNodeR" + "equest\032\036.flwr.proto.CreateNodeResponse\"\000" + "\022M\n\nDeleteNode\022\035.flwr.proto.DeleteNodeRe" + "quest\032\036.flwr.proto.DeleteNodeResponse\"\000\022" + ";\n\004Ping\022\027.flwr.proto.PingRequest\032\030.flwr." + "proto.PingResponse\"\000\022P\n\013PullTaskIns\022\036.fl" + "wr.proto.PullTaskInsRequest\032\037.flwr.proto" + ".PullTaskInsResponse\"\000\022P\n\013PushTaskRes\022\036." + "flwr.proto.PushTaskResRequest\032\037.flwr.pro" + "to.PushTaskResResponse\"\000b\006proto3" ; static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_flwr_2fproto_2ffleet_2eproto_deps[2] = { &::descriptor_table_flwr_2fproto_2fnode_2eproto, @@ -280,8 +328,8 @@ static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor }; static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_flwr_2fproto_2ffleet_2eproto_once; const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_flwr_2fproto_2ffleet_2eproto = { - false, false, 1028, descriptor_table_protodef_flwr_2fproto_2ffleet_2eproto, "flwr/proto/fleet.proto", - &descriptor_table_flwr_2fproto_2ffleet_2eproto_once, descriptor_table_flwr_2fproto_2ffleet_2eproto_deps, 2, 10, + false, false, 1192, descriptor_table_protodef_flwr_2fproto_2ffleet_2eproto, "flwr/proto/fleet.proto", + &descriptor_table_flwr_2fproto_2ffleet_2eproto_once, descriptor_table_flwr_2fproto_2ffleet_2eproto_deps, 2, 12, schemas, file_default_instances, TableStruct_flwr_2fproto_2ffleet_2eproto::offsets, file_level_metadata_flwr_2fproto_2ffleet_2eproto, file_level_enum_descriptors_flwr_2fproto_2ffleet_2eproto, file_level_service_descriptors_flwr_2fproto_2ffleet_2eproto, }; @@ -776,6 +824,417 @@ ::PROTOBUF_NAMESPACE_ID::Metadata DeleteNodeResponse::GetMetadata() const { // =================================================================== +class PingRequest::_Internal { + public: + static const ::flwr::proto::Node& node(const PingRequest* msg); +}; + +const ::flwr::proto::Node& +PingRequest::_Internal::node(const PingRequest* msg) { + return *msg->node_; +} +void PingRequest::clear_node() { + if (GetArenaForAllocation() == nullptr && node_ != nullptr) { + delete node_; + } + node_ = nullptr; +} +PingRequest::PingRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + SharedCtor(); + if (!is_message_owned) { + RegisterArenaDtor(arena); + } + // @@protoc_insertion_point(arena_constructor:flwr.proto.PingRequest) +} +PingRequest::PingRequest(const PingRequest& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + if (from._internal_has_node()) { + node_ = new ::flwr::proto::Node(*from.node_); + } else { + node_ = nullptr; + } + ping_interval_ = from.ping_interval_; + // @@protoc_insertion_point(copy_constructor:flwr.proto.PingRequest) +} + +void PingRequest::SharedCtor() { +::memset(reinterpret_cast(this) + static_cast( + reinterpret_cast(&node_) - reinterpret_cast(this)), + 0, static_cast(reinterpret_cast(&ping_interval_) - + reinterpret_cast(&node_)) + sizeof(ping_interval_)); +} + +PingRequest::~PingRequest() { + // @@protoc_insertion_point(destructor:flwr.proto.PingRequest) + if (GetArenaForAllocation() != nullptr) return; + SharedDtor(); + _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +inline void PingRequest::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + if (this != internal_default_instance()) delete node_; +} + +void PingRequest::ArenaDtor(void* object) { + PingRequest* _this = reinterpret_cast< PingRequest* >(object); + (void)_this; +} +void PingRequest::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { +} +void PingRequest::SetCachedSize(int size) const { + _cached_size_.Set(size); +} + +void PingRequest::Clear() { +// @@protoc_insertion_point(message_clear_start:flwr.proto.PingRequest) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaForAllocation() == nullptr && node_ != nullptr) { + delete node_; + } + node_ = nullptr; + ping_interval_ = 0; + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* PingRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + switch (tag >> 3) { + // .flwr.proto.Node node = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + ptr = ctx->ParseMessage(_internal_mutable_node(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // double ping_interval = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 17)) { + ping_interval_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr); + ptr += sizeof(double); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +::PROTOBUF_NAMESPACE_ID::uint8* PingRequest::_InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:flwr.proto.PingRequest) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .flwr.proto.Node node = 1; + if (this->_internal_has_node()) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage( + 1, _Internal::node(this), target, stream); + } + + // double ping_interval = 2; + if (!(this->_internal_ping_interval() <= 0 && this->_internal_ping_interval() >= 0)) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteDoubleToArray(2, this->_internal_ping_interval(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:flwr.proto.PingRequest) + return target; +} + +size_t PingRequest::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:flwr.proto.PingRequest) + size_t total_size = 0; + + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // .flwr.proto.Node node = 1; + if (this->_internal_has_node()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *node_); + } + + // double ping_interval = 2; + if (!(this->_internal_ping_interval() <= 0 && this->_internal_ping_interval() >= 0)) { + total_size += 1 + 8; + } + + return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData PingRequest::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck, + PingRequest::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*PingRequest::GetClassData() const { return &_class_data_; } + +void PingRequest::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, + const ::PROTOBUF_NAMESPACE_ID::Message& from) { + static_cast(to)->MergeFrom( + static_cast(from)); +} + + +void PingRequest::MergeFrom(const PingRequest& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:flwr.proto.PingRequest) + GOOGLE_DCHECK_NE(&from, this); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from._internal_has_node()) { + _internal_mutable_node()->::flwr::proto::Node::MergeFrom(from._internal_node()); + } + if (!(from._internal_ping_interval() <= 0 && from._internal_ping_interval() >= 0)) { + _internal_set_ping_interval(from._internal_ping_interval()); + } + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void PingRequest::CopyFrom(const PingRequest& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:flwr.proto.PingRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool PingRequest::IsInitialized() const { + return true; +} + +void PingRequest::InternalSwap(PingRequest* other) { + using std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + PROTOBUF_FIELD_OFFSET(PingRequest, ping_interval_) + + sizeof(PingRequest::ping_interval_) + - PROTOBUF_FIELD_OFFSET(PingRequest, node_)>( + reinterpret_cast(&node_), + reinterpret_cast(&other->node_)); +} + +::PROTOBUF_NAMESPACE_ID::Metadata PingRequest::GetMetadata() const { + return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + &descriptor_table_flwr_2fproto_2ffleet_2eproto_getter, &descriptor_table_flwr_2fproto_2ffleet_2eproto_once, + file_level_metadata_flwr_2fproto_2ffleet_2eproto[4]); +} + +// =================================================================== + +class PingResponse::_Internal { + public: +}; + +PingResponse::PingResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + SharedCtor(); + if (!is_message_owned) { + RegisterArenaDtor(arena); + } + // @@protoc_insertion_point(arena_constructor:flwr.proto.PingResponse) +} +PingResponse::PingResponse(const PingResponse& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + success_ = from.success_; + // @@protoc_insertion_point(copy_constructor:flwr.proto.PingResponse) +} + +void PingResponse::SharedCtor() { +success_ = false; +} + +PingResponse::~PingResponse() { + // @@protoc_insertion_point(destructor:flwr.proto.PingResponse) + if (GetArenaForAllocation() != nullptr) return; + SharedDtor(); + _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +inline void PingResponse::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); +} + +void PingResponse::ArenaDtor(void* object) { + PingResponse* _this = reinterpret_cast< PingResponse* >(object); + (void)_this; +} +void PingResponse::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { +} +void PingResponse::SetCachedSize(int size) const { + _cached_size_.Set(size); +} + +void PingResponse::Clear() { +// @@protoc_insertion_point(message_clear_start:flwr.proto.PingResponse) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + success_ = false; + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* PingResponse::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + switch (tag >> 3) { + // bool success = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { + success_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +::PROTOBUF_NAMESPACE_ID::uint8* PingResponse::_InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:flwr.proto.PingResponse) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // bool success = 1; + if (this->_internal_success() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(1, this->_internal_success(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:flwr.proto.PingResponse) + return target; +} + +size_t PingResponse::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:flwr.proto.PingResponse) + size_t total_size = 0; + + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // bool success = 1; + if (this->_internal_success() != 0) { + total_size += 1 + 1; + } + + return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData PingResponse::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck, + PingResponse::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*PingResponse::GetClassData() const { return &_class_data_; } + +void PingResponse::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, + const ::PROTOBUF_NAMESPACE_ID::Message& from) { + static_cast(to)->MergeFrom( + static_cast(from)); +} + + +void PingResponse::MergeFrom(const PingResponse& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:flwr.proto.PingResponse) + GOOGLE_DCHECK_NE(&from, this); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from._internal_success() != 0) { + _internal_set_success(from._internal_success()); + } + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void PingResponse::CopyFrom(const PingResponse& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:flwr.proto.PingResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool PingResponse::IsInitialized() const { + return true; +} + +void PingResponse::InternalSwap(PingResponse* other) { + using std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(success_, other->success_); +} + +::PROTOBUF_NAMESPACE_ID::Metadata PingResponse::GetMetadata() const { + return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + &descriptor_table_flwr_2fproto_2ffleet_2eproto_getter, &descriptor_table_flwr_2fproto_2ffleet_2eproto_once, + file_level_metadata_flwr_2fproto_2ffleet_2eproto[5]); +} + +// =================================================================== + class PullTaskInsRequest::_Internal { public: static const ::flwr::proto::Node& node(const PullTaskInsRequest* msg); @@ -1010,7 +1469,7 @@ void PullTaskInsRequest::InternalSwap(PullTaskInsRequest* other) { ::PROTOBUF_NAMESPACE_ID::Metadata PullTaskInsRequest::GetMetadata() const { return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( &descriptor_table_flwr_2fproto_2ffleet_2eproto_getter, &descriptor_table_flwr_2fproto_2ffleet_2eproto_once, - file_level_metadata_flwr_2fproto_2ffleet_2eproto[4]); + file_level_metadata_flwr_2fproto_2ffleet_2eproto[6]); } // =================================================================== @@ -1241,7 +1700,7 @@ void PullTaskInsResponse::InternalSwap(PullTaskInsResponse* other) { ::PROTOBUF_NAMESPACE_ID::Metadata PullTaskInsResponse::GetMetadata() const { return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( &descriptor_table_flwr_2fproto_2ffleet_2eproto_getter, &descriptor_table_flwr_2fproto_2ffleet_2eproto_once, - file_level_metadata_flwr_2fproto_2ffleet_2eproto[5]); + file_level_metadata_flwr_2fproto_2ffleet_2eproto[7]); } // =================================================================== @@ -1429,7 +1888,7 @@ void PushTaskResRequest::InternalSwap(PushTaskResRequest* other) { ::PROTOBUF_NAMESPACE_ID::Metadata PushTaskResRequest::GetMetadata() const { return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( &descriptor_table_flwr_2fproto_2ffleet_2eproto_getter, &descriptor_table_flwr_2fproto_2ffleet_2eproto_once, - file_level_metadata_flwr_2fproto_2ffleet_2eproto[6]); + file_level_metadata_flwr_2fproto_2ffleet_2eproto[8]); } // =================================================================== @@ -1443,7 +1902,7 @@ void PushTaskResResponse_ResultsEntry_DoNotUse::MergeFrom(const PushTaskResRespo ::PROTOBUF_NAMESPACE_ID::Metadata PushTaskResResponse_ResultsEntry_DoNotUse::GetMetadata() const { return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( &descriptor_table_flwr_2fproto_2ffleet_2eproto_getter, &descriptor_table_flwr_2fproto_2ffleet_2eproto_once, - file_level_metadata_flwr_2fproto_2ffleet_2eproto[7]); + file_level_metadata_flwr_2fproto_2ffleet_2eproto[9]); } // =================================================================== @@ -1711,7 +2170,7 @@ void PushTaskResResponse::InternalSwap(PushTaskResResponse* other) { ::PROTOBUF_NAMESPACE_ID::Metadata PushTaskResResponse::GetMetadata() const { return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( &descriptor_table_flwr_2fproto_2ffleet_2eproto_getter, &descriptor_table_flwr_2fproto_2ffleet_2eproto_once, - file_level_metadata_flwr_2fproto_2ffleet_2eproto[8]); + file_level_metadata_flwr_2fproto_2ffleet_2eproto[10]); } // =================================================================== @@ -1889,7 +2348,7 @@ void Reconnect::InternalSwap(Reconnect* other) { ::PROTOBUF_NAMESPACE_ID::Metadata Reconnect::GetMetadata() const { return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( &descriptor_table_flwr_2fproto_2ffleet_2eproto_getter, &descriptor_table_flwr_2fproto_2ffleet_2eproto_once, - file_level_metadata_flwr_2fproto_2ffleet_2eproto[9]); + file_level_metadata_flwr_2fproto_2ffleet_2eproto[11]); } // @@protoc_insertion_point(namespace_scope) @@ -1908,6 +2367,12 @@ template<> PROTOBUF_NOINLINE ::flwr::proto::DeleteNodeRequest* Arena::CreateMayb template<> PROTOBUF_NOINLINE ::flwr::proto::DeleteNodeResponse* Arena::CreateMaybeMessage< ::flwr::proto::DeleteNodeResponse >(Arena* arena) { return Arena::CreateMessageInternal< ::flwr::proto::DeleteNodeResponse >(arena); } +template<> PROTOBUF_NOINLINE ::flwr::proto::PingRequest* Arena::CreateMaybeMessage< ::flwr::proto::PingRequest >(Arena* arena) { + return Arena::CreateMessageInternal< ::flwr::proto::PingRequest >(arena); +} +template<> PROTOBUF_NOINLINE ::flwr::proto::PingResponse* Arena::CreateMaybeMessage< ::flwr::proto::PingResponse >(Arena* arena) { + return Arena::CreateMessageInternal< ::flwr::proto::PingResponse >(arena); +} template<> PROTOBUF_NOINLINE ::flwr::proto::PullTaskInsRequest* Arena::CreateMaybeMessage< ::flwr::proto::PullTaskInsRequest >(Arena* arena) { return Arena::CreateMessageInternal< ::flwr::proto::PullTaskInsRequest >(arena); } diff --git a/src/cc/flwr/include/flwr/proto/fleet.pb.h b/src/cc/flwr/include/flwr/proto/fleet.pb.h index 842e800f5b1..76a001f3a6d 100644 --- a/src/cc/flwr/include/flwr/proto/fleet.pb.h +++ b/src/cc/flwr/include/flwr/proto/fleet.pb.h @@ -52,7 +52,7 @@ struct TableStruct_flwr_2fproto_2ffleet_2eproto { PROTOBUF_SECTION_VARIABLE(protodesc_cold); static const ::PROTOBUF_NAMESPACE_ID::internal::AuxiliaryParseTableField aux[] PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[10] + static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[12] PROTOBUF_SECTION_VARIABLE(protodesc_cold); static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[]; static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[]; @@ -73,6 +73,12 @@ extern DeleteNodeRequestDefaultTypeInternal _DeleteNodeRequest_default_instance_ class DeleteNodeResponse; struct DeleteNodeResponseDefaultTypeInternal; extern DeleteNodeResponseDefaultTypeInternal _DeleteNodeResponse_default_instance_; +class PingRequest; +struct PingRequestDefaultTypeInternal; +extern PingRequestDefaultTypeInternal _PingRequest_default_instance_; +class PingResponse; +struct PingResponseDefaultTypeInternal; +extern PingResponseDefaultTypeInternal _PingResponse_default_instance_; class PullTaskInsRequest; struct PullTaskInsRequestDefaultTypeInternal; extern PullTaskInsRequestDefaultTypeInternal _PullTaskInsRequest_default_instance_; @@ -98,6 +104,8 @@ template<> ::flwr::proto::CreateNodeRequest* Arena::CreateMaybeMessage<::flwr::p template<> ::flwr::proto::CreateNodeResponse* Arena::CreateMaybeMessage<::flwr::proto::CreateNodeResponse>(Arena*); template<> ::flwr::proto::DeleteNodeRequest* Arena::CreateMaybeMessage<::flwr::proto::DeleteNodeRequest>(Arena*); template<> ::flwr::proto::DeleteNodeResponse* Arena::CreateMaybeMessage<::flwr::proto::DeleteNodeResponse>(Arena*); +template<> ::flwr::proto::PingRequest* Arena::CreateMaybeMessage<::flwr::proto::PingRequest>(Arena*); +template<> ::flwr::proto::PingResponse* Arena::CreateMaybeMessage<::flwr::proto::PingResponse>(Arena*); template<> ::flwr::proto::PullTaskInsRequest* Arena::CreateMaybeMessage<::flwr::proto::PullTaskInsRequest>(Arena*); template<> ::flwr::proto::PullTaskInsResponse* Arena::CreateMaybeMessage<::flwr::proto::PullTaskInsResponse>(Arena*); template<> ::flwr::proto::PushTaskResRequest* Arena::CreateMaybeMessage<::flwr::proto::PushTaskResRequest>(Arena*); @@ -644,6 +652,312 @@ class DeleteNodeResponse final : }; // ------------------------------------------------------------------- +class PingRequest final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:flwr.proto.PingRequest) */ { + public: + inline PingRequest() : PingRequest(nullptr) {} + ~PingRequest() override; + explicit constexpr PingRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + PingRequest(const PingRequest& from); + PingRequest(PingRequest&& from) noexcept + : PingRequest() { + *this = ::std::move(from); + } + + inline PingRequest& operator=(const PingRequest& from) { + CopyFrom(from); + return *this; + } + inline PingRequest& operator=(PingRequest&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const PingRequest& default_instance() { + return *internal_default_instance(); + } + static inline const PingRequest* internal_default_instance() { + return reinterpret_cast( + &_PingRequest_default_instance_); + } + static constexpr int kIndexInFileMessages = + 4; + + friend void swap(PingRequest& a, PingRequest& b) { + a.Swap(&b); + } + inline void Swap(PingRequest* other) { + if (other == this) return; + if (GetOwningArena() == other->GetOwningArena()) { + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(PingRequest* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + inline PingRequest* New() const final { + return new PingRequest(); + } + + PingRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const PingRequest& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom(const PingRequest& from); + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(PingRequest* other); + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "flwr.proto.PingRequest"; + } + protected: + explicit PingRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kNodeFieldNumber = 1, + kPingIntervalFieldNumber = 2, + }; + // .flwr.proto.Node node = 1; + bool has_node() const; + private: + bool _internal_has_node() const; + public: + void clear_node(); + const ::flwr::proto::Node& node() const; + PROTOBUF_MUST_USE_RESULT ::flwr::proto::Node* release_node(); + ::flwr::proto::Node* mutable_node(); + void set_allocated_node(::flwr::proto::Node* node); + private: + const ::flwr::proto::Node& _internal_node() const; + ::flwr::proto::Node* _internal_mutable_node(); + public: + void unsafe_arena_set_allocated_node( + ::flwr::proto::Node* node); + ::flwr::proto::Node* unsafe_arena_release_node(); + + // double ping_interval = 2; + void clear_ping_interval(); + double ping_interval() const; + void set_ping_interval(double value); + private: + double _internal_ping_interval() const; + void _internal_set_ping_interval(double value); + public: + + // @@protoc_insertion_point(class_scope:flwr.proto.PingRequest) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::flwr::proto::Node* node_; + double ping_interval_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + friend struct ::TableStruct_flwr_2fproto_2ffleet_2eproto; +}; +// ------------------------------------------------------------------- + +class PingResponse final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:flwr.proto.PingResponse) */ { + public: + inline PingResponse() : PingResponse(nullptr) {} + ~PingResponse() override; + explicit constexpr PingResponse(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + PingResponse(const PingResponse& from); + PingResponse(PingResponse&& from) noexcept + : PingResponse() { + *this = ::std::move(from); + } + + inline PingResponse& operator=(const PingResponse& from) { + CopyFrom(from); + return *this; + } + inline PingResponse& operator=(PingResponse&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const PingResponse& default_instance() { + return *internal_default_instance(); + } + static inline const PingResponse* internal_default_instance() { + return reinterpret_cast( + &_PingResponse_default_instance_); + } + static constexpr int kIndexInFileMessages = + 5; + + friend void swap(PingResponse& a, PingResponse& b) { + a.Swap(&b); + } + inline void Swap(PingResponse* other) { + if (other == this) return; + if (GetOwningArena() == other->GetOwningArena()) { + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(PingResponse* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + inline PingResponse* New() const final { + return new PingResponse(); + } + + PingResponse* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const PingResponse& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom(const PingResponse& from); + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(PingResponse* other); + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "flwr.proto.PingResponse"; + } + protected: + explicit PingResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kSuccessFieldNumber = 1, + }; + // bool success = 1; + void clear_success(); + bool success() const; + void set_success(bool value); + private: + bool _internal_success() const; + void _internal_set_success(bool value); + public: + + // @@protoc_insertion_point(class_scope:flwr.proto.PingResponse) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + bool success_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + friend struct ::TableStruct_flwr_2fproto_2ffleet_2eproto; +}; +// ------------------------------------------------------------------- + class PullTaskInsRequest final : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:flwr.proto.PullTaskInsRequest) */ { public: @@ -692,7 +1006,7 @@ class PullTaskInsRequest final : &_PullTaskInsRequest_default_instance_); } static constexpr int kIndexInFileMessages = - 4; + 6; friend void swap(PullTaskInsRequest& a, PullTaskInsRequest& b) { a.Swap(&b); @@ -870,7 +1184,7 @@ class PullTaskInsResponse final : &_PullTaskInsResponse_default_instance_); } static constexpr int kIndexInFileMessages = - 5; + 7; friend void swap(PullTaskInsResponse& a, PullTaskInsResponse& b) { a.Swap(&b); @@ -1042,7 +1356,7 @@ class PushTaskResRequest final : &_PushTaskResRequest_default_instance_); } static constexpr int kIndexInFileMessages = - 6; + 8; friend void swap(PushTaskResRequest& a, PushTaskResRequest& b) { a.Swap(&b); @@ -1219,7 +1533,7 @@ class PushTaskResResponse final : &_PushTaskResResponse_default_instance_); } static constexpr int kIndexInFileMessages = - 8; + 10; friend void swap(PushTaskResResponse& a, PushTaskResResponse& b) { a.Swap(&b); @@ -1395,7 +1709,7 @@ class Reconnect final : &_Reconnect_default_instance_); } static constexpr int kIndexInFileMessages = - 9; + 11; friend void swap(Reconnect& a, Reconnect& b) { a.Swap(&b); @@ -1685,6 +1999,140 @@ inline void DeleteNodeRequest::set_allocated_node(::flwr::proto::Node* node) { // ------------------------------------------------------------------- +// PingRequest + +// .flwr.proto.Node node = 1; +inline bool PingRequest::_internal_has_node() const { + return this != internal_default_instance() && node_ != nullptr; +} +inline bool PingRequest::has_node() const { + return _internal_has_node(); +} +inline const ::flwr::proto::Node& PingRequest::_internal_node() const { + const ::flwr::proto::Node* p = node_; + return p != nullptr ? *p : reinterpret_cast( + ::flwr::proto::_Node_default_instance_); +} +inline const ::flwr::proto::Node& PingRequest::node() const { + // @@protoc_insertion_point(field_get:flwr.proto.PingRequest.node) + return _internal_node(); +} +inline void PingRequest::unsafe_arena_set_allocated_node( + ::flwr::proto::Node* node) { + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(node_); + } + node_ = node; + if (node) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:flwr.proto.PingRequest.node) +} +inline ::flwr::proto::Node* PingRequest::release_node() { + + ::flwr::proto::Node* temp = node_; + node_ = nullptr; +#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE + auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + if (GetArenaForAllocation() == nullptr) { delete old; } +#else // PROTOBUF_FORCE_COPY_IN_RELEASE + if (GetArenaForAllocation() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } +#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE + return temp; +} +inline ::flwr::proto::Node* PingRequest::unsafe_arena_release_node() { + // @@protoc_insertion_point(field_release:flwr.proto.PingRequest.node) + + ::flwr::proto::Node* temp = node_; + node_ = nullptr; + return temp; +} +inline ::flwr::proto::Node* PingRequest::_internal_mutable_node() { + + if (node_ == nullptr) { + auto* p = CreateMaybeMessage<::flwr::proto::Node>(GetArenaForAllocation()); + node_ = p; + } + return node_; +} +inline ::flwr::proto::Node* PingRequest::mutable_node() { + ::flwr::proto::Node* _msg = _internal_mutable_node(); + // @@protoc_insertion_point(field_mutable:flwr.proto.PingRequest.node) + return _msg; +} +inline void PingRequest::set_allocated_node(::flwr::proto::Node* node) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + if (message_arena == nullptr) { + delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(node_); + } + if (node) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper< + ::PROTOBUF_NAMESPACE_ID::MessageLite>::GetOwningArena( + reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(node)); + if (message_arena != submessage_arena) { + node = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, node, submessage_arena); + } + + } else { + + } + node_ = node; + // @@protoc_insertion_point(field_set_allocated:flwr.proto.PingRequest.node) +} + +// double ping_interval = 2; +inline void PingRequest::clear_ping_interval() { + ping_interval_ = 0; +} +inline double PingRequest::_internal_ping_interval() const { + return ping_interval_; +} +inline double PingRequest::ping_interval() const { + // @@protoc_insertion_point(field_get:flwr.proto.PingRequest.ping_interval) + return _internal_ping_interval(); +} +inline void PingRequest::_internal_set_ping_interval(double value) { + + ping_interval_ = value; +} +inline void PingRequest::set_ping_interval(double value) { + _internal_set_ping_interval(value); + // @@protoc_insertion_point(field_set:flwr.proto.PingRequest.ping_interval) +} + +// ------------------------------------------------------------------- + +// PingResponse + +// bool success = 1; +inline void PingResponse::clear_success() { + success_ = false; +} +inline bool PingResponse::_internal_success() const { + return success_; +} +inline bool PingResponse::success() const { + // @@protoc_insertion_point(field_get:flwr.proto.PingResponse.success) + return _internal_success(); +} +inline void PingResponse::_internal_set_success(bool value) { + + success_ = value; +} +inline void PingResponse::set_success(bool value) { + _internal_set_success(value); + // @@protoc_insertion_point(field_set:flwr.proto.PingResponse.success) +} + +// ------------------------------------------------------------------- + // PullTaskInsRequest // .flwr.proto.Node node = 1; @@ -2190,6 +2638,10 @@ inline void Reconnect::set_reconnect(::PROTOBUF_NAMESPACE_ID::uint64 value) { // ------------------------------------------------------------------- +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + // @@protoc_insertion_point(namespace_scope) diff --git a/src/cc/flwr/include/flwr/proto/task.pb.cc b/src/cc/flwr/include/flwr/proto/task.pb.cc index a0783848df2..04fa3e8e262 100644 --- a/src/cc/flwr/include/flwr/proto/task.pb.cc +++ b/src/cc/flwr/include/flwr/proto/task.pb.cc @@ -21,14 +21,15 @@ namespace proto { constexpr Task::Task( ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) : ancestry_() - , created_at_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) , delivered_at_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) - , ttl_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) , task_type_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) , producer_(nullptr) , consumer_(nullptr) , recordset_(nullptr) - , error_(nullptr){} + , error_(nullptr) + , created_at_(0) + , pushed_at_(0) + , ttl_(0){} struct TaskDefaultTypeInternal { constexpr TaskDefaultTypeInternal() : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} @@ -85,6 +86,7 @@ const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_flwr_2fproto_2ftask_2eproto::o PROTOBUF_FIELD_OFFSET(::flwr::proto::Task, consumer_), PROTOBUF_FIELD_OFFSET(::flwr::proto::Task, created_at_), PROTOBUF_FIELD_OFFSET(::flwr::proto::Task, delivered_at_), + PROTOBUF_FIELD_OFFSET(::flwr::proto::Task, pushed_at_), PROTOBUF_FIELD_OFFSET(::flwr::proto::Task, ttl_), PROTOBUF_FIELD_OFFSET(::flwr::proto::Task, ancestry_), PROTOBUF_FIELD_OFFSET(::flwr::proto::Task, task_type_), @@ -113,8 +115,8 @@ const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_flwr_2fproto_2ftask_2eproto::o }; static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { { 0, -1, -1, sizeof(::flwr::proto::Task)}, - { 15, -1, -1, sizeof(::flwr::proto::TaskIns)}, - { 25, -1, -1, sizeof(::flwr::proto::TaskRes)}, + { 16, -1, -1, sizeof(::flwr::proto::TaskIns)}, + { 26, -1, -1, sizeof(::flwr::proto::TaskRes)}, }; static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = { @@ -127,18 +129,19 @@ const char descriptor_table_protodef_flwr_2fproto_2ftask_2eproto[] PROTOBUF_SECT "\n\025flwr/proto/task.proto\022\nflwr.proto\032\025flw" "r/proto/node.proto\032\032flwr/proto/recordset" ".proto\032\032flwr/proto/transport.proto\032\026flwr" - "/proto/error.proto\"\366\001\n\004Task\022\"\n\010producer\030" + "/proto/error.proto\"\211\002\n\004Task\022\"\n\010producer\030" "\001 \001(\0132\020.flwr.proto.Node\022\"\n\010consumer\030\002 \001(" - "\0132\020.flwr.proto.Node\022\022\n\ncreated_at\030\003 \001(\t\022" - "\024\n\014delivered_at\030\004 \001(\t\022\013\n\003ttl\030\005 \001(\t\022\020\n\010an" - "cestry\030\006 \003(\t\022\021\n\ttask_type\030\007 \001(\t\022(\n\trecor" - "dset\030\010 \001(\0132\025.flwr.proto.RecordSet\022 \n\005err" - "or\030\t \001(\0132\021.flwr.proto.Error\"\\\n\007TaskIns\022\017" - "\n\007task_id\030\001 \001(\t\022\020\n\010group_id\030\002 \001(\t\022\016\n\006run" - "_id\030\003 \001(\022\022\036\n\004task\030\004 \001(\0132\020.flwr.proto.Tas" - "k\"\\\n\007TaskRes\022\017\n\007task_id\030\001 \001(\t\022\020\n\010group_i" - "d\030\002 \001(\t\022\016\n\006run_id\030\003 \001(\022\022\036\n\004task\030\004 \001(\0132\020." - "flwr.proto.Taskb\006proto3" + "\0132\020.flwr.proto.Node\022\022\n\ncreated_at\030\003 \001(\001\022" + "\024\n\014delivered_at\030\004 \001(\t\022\021\n\tpushed_at\030\005 \001(\001" + "\022\013\n\003ttl\030\006 \001(\001\022\020\n\010ancestry\030\007 \003(\t\022\021\n\ttask_" + "type\030\010 \001(\t\022(\n\trecordset\030\t \001(\0132\025.flwr.pro" + "to.RecordSet\022 \n\005error\030\n \001(\0132\021.flwr.proto" + ".Error\"\\\n\007TaskIns\022\017\n\007task_id\030\001 \001(\t\022\020\n\010gr" + "oup_id\030\002 \001(\t\022\016\n\006run_id\030\003 \001(\022\022\036\n\004task\030\004 \001" + "(\0132\020.flwr.proto.Task\"\\\n\007TaskRes\022\017\n\007task_" + "id\030\001 \001(\t\022\020\n\010group_id\030\002 \001(\t\022\016\n\006run_id\030\003 \001" + "(\022\022\036\n\004task\030\004 \001(\0132\020.flwr.proto.Taskb\006prot" + "o3" ; static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_flwr_2fproto_2ftask_2eproto_deps[4] = { &::descriptor_table_flwr_2fproto_2ferror_2eproto, @@ -148,7 +151,7 @@ static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor }; static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_flwr_2fproto_2ftask_2eproto_once; const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_flwr_2fproto_2ftask_2eproto = { - false, false, 583, descriptor_table_protodef_flwr_2fproto_2ftask_2eproto, "flwr/proto/task.proto", + false, false, 602, descriptor_table_protodef_flwr_2fproto_2ftask_2eproto, "flwr/proto/task.proto", &descriptor_table_flwr_2fproto_2ftask_2eproto_once, descriptor_table_flwr_2fproto_2ftask_2eproto_deps, 4, 3, schemas, file_default_instances, TableStruct_flwr_2fproto_2ftask_2eproto::offsets, file_level_metadata_flwr_2fproto_2ftask_2eproto, file_level_enum_descriptors_flwr_2fproto_2ftask_2eproto, file_level_service_descriptors_flwr_2fproto_2ftask_2eproto, @@ -226,21 +229,11 @@ Task::Task(const Task& from) : ::PROTOBUF_NAMESPACE_ID::Message(), ancestry_(from.ancestry_) { _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - created_at_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (!from._internal_created_at().empty()) { - created_at_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_created_at(), - GetArenaForAllocation()); - } delivered_at_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); if (!from._internal_delivered_at().empty()) { delivered_at_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_delivered_at(), GetArenaForAllocation()); } - ttl_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (!from._internal_ttl().empty()) { - ttl_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_ttl(), - GetArenaForAllocation()); - } task_type_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); if (!from._internal_task_type().empty()) { task_type_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_task_type(), @@ -266,18 +259,19 @@ Task::Task(const Task& from) } else { error_ = nullptr; } + ::memcpy(&created_at_, &from.created_at_, + static_cast(reinterpret_cast(&ttl_) - + reinterpret_cast(&created_at_)) + sizeof(ttl_)); // @@protoc_insertion_point(copy_constructor:flwr.proto.Task) } void Task::SharedCtor() { -created_at_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); delivered_at_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -ttl_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); task_type_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); ::memset(reinterpret_cast(this) + static_cast( reinterpret_cast(&producer_) - reinterpret_cast(this)), - 0, static_cast(reinterpret_cast(&error_) - - reinterpret_cast(&producer_)) + sizeof(error_)); + 0, static_cast(reinterpret_cast(&ttl_) - + reinterpret_cast(&producer_)) + sizeof(ttl_)); } Task::~Task() { @@ -289,9 +283,7 @@ Task::~Task() { inline void Task::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - created_at_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); delivered_at_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - ttl_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); task_type_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); if (this != internal_default_instance()) delete producer_; if (this != internal_default_instance()) delete consumer_; @@ -316,9 +308,7 @@ void Task::Clear() { (void) cached_has_bits; ancestry_.Clear(); - created_at_.ClearToEmpty(); delivered_at_.ClearToEmpty(); - ttl_.ClearToEmpty(); task_type_.ClearToEmpty(); if (GetArenaForAllocation() == nullptr && producer_ != nullptr) { delete producer_; @@ -336,6 +326,9 @@ void Task::Clear() { delete error_; } error_ = nullptr; + ::memset(&created_at_, 0, static_cast( + reinterpret_cast(&ttl_) - + reinterpret_cast(&created_at_)) + sizeof(ttl_)); _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } @@ -361,13 +354,11 @@ const char* Task::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::inter } else goto handle_unusual; continue; - // string created_at = 3; + // double created_at = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { - auto str = _internal_mutable_created_at(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "flwr.proto.Task.created_at")); - CHK_(ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 25)) { + created_at_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr); + ptr += sizeof(double); } else goto handle_unusual; continue; @@ -381,19 +372,25 @@ const char* Task::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::inter } else goto handle_unusual; continue; - // string ttl = 5; + // double pushed_at = 5; case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) { - auto str = _internal_mutable_ttl(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "flwr.proto.Task.ttl")); - CHK_(ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 41)) { + pushed_at_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr); + ptr += sizeof(double); } else goto handle_unusual; continue; - // repeated string ancestry = 6; + // double ttl = 6; case 6: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 50)) { + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 49)) { + ttl_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr); + ptr += sizeof(double); + } else + goto handle_unusual; + continue; + // repeated string ancestry = 7; + case 7: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 58)) { ptr -= 1; do { ptr += 1; @@ -402,13 +399,13 @@ const char* Task::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::inter CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "flwr.proto.Task.ancestry")); CHK_(ptr); if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<50>(ptr)); + } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<58>(ptr)); } else goto handle_unusual; continue; - // string task_type = 7; - case 7: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 58)) { + // string task_type = 8; + case 8: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 66)) { auto str = _internal_mutable_task_type(); ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "flwr.proto.Task.task_type")); @@ -416,17 +413,17 @@ const char* Task::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::inter } else goto handle_unusual; continue; - // .flwr.proto.RecordSet recordset = 8; - case 8: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 66)) { + // .flwr.proto.RecordSet recordset = 9; + case 9: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 74)) { ptr = ctx->ParseMessage(_internal_mutable_recordset(), ptr); CHK_(ptr); } else goto handle_unusual; continue; - // .flwr.proto.Error error = 9; - case 9: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 74)) { + // .flwr.proto.Error error = 10; + case 10: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 82)) { ptr = ctx->ParseMessage(_internal_mutable_error(), ptr); CHK_(ptr); } else @@ -477,14 +474,10 @@ ::PROTOBUF_NAMESPACE_ID::uint8* Task::_InternalSerialize( 2, _Internal::consumer(this), target, stream); } - // string created_at = 3; - if (!this->_internal_created_at().empty()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->_internal_created_at().data(), static_cast(this->_internal_created_at().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "flwr.proto.Task.created_at"); - target = stream->WriteStringMaybeAliased( - 3, this->_internal_created_at(), target); + // double created_at = 3; + if (!(this->_internal_created_at() <= 0 && this->_internal_created_at() >= 0)) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteDoubleToArray(3, this->_internal_created_at(), target); } // string delivered_at = 4; @@ -497,50 +490,52 @@ ::PROTOBUF_NAMESPACE_ID::uint8* Task::_InternalSerialize( 4, this->_internal_delivered_at(), target); } - // string ttl = 5; - if (!this->_internal_ttl().empty()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->_internal_ttl().data(), static_cast(this->_internal_ttl().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "flwr.proto.Task.ttl"); - target = stream->WriteStringMaybeAliased( - 5, this->_internal_ttl(), target); + // double pushed_at = 5; + if (!(this->_internal_pushed_at() <= 0 && this->_internal_pushed_at() >= 0)) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteDoubleToArray(5, this->_internal_pushed_at(), target); } - // repeated string ancestry = 6; + // double ttl = 6; + if (!(this->_internal_ttl() <= 0 && this->_internal_ttl() >= 0)) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteDoubleToArray(6, this->_internal_ttl(), target); + } + + // repeated string ancestry = 7; for (int i = 0, n = this->_internal_ancestry_size(); i < n; i++) { const auto& s = this->_internal_ancestry(i); ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( s.data(), static_cast(s.length()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, "flwr.proto.Task.ancestry"); - target = stream->WriteString(6, s, target); + target = stream->WriteString(7, s, target); } - // string task_type = 7; + // string task_type = 8; if (!this->_internal_task_type().empty()) { ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( this->_internal_task_type().data(), static_cast(this->_internal_task_type().length()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, "flwr.proto.Task.task_type"); target = stream->WriteStringMaybeAliased( - 7, this->_internal_task_type(), target); + 8, this->_internal_task_type(), target); } - // .flwr.proto.RecordSet recordset = 8; + // .flwr.proto.RecordSet recordset = 9; if (this->_internal_has_recordset()) { target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: InternalWriteMessage( - 8, _Internal::recordset(this), target, stream); + 9, _Internal::recordset(this), target, stream); } - // .flwr.proto.Error error = 9; + // .flwr.proto.Error error = 10; if (this->_internal_has_error()) { target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: InternalWriteMessage( - 9, _Internal::error(this), target, stream); + 10, _Internal::error(this), target, stream); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { @@ -559,7 +554,7 @@ size_t Task::ByteSizeLong() const { // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - // repeated string ancestry = 6; + // repeated string ancestry = 7; total_size += 1 * ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(ancestry_.size()); for (int i = 0, n = ancestry_.size(); i < n; i++) { @@ -567,13 +562,6 @@ size_t Task::ByteSizeLong() const { ancestry_.Get(i)); } - // string created_at = 3; - if (!this->_internal_created_at().empty()) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_created_at()); - } - // string delivered_at = 4; if (!this->_internal_delivered_at().empty()) { total_size += 1 + @@ -581,14 +569,7 @@ size_t Task::ByteSizeLong() const { this->_internal_delivered_at()); } - // string ttl = 5; - if (!this->_internal_ttl().empty()) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_ttl()); - } - - // string task_type = 7; + // string task_type = 8; if (!this->_internal_task_type().empty()) { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( @@ -609,20 +590,35 @@ size_t Task::ByteSizeLong() const { *consumer_); } - // .flwr.proto.RecordSet recordset = 8; + // .flwr.proto.RecordSet recordset = 9; if (this->_internal_has_recordset()) { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( *recordset_); } - // .flwr.proto.Error error = 9; + // .flwr.proto.Error error = 10; if (this->_internal_has_error()) { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( *error_); } + // double created_at = 3; + if (!(this->_internal_created_at() <= 0 && this->_internal_created_at() >= 0)) { + total_size += 1 + 8; + } + + // double pushed_at = 5; + if (!(this->_internal_pushed_at() <= 0 && this->_internal_pushed_at() >= 0)) { + total_size += 1 + 8; + } + + // double ttl = 6; + if (!(this->_internal_ttl() <= 0 && this->_internal_ttl() >= 0)) { + total_size += 1 + 8; + } + return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_); } @@ -646,15 +642,9 @@ void Task::MergeFrom(const Task& from) { (void) cached_has_bits; ancestry_.MergeFrom(from.ancestry_); - if (!from._internal_created_at().empty()) { - _internal_set_created_at(from._internal_created_at()); - } if (!from._internal_delivered_at().empty()) { _internal_set_delivered_at(from._internal_delivered_at()); } - if (!from._internal_ttl().empty()) { - _internal_set_ttl(from._internal_ttl()); - } if (!from._internal_task_type().empty()) { _internal_set_task_type(from._internal_task_type()); } @@ -670,6 +660,15 @@ void Task::MergeFrom(const Task& from) { if (from._internal_has_error()) { _internal_mutable_error()->::flwr::proto::Error::MergeFrom(from._internal_error()); } + if (!(from._internal_created_at() <= 0 && from._internal_created_at() >= 0)) { + _internal_set_created_at(from._internal_created_at()); + } + if (!(from._internal_pushed_at() <= 0 && from._internal_pushed_at() >= 0)) { + _internal_set_pushed_at(from._internal_pushed_at()); + } + if (!(from._internal_ttl() <= 0 && from._internal_ttl() >= 0)) { + _internal_set_ttl(from._internal_ttl()); + } _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); } @@ -690,29 +689,19 @@ void Task::InternalSwap(Task* other) { auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); ancestry_.InternalSwap(&other->ancestry_); - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - &created_at_, lhs_arena, - &other->created_at_, rhs_arena - ); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &delivered_at_, lhs_arena, &other->delivered_at_, rhs_arena ); - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - &ttl_, lhs_arena, - &other->ttl_, rhs_arena - ); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &task_type_, lhs_arena, &other->task_type_, rhs_arena ); ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(Task, error_) - + sizeof(Task::error_) + PROTOBUF_FIELD_OFFSET(Task, ttl_) + + sizeof(Task::ttl_) - PROTOBUF_FIELD_OFFSET(Task, producer_)>( reinterpret_cast(&producer_), reinterpret_cast(&other->producer_)); diff --git a/src/cc/flwr/include/flwr/proto/task.pb.h b/src/cc/flwr/include/flwr/proto/task.pb.h index 40f829618c8..3dc421e2f8a 100644 --- a/src/cc/flwr/include/flwr/proto/task.pb.h +++ b/src/cc/flwr/include/flwr/proto/task.pb.h @@ -199,17 +199,18 @@ class Task final : // accessors ------------------------------------------------------- enum : int { - kAncestryFieldNumber = 6, - kCreatedAtFieldNumber = 3, + kAncestryFieldNumber = 7, kDeliveredAtFieldNumber = 4, - kTtlFieldNumber = 5, - kTaskTypeFieldNumber = 7, + kTaskTypeFieldNumber = 8, kProducerFieldNumber = 1, kConsumerFieldNumber = 2, - kRecordsetFieldNumber = 8, - kErrorFieldNumber = 9, + kRecordsetFieldNumber = 9, + kErrorFieldNumber = 10, + kCreatedAtFieldNumber = 3, + kPushedAtFieldNumber = 5, + kTtlFieldNumber = 6, }; - // repeated string ancestry = 6; + // repeated string ancestry = 7; int ancestry_size() const; private: int _internal_ancestry_size() const; @@ -233,20 +234,6 @@ class Task final : std::string* _internal_add_ancestry(); public: - // string created_at = 3; - void clear_created_at(); - const std::string& created_at() const; - template - void set_created_at(ArgT0&& arg0, ArgT... args); - std::string* mutable_created_at(); - PROTOBUF_MUST_USE_RESULT std::string* release_created_at(); - void set_allocated_created_at(std::string* created_at); - private: - const std::string& _internal_created_at() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_created_at(const std::string& value); - std::string* _internal_mutable_created_at(); - public: - // string delivered_at = 4; void clear_delivered_at(); const std::string& delivered_at() const; @@ -261,21 +248,7 @@ class Task final : std::string* _internal_mutable_delivered_at(); public: - // string ttl = 5; - void clear_ttl(); - const std::string& ttl() const; - template - void set_ttl(ArgT0&& arg0, ArgT... args); - std::string* mutable_ttl(); - PROTOBUF_MUST_USE_RESULT std::string* release_ttl(); - void set_allocated_ttl(std::string* ttl); - private: - const std::string& _internal_ttl() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_ttl(const std::string& value); - std::string* _internal_mutable_ttl(); - public: - - // string task_type = 7; + // string task_type = 8; void clear_task_type(); const std::string& task_type() const; template @@ -325,7 +298,7 @@ class Task final : ::flwr::proto::Node* consumer); ::flwr::proto::Node* unsafe_arena_release_consumer(); - // .flwr.proto.RecordSet recordset = 8; + // .flwr.proto.RecordSet recordset = 9; bool has_recordset() const; private: bool _internal_has_recordset() const; @@ -343,7 +316,7 @@ class Task final : ::flwr::proto::RecordSet* recordset); ::flwr::proto::RecordSet* unsafe_arena_release_recordset(); - // .flwr.proto.Error error = 9; + // .flwr.proto.Error error = 10; bool has_error() const; private: bool _internal_has_error() const; @@ -361,6 +334,33 @@ class Task final : ::flwr::proto::Error* error); ::flwr::proto::Error* unsafe_arena_release_error(); + // double created_at = 3; + void clear_created_at(); + double created_at() const; + void set_created_at(double value); + private: + double _internal_created_at() const; + void _internal_set_created_at(double value); + public: + + // double pushed_at = 5; + void clear_pushed_at(); + double pushed_at() const; + void set_pushed_at(double value); + private: + double _internal_pushed_at() const; + void _internal_set_pushed_at(double value); + public: + + // double ttl = 6; + void clear_ttl(); + double ttl() const; + void set_ttl(double value); + private: + double _internal_ttl() const; + void _internal_set_ttl(double value); + public: + // @@protoc_insertion_point(class_scope:flwr.proto.Task) private: class _Internal; @@ -369,14 +369,15 @@ class Task final : typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField ancestry_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr created_at_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr delivered_at_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr ttl_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr task_type_; ::flwr::proto::Node* producer_; ::flwr::proto::Node* consumer_; ::flwr::proto::RecordSet* recordset_; ::flwr::proto::Error* error_; + double created_at_; + double pushed_at_; + double ttl_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; friend struct ::TableStruct_flwr_2fproto_2ftask_2eproto; }; @@ -953,50 +954,24 @@ inline void Task::set_allocated_consumer(::flwr::proto::Node* consumer) { // @@protoc_insertion_point(field_set_allocated:flwr.proto.Task.consumer) } -// string created_at = 3; +// double created_at = 3; inline void Task::clear_created_at() { - created_at_.ClearToEmpty(); + created_at_ = 0; +} +inline double Task::_internal_created_at() const { + return created_at_; } -inline const std::string& Task::created_at() const { +inline double Task::created_at() const { // @@protoc_insertion_point(field_get:flwr.proto.Task.created_at) return _internal_created_at(); } -template -inline PROTOBUF_ALWAYS_INLINE -void Task::set_created_at(ArgT0&& arg0, ArgT... args) { - - created_at_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:flwr.proto.Task.created_at) -} -inline std::string* Task::mutable_created_at() { - std::string* _s = _internal_mutable_created_at(); - // @@protoc_insertion_point(field_mutable:flwr.proto.Task.created_at) - return _s; -} -inline const std::string& Task::_internal_created_at() const { - return created_at_.Get(); -} -inline void Task::_internal_set_created_at(const std::string& value) { +inline void Task::_internal_set_created_at(double value) { - created_at_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + created_at_ = value; } -inline std::string* Task::_internal_mutable_created_at() { - - return created_at_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); -} -inline std::string* Task::release_created_at() { - // @@protoc_insertion_point(field_release:flwr.proto.Task.created_at) - return created_at_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); -} -inline void Task::set_allocated_created_at(std::string* created_at) { - if (created_at != nullptr) { - - } else { - - } - created_at_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), created_at, - GetArenaForAllocation()); - // @@protoc_insertion_point(field_set_allocated:flwr.proto.Task.created_at) +inline void Task::set_created_at(double value) { + _internal_set_created_at(value); + // @@protoc_insertion_point(field_set:flwr.proto.Task.created_at) } // string delivered_at = 4; @@ -1045,53 +1020,47 @@ inline void Task::set_allocated_delivered_at(std::string* delivered_at) { // @@protoc_insertion_point(field_set_allocated:flwr.proto.Task.delivered_at) } -// string ttl = 5; -inline void Task::clear_ttl() { - ttl_.ClearToEmpty(); +// double pushed_at = 5; +inline void Task::clear_pushed_at() { + pushed_at_ = 0; } -inline const std::string& Task::ttl() const { - // @@protoc_insertion_point(field_get:flwr.proto.Task.ttl) - return _internal_ttl(); +inline double Task::_internal_pushed_at() const { + return pushed_at_; } -template -inline PROTOBUF_ALWAYS_INLINE -void Task::set_ttl(ArgT0&& arg0, ArgT... args) { - - ttl_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:flwr.proto.Task.ttl) +inline double Task::pushed_at() const { + // @@protoc_insertion_point(field_get:flwr.proto.Task.pushed_at) + return _internal_pushed_at(); } -inline std::string* Task::mutable_ttl() { - std::string* _s = _internal_mutable_ttl(); - // @@protoc_insertion_point(field_mutable:flwr.proto.Task.ttl) - return _s; +inline void Task::_internal_set_pushed_at(double value) { + + pushed_at_ = value; } -inline const std::string& Task::_internal_ttl() const { - return ttl_.Get(); +inline void Task::set_pushed_at(double value) { + _internal_set_pushed_at(value); + // @@protoc_insertion_point(field_set:flwr.proto.Task.pushed_at) } -inline void Task::_internal_set_ttl(const std::string& value) { - - ttl_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + +// double ttl = 6; +inline void Task::clear_ttl() { + ttl_ = 0; } -inline std::string* Task::_internal_mutable_ttl() { - - return ttl_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); +inline double Task::_internal_ttl() const { + return ttl_; +} +inline double Task::ttl() const { + // @@protoc_insertion_point(field_get:flwr.proto.Task.ttl) + return _internal_ttl(); } -inline std::string* Task::release_ttl() { - // @@protoc_insertion_point(field_release:flwr.proto.Task.ttl) - return ttl_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); +inline void Task::_internal_set_ttl(double value) { + + ttl_ = value; } -inline void Task::set_allocated_ttl(std::string* ttl) { - if (ttl != nullptr) { - - } else { - - } - ttl_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ttl, - GetArenaForAllocation()); - // @@protoc_insertion_point(field_set_allocated:flwr.proto.Task.ttl) +inline void Task::set_ttl(double value) { + _internal_set_ttl(value); + // @@protoc_insertion_point(field_set:flwr.proto.Task.ttl) } -// repeated string ancestry = 6; +// repeated string ancestry = 7; inline int Task::_internal_ancestry_size() const { return ancestry_.size(); } @@ -1166,7 +1135,7 @@ Task::mutable_ancestry() { return &ancestry_; } -// string task_type = 7; +// string task_type = 8; inline void Task::clear_task_type() { task_type_.ClearToEmpty(); } @@ -1212,7 +1181,7 @@ inline void Task::set_allocated_task_type(std::string* task_type) { // @@protoc_insertion_point(field_set_allocated:flwr.proto.Task.task_type) } -// .flwr.proto.RecordSet recordset = 8; +// .flwr.proto.RecordSet recordset = 9; inline bool Task::_internal_has_recordset() const { return this != internal_default_instance() && recordset_ != nullptr; } @@ -1298,7 +1267,7 @@ inline void Task::set_allocated_recordset(::flwr::proto::RecordSet* recordset) { // @@protoc_insertion_point(field_set_allocated:flwr.proto.Task.recordset) } -// .flwr.proto.Error error = 9; +// .flwr.proto.Error error = 10; inline bool Task::_internal_has_error() const { return this != internal_default_instance() && error_ != nullptr; } diff --git a/src/cc/flwr/src/message_handler.cc b/src/cc/flwr/src/message_handler.cc index f7b9f791217..e1ce56f2cd9 100644 --- a/src/cc/flwr/src/message_handler.cc +++ b/src/cc/flwr/src/message_handler.cc @@ -86,8 +86,10 @@ handle_task(flwr_local::Client *client, const flwr::proto::TaskIns &task_ins) { task->set_allocated_recordset(proto_recordset_ptr.release()); task->set_task_type(received_task.task_type()); - task->set_ttl(""); - task->set_created_at(""); + task->set_ttl(3600); + task->set_created_at(std::chrono::duration_cast( + std::chrono::system_clock::now().time_since_epoch()) + .count()); task->set_allocated_consumer( std::make_unique(received_task.producer()).release()); task->set_allocated_producer(