feat: kill process rpc service (#244)

* feat/kill-process:
 ### Add KillProcess RPC Method

 - **Added `KillProcess` RPC Method**: Introduced a new RPC method `KillProcess` in the `Frontend` service to allow killing a running process on the frontend.
   - Updated files: `server.grpc.pb.cc`, `server.grpc.pb.h`, `server.pb.cc`, `server.pb.h`, `server.proto`
   - Added new request and response messages: `KillProcessRequest` and `KillProcessResponse`.

 - **Java Bindings**: Updated Java bindings to include the new `KillProcess` method.
   - Updated file: `Server.java`

* feat/kill-process:
 **Update `server.proto` for KillProcessRequest and KillProcessResponse**

 - Added `server_addr` field to `KillProcessRequest` for specifying the frontend server address.
 - Changed field numbers for `catalog` and `process_id` in `KillProcessRequest`.
 - Enhanced `KillProcessResponse` to include a `found` boolean indicating if the target process was located.

Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>

* rename found to success

---------

Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>
This commit is contained in:
Lei, HUANG
2025-06-13 20:53:07 +08:00
committed by GitHub
parent 5f6119ac79
commit f0913f179e
6 changed files with 2673 additions and 27 deletions
@@ -25,6 +25,7 @@ namespace frontend {
static const char* Frontend_method_names[] = { static const char* Frontend_method_names[] = {
"/greptime.v1.frontend.Frontend/ListProcess", "/greptime.v1.frontend.Frontend/ListProcess",
"/greptime.v1.frontend.Frontend/KillProcess",
}; };
std::unique_ptr< Frontend::Stub> Frontend::NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options) { std::unique_ptr< Frontend::Stub> Frontend::NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options) {
@@ -35,6 +36,7 @@ std::unique_ptr< Frontend::Stub> Frontend::NewStub(const std::shared_ptr< ::grpc
Frontend::Stub::Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options) Frontend::Stub::Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options)
: channel_(channel), rpcmethod_ListProcess_(Frontend_method_names[0], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) : channel_(channel), rpcmethod_ListProcess_(Frontend_method_names[0], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel)
, rpcmethod_KillProcess_(Frontend_method_names[1], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel)
{} {}
::grpc::Status Frontend::Stub::ListProcess(::grpc::ClientContext* context, const ::greptime::v1::frontend::ListProcessRequest& request, ::greptime::v1::frontend::ListProcessResponse* response) { ::grpc::Status Frontend::Stub::ListProcess(::grpc::ClientContext* context, const ::greptime::v1::frontend::ListProcessRequest& request, ::greptime::v1::frontend::ListProcessResponse* response) {
@@ -60,6 +62,29 @@ void Frontend::Stub::async::ListProcess(::grpc::ClientContext* context, const ::
return result; return result;
} }
::grpc::Status Frontend::Stub::KillProcess(::grpc::ClientContext* context, const ::greptime::v1::frontend::KillProcessRequest& request, ::greptime::v1::frontend::KillProcessResponse* response) {
return ::grpc::internal::BlockingUnaryCall< ::greptime::v1::frontend::KillProcessRequest, ::greptime::v1::frontend::KillProcessResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_KillProcess_, context, request, response);
}
void Frontend::Stub::async::KillProcess(::grpc::ClientContext* context, const ::greptime::v1::frontend::KillProcessRequest* request, ::greptime::v1::frontend::KillProcessResponse* response, std::function<void(::grpc::Status)> f) {
::grpc::internal::CallbackUnaryCall< ::greptime::v1::frontend::KillProcessRequest, ::greptime::v1::frontend::KillProcessResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_KillProcess_, context, request, response, std::move(f));
}
void Frontend::Stub::async::KillProcess(::grpc::ClientContext* context, const ::greptime::v1::frontend::KillProcessRequest* request, ::greptime::v1::frontend::KillProcessResponse* response, ::grpc::ClientUnaryReactor* reactor) {
::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_KillProcess_, context, request, response, reactor);
}
::grpc::ClientAsyncResponseReader< ::greptime::v1::frontend::KillProcessResponse>* Frontend::Stub::PrepareAsyncKillProcessRaw(::grpc::ClientContext* context, const ::greptime::v1::frontend::KillProcessRequest& request, ::grpc::CompletionQueue* cq) {
return ::grpc::internal::ClientAsyncResponseReaderHelper::Create< ::greptime::v1::frontend::KillProcessResponse, ::greptime::v1::frontend::KillProcessRequest, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), cq, rpcmethod_KillProcess_, context, request);
}
::grpc::ClientAsyncResponseReader< ::greptime::v1::frontend::KillProcessResponse>* Frontend::Stub::AsyncKillProcessRaw(::grpc::ClientContext* context, const ::greptime::v1::frontend::KillProcessRequest& request, ::grpc::CompletionQueue* cq) {
auto* result =
this->PrepareAsyncKillProcessRaw(context, request, cq);
result->StartCall();
return result;
}
Frontend::Service::Service() { Frontend::Service::Service() {
AddMethod(new ::grpc::internal::RpcServiceMethod( AddMethod(new ::grpc::internal::RpcServiceMethod(
Frontend_method_names[0], Frontend_method_names[0],
@@ -71,6 +96,16 @@ Frontend::Service::Service() {
::greptime::v1::frontend::ListProcessResponse* resp) { ::greptime::v1::frontend::ListProcessResponse* resp) {
return service->ListProcess(ctx, req, resp); return service->ListProcess(ctx, req, resp);
}, this))); }, this)));
AddMethod(new ::grpc::internal::RpcServiceMethod(
Frontend_method_names[1],
::grpc::internal::RpcMethod::NORMAL_RPC,
new ::grpc::internal::RpcMethodHandler< Frontend::Service, ::greptime::v1::frontend::KillProcessRequest, ::greptime::v1::frontend::KillProcessResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(
[](Frontend::Service* service,
::grpc::ServerContext* ctx,
const ::greptime::v1::frontend::KillProcessRequest* req,
::greptime::v1::frontend::KillProcessResponse* resp) {
return service->KillProcess(ctx, req, resp);
}, this)));
} }
Frontend::Service::~Service() { Frontend::Service::~Service() {
@@ -83,6 +118,13 @@ Frontend::Service::~Service() {
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
} }
::grpc::Status Frontend::Service::KillProcess(::grpc::ServerContext* context, const ::greptime::v1::frontend::KillProcessRequest* request, ::greptime::v1::frontend::KillProcessResponse* response) {
(void) context;
(void) request;
(void) response;
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
}
} // namespace greptime } // namespace greptime
} // namespace v1 } // namespace v1
+164 -4
View File
@@ -60,12 +60,23 @@ class Frontend final {
std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::greptime::v1::frontend::ListProcessResponse>> PrepareAsyncListProcess(::grpc::ClientContext* context, const ::greptime::v1::frontend::ListProcessRequest& request, ::grpc::CompletionQueue* cq) { std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::greptime::v1::frontend::ListProcessResponse>> PrepareAsyncListProcess(::grpc::ClientContext* context, const ::greptime::v1::frontend::ListProcessRequest& request, ::grpc::CompletionQueue* cq) {
return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::greptime::v1::frontend::ListProcessResponse>>(PrepareAsyncListProcessRaw(context, request, cq)); return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::greptime::v1::frontend::ListProcessResponse>>(PrepareAsyncListProcessRaw(context, request, cq));
} }
// Kill a running process on frontend.
virtual ::grpc::Status KillProcess(::grpc::ClientContext* context, const ::greptime::v1::frontend::KillProcessRequest& request, ::greptime::v1::frontend::KillProcessResponse* response) = 0;
std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::greptime::v1::frontend::KillProcessResponse>> AsyncKillProcess(::grpc::ClientContext* context, const ::greptime::v1::frontend::KillProcessRequest& request, ::grpc::CompletionQueue* cq) {
return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::greptime::v1::frontend::KillProcessResponse>>(AsyncKillProcessRaw(context, request, cq));
}
std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::greptime::v1::frontend::KillProcessResponse>> PrepareAsyncKillProcess(::grpc::ClientContext* context, const ::greptime::v1::frontend::KillProcessRequest& request, ::grpc::CompletionQueue* cq) {
return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::greptime::v1::frontend::KillProcessResponse>>(PrepareAsyncKillProcessRaw(context, request, cq));
}
class async_interface { class async_interface {
public: public:
virtual ~async_interface() {} virtual ~async_interface() {}
// List all running processes on frontend. // List all running processes on frontend.
virtual void ListProcess(::grpc::ClientContext* context, const ::greptime::v1::frontend::ListProcessRequest* request, ::greptime::v1::frontend::ListProcessResponse* response, std::function<void(::grpc::Status)>) = 0; virtual void ListProcess(::grpc::ClientContext* context, const ::greptime::v1::frontend::ListProcessRequest* request, ::greptime::v1::frontend::ListProcessResponse* response, std::function<void(::grpc::Status)>) = 0;
virtual void ListProcess(::grpc::ClientContext* context, const ::greptime::v1::frontend::ListProcessRequest* request, ::greptime::v1::frontend::ListProcessResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; virtual void ListProcess(::grpc::ClientContext* context, const ::greptime::v1::frontend::ListProcessRequest* request, ::greptime::v1::frontend::ListProcessResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0;
// Kill a running process on frontend.
virtual void KillProcess(::grpc::ClientContext* context, const ::greptime::v1::frontend::KillProcessRequest* request, ::greptime::v1::frontend::KillProcessResponse* response, std::function<void(::grpc::Status)>) = 0;
virtual void KillProcess(::grpc::ClientContext* context, const ::greptime::v1::frontend::KillProcessRequest* request, ::greptime::v1::frontend::KillProcessResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0;
}; };
typedef class async_interface experimental_async_interface; typedef class async_interface experimental_async_interface;
virtual class async_interface* async() { return nullptr; } virtual class async_interface* async() { return nullptr; }
@@ -73,6 +84,8 @@ class Frontend final {
private: private:
virtual ::grpc::ClientAsyncResponseReaderInterface< ::greptime::v1::frontend::ListProcessResponse>* AsyncListProcessRaw(::grpc::ClientContext* context, const ::greptime::v1::frontend::ListProcessRequest& request, ::grpc::CompletionQueue* cq) = 0; virtual ::grpc::ClientAsyncResponseReaderInterface< ::greptime::v1::frontend::ListProcessResponse>* AsyncListProcessRaw(::grpc::ClientContext* context, const ::greptime::v1::frontend::ListProcessRequest& request, ::grpc::CompletionQueue* cq) = 0;
virtual ::grpc::ClientAsyncResponseReaderInterface< ::greptime::v1::frontend::ListProcessResponse>* PrepareAsyncListProcessRaw(::grpc::ClientContext* context, const ::greptime::v1::frontend::ListProcessRequest& request, ::grpc::CompletionQueue* cq) = 0; virtual ::grpc::ClientAsyncResponseReaderInterface< ::greptime::v1::frontend::ListProcessResponse>* PrepareAsyncListProcessRaw(::grpc::ClientContext* context, const ::greptime::v1::frontend::ListProcessRequest& request, ::grpc::CompletionQueue* cq) = 0;
virtual ::grpc::ClientAsyncResponseReaderInterface< ::greptime::v1::frontend::KillProcessResponse>* AsyncKillProcessRaw(::grpc::ClientContext* context, const ::greptime::v1::frontend::KillProcessRequest& request, ::grpc::CompletionQueue* cq) = 0;
virtual ::grpc::ClientAsyncResponseReaderInterface< ::greptime::v1::frontend::KillProcessResponse>* PrepareAsyncKillProcessRaw(::grpc::ClientContext* context, const ::greptime::v1::frontend::KillProcessRequest& request, ::grpc::CompletionQueue* cq) = 0;
}; };
class Stub final : public StubInterface { class Stub final : public StubInterface {
public: public:
@@ -84,11 +97,20 @@ class Frontend final {
std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::greptime::v1::frontend::ListProcessResponse>> PrepareAsyncListProcess(::grpc::ClientContext* context, const ::greptime::v1::frontend::ListProcessRequest& request, ::grpc::CompletionQueue* cq) { std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::greptime::v1::frontend::ListProcessResponse>> PrepareAsyncListProcess(::grpc::ClientContext* context, const ::greptime::v1::frontend::ListProcessRequest& request, ::grpc::CompletionQueue* cq) {
return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::greptime::v1::frontend::ListProcessResponse>>(PrepareAsyncListProcessRaw(context, request, cq)); return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::greptime::v1::frontend::ListProcessResponse>>(PrepareAsyncListProcessRaw(context, request, cq));
} }
::grpc::Status KillProcess(::grpc::ClientContext* context, const ::greptime::v1::frontend::KillProcessRequest& request, ::greptime::v1::frontend::KillProcessResponse* response) override;
std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::greptime::v1::frontend::KillProcessResponse>> AsyncKillProcess(::grpc::ClientContext* context, const ::greptime::v1::frontend::KillProcessRequest& request, ::grpc::CompletionQueue* cq) {
return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::greptime::v1::frontend::KillProcessResponse>>(AsyncKillProcessRaw(context, request, cq));
}
std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::greptime::v1::frontend::KillProcessResponse>> PrepareAsyncKillProcess(::grpc::ClientContext* context, const ::greptime::v1::frontend::KillProcessRequest& request, ::grpc::CompletionQueue* cq) {
return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::greptime::v1::frontend::KillProcessResponse>>(PrepareAsyncKillProcessRaw(context, request, cq));
}
class async final : class async final :
public StubInterface::async_interface { public StubInterface::async_interface {
public: public:
void ListProcess(::grpc::ClientContext* context, const ::greptime::v1::frontend::ListProcessRequest* request, ::greptime::v1::frontend::ListProcessResponse* response, std::function<void(::grpc::Status)>) override; void ListProcess(::grpc::ClientContext* context, const ::greptime::v1::frontend::ListProcessRequest* request, ::greptime::v1::frontend::ListProcessResponse* response, std::function<void(::grpc::Status)>) override;
void ListProcess(::grpc::ClientContext* context, const ::greptime::v1::frontend::ListProcessRequest* request, ::greptime::v1::frontend::ListProcessResponse* response, ::grpc::ClientUnaryReactor* reactor) override; void ListProcess(::grpc::ClientContext* context, const ::greptime::v1::frontend::ListProcessRequest* request, ::greptime::v1::frontend::ListProcessResponse* response, ::grpc::ClientUnaryReactor* reactor) override;
void KillProcess(::grpc::ClientContext* context, const ::greptime::v1::frontend::KillProcessRequest* request, ::greptime::v1::frontend::KillProcessResponse* response, std::function<void(::grpc::Status)>) override;
void KillProcess(::grpc::ClientContext* context, const ::greptime::v1::frontend::KillProcessRequest* request, ::greptime::v1::frontend::KillProcessResponse* response, ::grpc::ClientUnaryReactor* reactor) override;
private: private:
friend class Stub; friend class Stub;
explicit async(Stub* stub): stub_(stub) { } explicit async(Stub* stub): stub_(stub) { }
@@ -102,7 +124,10 @@ class Frontend final {
class async async_stub_{this}; class async async_stub_{this};
::grpc::ClientAsyncResponseReader< ::greptime::v1::frontend::ListProcessResponse>* AsyncListProcessRaw(::grpc::ClientContext* context, const ::greptime::v1::frontend::ListProcessRequest& request, ::grpc::CompletionQueue* cq) override; ::grpc::ClientAsyncResponseReader< ::greptime::v1::frontend::ListProcessResponse>* AsyncListProcessRaw(::grpc::ClientContext* context, const ::greptime::v1::frontend::ListProcessRequest& request, ::grpc::CompletionQueue* cq) override;
::grpc::ClientAsyncResponseReader< ::greptime::v1::frontend::ListProcessResponse>* PrepareAsyncListProcessRaw(::grpc::ClientContext* context, const ::greptime::v1::frontend::ListProcessRequest& request, ::grpc::CompletionQueue* cq) override; ::grpc::ClientAsyncResponseReader< ::greptime::v1::frontend::ListProcessResponse>* PrepareAsyncListProcessRaw(::grpc::ClientContext* context, const ::greptime::v1::frontend::ListProcessRequest& request, ::grpc::CompletionQueue* cq) override;
::grpc::ClientAsyncResponseReader< ::greptime::v1::frontend::KillProcessResponse>* AsyncKillProcessRaw(::grpc::ClientContext* context, const ::greptime::v1::frontend::KillProcessRequest& request, ::grpc::CompletionQueue* cq) override;
::grpc::ClientAsyncResponseReader< ::greptime::v1::frontend::KillProcessResponse>* PrepareAsyncKillProcessRaw(::grpc::ClientContext* context, const ::greptime::v1::frontend::KillProcessRequest& request, ::grpc::CompletionQueue* cq) override;
const ::grpc::internal::RpcMethod rpcmethod_ListProcess_; const ::grpc::internal::RpcMethod rpcmethod_ListProcess_;
const ::grpc::internal::RpcMethod rpcmethod_KillProcess_;
}; };
static std::unique_ptr<Stub> NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options = ::grpc::StubOptions()); static std::unique_ptr<Stub> NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options = ::grpc::StubOptions());
@@ -112,6 +137,8 @@ class Frontend final {
virtual ~Service(); virtual ~Service();
// List all running processes on frontend. // List all running processes on frontend.
virtual ::grpc::Status ListProcess(::grpc::ServerContext* context, const ::greptime::v1::frontend::ListProcessRequest* request, ::greptime::v1::frontend::ListProcessResponse* response); virtual ::grpc::Status ListProcess(::grpc::ServerContext* context, const ::greptime::v1::frontend::ListProcessRequest* request, ::greptime::v1::frontend::ListProcessResponse* response);
// Kill a running process on frontend.
virtual ::grpc::Status KillProcess(::grpc::ServerContext* context, const ::greptime::v1::frontend::KillProcessRequest* request, ::greptime::v1::frontend::KillProcessResponse* response);
}; };
template <class BaseClass> template <class BaseClass>
class WithAsyncMethod_ListProcess : public BaseClass { class WithAsyncMethod_ListProcess : public BaseClass {
@@ -133,7 +160,27 @@ class Frontend final {
::grpc::Service::RequestAsyncUnary(0, context, request, response, new_call_cq, notification_cq, tag); ::grpc::Service::RequestAsyncUnary(0, context, request, response, new_call_cq, notification_cq, tag);
} }
}; };
typedef WithAsyncMethod_ListProcess<Service > AsyncService; template <class BaseClass>
class WithAsyncMethod_KillProcess : public BaseClass {
private:
void BaseClassMustBeDerivedFromService(const Service* /*service*/) {}
public:
WithAsyncMethod_KillProcess() {
::grpc::Service::MarkMethodAsync(1);
}
~WithAsyncMethod_KillProcess() override {
BaseClassMustBeDerivedFromService(this);
}
// disable synchronous version of this method
::grpc::Status KillProcess(::grpc::ServerContext* /*context*/, const ::greptime::v1::frontend::KillProcessRequest* /*request*/, ::greptime::v1::frontend::KillProcessResponse* /*response*/) override {
abort();
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
}
void RequestKillProcess(::grpc::ServerContext* context, ::greptime::v1::frontend::KillProcessRequest* request, ::grpc::ServerAsyncResponseWriter< ::greptime::v1::frontend::KillProcessResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) {
::grpc::Service::RequestAsyncUnary(1, context, request, response, new_call_cq, notification_cq, tag);
}
};
typedef WithAsyncMethod_ListProcess<WithAsyncMethod_KillProcess<Service > > AsyncService;
template <class BaseClass> template <class BaseClass>
class WithCallbackMethod_ListProcess : public BaseClass { class WithCallbackMethod_ListProcess : public BaseClass {
private: private:
@@ -161,7 +208,34 @@ class Frontend final {
virtual ::grpc::ServerUnaryReactor* ListProcess( virtual ::grpc::ServerUnaryReactor* ListProcess(
::grpc::CallbackServerContext* /*context*/, const ::greptime::v1::frontend::ListProcessRequest* /*request*/, ::greptime::v1::frontend::ListProcessResponse* /*response*/) { return nullptr; } ::grpc::CallbackServerContext* /*context*/, const ::greptime::v1::frontend::ListProcessRequest* /*request*/, ::greptime::v1::frontend::ListProcessResponse* /*response*/) { return nullptr; }
}; };
typedef WithCallbackMethod_ListProcess<Service > CallbackService; template <class BaseClass>
class WithCallbackMethod_KillProcess : public BaseClass {
private:
void BaseClassMustBeDerivedFromService(const Service* /*service*/) {}
public:
WithCallbackMethod_KillProcess() {
::grpc::Service::MarkMethodCallback(1,
new ::grpc::internal::CallbackUnaryHandler< ::greptime::v1::frontend::KillProcessRequest, ::greptime::v1::frontend::KillProcessResponse>(
[this](
::grpc::CallbackServerContext* context, const ::greptime::v1::frontend::KillProcessRequest* request, ::greptime::v1::frontend::KillProcessResponse* response) { return this->KillProcess(context, request, response); }));}
void SetMessageAllocatorFor_KillProcess(
::grpc::MessageAllocator< ::greptime::v1::frontend::KillProcessRequest, ::greptime::v1::frontend::KillProcessResponse>* allocator) {
::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(1);
static_cast<::grpc::internal::CallbackUnaryHandler< ::greptime::v1::frontend::KillProcessRequest, ::greptime::v1::frontend::KillProcessResponse>*>(handler)
->SetMessageAllocator(allocator);
}
~WithCallbackMethod_KillProcess() override {
BaseClassMustBeDerivedFromService(this);
}
// disable synchronous version of this method
::grpc::Status KillProcess(::grpc::ServerContext* /*context*/, const ::greptime::v1::frontend::KillProcessRequest* /*request*/, ::greptime::v1::frontend::KillProcessResponse* /*response*/) override {
abort();
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
}
virtual ::grpc::ServerUnaryReactor* KillProcess(
::grpc::CallbackServerContext* /*context*/, const ::greptime::v1::frontend::KillProcessRequest* /*request*/, ::greptime::v1::frontend::KillProcessResponse* /*response*/) { return nullptr; }
};
typedef WithCallbackMethod_ListProcess<WithCallbackMethod_KillProcess<Service > > CallbackService;
typedef CallbackService ExperimentalCallbackService; typedef CallbackService ExperimentalCallbackService;
template <class BaseClass> template <class BaseClass>
class WithGenericMethod_ListProcess : public BaseClass { class WithGenericMethod_ListProcess : public BaseClass {
@@ -181,6 +255,23 @@ class Frontend final {
} }
}; };
template <class BaseClass> template <class BaseClass>
class WithGenericMethod_KillProcess : public BaseClass {
private:
void BaseClassMustBeDerivedFromService(const Service* /*service*/) {}
public:
WithGenericMethod_KillProcess() {
::grpc::Service::MarkMethodGeneric(1);
}
~WithGenericMethod_KillProcess() override {
BaseClassMustBeDerivedFromService(this);
}
// disable synchronous version of this method
::grpc::Status KillProcess(::grpc::ServerContext* /*context*/, const ::greptime::v1::frontend::KillProcessRequest* /*request*/, ::greptime::v1::frontend::KillProcessResponse* /*response*/) override {
abort();
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
}
};
template <class BaseClass>
class WithRawMethod_ListProcess : public BaseClass { class WithRawMethod_ListProcess : public BaseClass {
private: private:
void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} void BaseClassMustBeDerivedFromService(const Service* /*service*/) {}
@@ -201,6 +292,26 @@ class Frontend final {
} }
}; };
template <class BaseClass> template <class BaseClass>
class WithRawMethod_KillProcess : public BaseClass {
private:
void BaseClassMustBeDerivedFromService(const Service* /*service*/) {}
public:
WithRawMethod_KillProcess() {
::grpc::Service::MarkMethodRaw(1);
}
~WithRawMethod_KillProcess() override {
BaseClassMustBeDerivedFromService(this);
}
// disable synchronous version of this method
::grpc::Status KillProcess(::grpc::ServerContext* /*context*/, const ::greptime::v1::frontend::KillProcessRequest* /*request*/, ::greptime::v1::frontend::KillProcessResponse* /*response*/) override {
abort();
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
}
void RequestKillProcess(::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(1, context, request, response, new_call_cq, notification_cq, tag);
}
};
template <class BaseClass>
class WithRawCallbackMethod_ListProcess : public BaseClass { class WithRawCallbackMethod_ListProcess : public BaseClass {
private: private:
void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} void BaseClassMustBeDerivedFromService(const Service* /*service*/) {}
@@ -223,6 +334,28 @@ class Frontend final {
::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; }
}; };
template <class BaseClass> template <class BaseClass>
class WithRawCallbackMethod_KillProcess : public BaseClass {
private:
void BaseClassMustBeDerivedFromService(const Service* /*service*/) {}
public:
WithRawCallbackMethod_KillProcess() {
::grpc::Service::MarkMethodRawCallback(1,
new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>(
[this](
::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->KillProcess(context, request, response); }));
}
~WithRawCallbackMethod_KillProcess() override {
BaseClassMustBeDerivedFromService(this);
}
// disable synchronous version of this method
::grpc::Status KillProcess(::grpc::ServerContext* /*context*/, const ::greptime::v1::frontend::KillProcessRequest* /*request*/, ::greptime::v1::frontend::KillProcessResponse* /*response*/) override {
abort();
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
}
virtual ::grpc::ServerUnaryReactor* KillProcess(
::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; }
};
template <class BaseClass>
class WithStreamedUnaryMethod_ListProcess : public BaseClass { class WithStreamedUnaryMethod_ListProcess : public BaseClass {
private: private:
void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} void BaseClassMustBeDerivedFromService(const Service* /*service*/) {}
@@ -249,9 +382,36 @@ class Frontend final {
// replace default version of method with streamed unary // replace default version of method with streamed unary
virtual ::grpc::Status StreamedListProcess(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::greptime::v1::frontend::ListProcessRequest,::greptime::v1::frontend::ListProcessResponse>* server_unary_streamer) = 0; virtual ::grpc::Status StreamedListProcess(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::greptime::v1::frontend::ListProcessRequest,::greptime::v1::frontend::ListProcessResponse>* server_unary_streamer) = 0;
}; };
typedef WithStreamedUnaryMethod_ListProcess<Service > StreamedUnaryService; template <class BaseClass>
class WithStreamedUnaryMethod_KillProcess : public BaseClass {
private:
void BaseClassMustBeDerivedFromService(const Service* /*service*/) {}
public:
WithStreamedUnaryMethod_KillProcess() {
::grpc::Service::MarkMethodStreamed(1,
new ::grpc::internal::StreamedUnaryHandler<
::greptime::v1::frontend::KillProcessRequest, ::greptime::v1::frontend::KillProcessResponse>(
[this](::grpc::ServerContext* context,
::grpc::ServerUnaryStreamer<
::greptime::v1::frontend::KillProcessRequest, ::greptime::v1::frontend::KillProcessResponse>* streamer) {
return this->StreamedKillProcess(context,
streamer);
}));
}
~WithStreamedUnaryMethod_KillProcess() override {
BaseClassMustBeDerivedFromService(this);
}
// disable regular version of this method
::grpc::Status KillProcess(::grpc::ServerContext* /*context*/, const ::greptime::v1::frontend::KillProcessRequest* /*request*/, ::greptime::v1::frontend::KillProcessResponse* /*response*/) override {
abort();
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
}
// replace default version of method with streamed unary
virtual ::grpc::Status StreamedKillProcess(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::greptime::v1::frontend::KillProcessRequest,::greptime::v1::frontend::KillProcessResponse>* server_unary_streamer) = 0;
};
typedef WithStreamedUnaryMethod_ListProcess<WithStreamedUnaryMethod_KillProcess<Service > > StreamedUnaryService;
typedef Service SplitStreamedService; typedef Service SplitStreamedService;
typedef WithStreamedUnaryMethod_ListProcess<Service > StreamedService; typedef WithStreamedUnaryMethod_ListProcess<WithStreamedUnaryMethod_KillProcess<Service > > StreamedService;
}; };
} // namespace frontend } // namespace frontend
+532 -13
View File
@@ -49,6 +49,34 @@ struct ListProcessResponseDefaultTypeInternal {
}; };
}; };
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ListProcessResponseDefaultTypeInternal _ListProcessResponse_default_instance_; PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ListProcessResponseDefaultTypeInternal _ListProcessResponse_default_instance_;
PROTOBUF_CONSTEXPR KillProcessRequest::KillProcessRequest(
::_pbi::ConstantInitialized): _impl_{
/*decltype(_impl_.server_addr_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
, /*decltype(_impl_.catalog_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
, /*decltype(_impl_.process_id_)*/uint64_t{0u}
, /*decltype(_impl_._cached_size_)*/{}} {}
struct KillProcessRequestDefaultTypeInternal {
PROTOBUF_CONSTEXPR KillProcessRequestDefaultTypeInternal()
: _instance(::_pbi::ConstantInitialized{}) {}
~KillProcessRequestDefaultTypeInternal() {}
union {
KillProcessRequest _instance;
};
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 KillProcessRequestDefaultTypeInternal _KillProcessRequest_default_instance_;
PROTOBUF_CONSTEXPR KillProcessResponse::KillProcessResponse(
::_pbi::ConstantInitialized): _impl_{
/*decltype(_impl_.success_)*/false
, /*decltype(_impl_._cached_size_)*/{}} {}
struct KillProcessResponseDefaultTypeInternal {
PROTOBUF_CONSTEXPR KillProcessResponseDefaultTypeInternal()
: _instance(::_pbi::ConstantInitialized{}) {}
~KillProcessResponseDefaultTypeInternal() {}
union {
KillProcessResponse _instance;
};
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 KillProcessResponseDefaultTypeInternal _KillProcessResponse_default_instance_;
PROTOBUF_CONSTEXPR ProcessInfo::ProcessInfo( PROTOBUF_CONSTEXPR ProcessInfo::ProcessInfo(
::_pbi::ConstantInitialized): _impl_{ ::_pbi::ConstantInitialized): _impl_{
/*decltype(_impl_.schemas_)*/{} /*decltype(_impl_.schemas_)*/{}
@@ -71,7 +99,7 @@ PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORIT
} // namespace frontend } // namespace frontend
} // namespace v1 } // namespace v1
} // namespace greptime } // namespace greptime
static ::_pb::Metadata file_level_metadata_greptime_2fv1_2ffrontend_2fserver_2eproto[3]; static ::_pb::Metadata file_level_metadata_greptime_2fv1_2ffrontend_2fserver_2eproto[5];
static constexpr ::_pb::EnumDescriptor const** file_level_enum_descriptors_greptime_2fv1_2ffrontend_2fserver_2eproto = nullptr; static constexpr ::_pb::EnumDescriptor const** file_level_enum_descriptors_greptime_2fv1_2ffrontend_2fserver_2eproto = nullptr;
static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_greptime_2fv1_2ffrontend_2fserver_2eproto = nullptr; static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_greptime_2fv1_2ffrontend_2fserver_2eproto = nullptr;
@@ -91,6 +119,22 @@ const uint32_t TableStruct_greptime_2fv1_2ffrontend_2fserver_2eproto::offsets[]
~0u, // no _inlined_string_donated_ ~0u, // no _inlined_string_donated_
PROTOBUF_FIELD_OFFSET(::greptime::v1::frontend::ListProcessResponse, _impl_.processes_), PROTOBUF_FIELD_OFFSET(::greptime::v1::frontend::ListProcessResponse, _impl_.processes_),
~0u, // no _has_bits_ ~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::greptime::v1::frontend::KillProcessRequest, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
~0u, // no _inlined_string_donated_
PROTOBUF_FIELD_OFFSET(::greptime::v1::frontend::KillProcessRequest, _impl_.server_addr_),
PROTOBUF_FIELD_OFFSET(::greptime::v1::frontend::KillProcessRequest, _impl_.catalog_),
PROTOBUF_FIELD_OFFSET(::greptime::v1::frontend::KillProcessRequest, _impl_.process_id_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::greptime::v1::frontend::KillProcessResponse, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
~0u, // no _inlined_string_donated_
PROTOBUF_FIELD_OFFSET(::greptime::v1::frontend::KillProcessResponse, _impl_.success_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::greptime::v1::frontend::ProcessInfo, _internal_metadata_), PROTOBUF_FIELD_OFFSET(::greptime::v1::frontend::ProcessInfo, _internal_metadata_),
~0u, // no _extensions_ ~0u, // no _extensions_
~0u, // no _oneof_case_ ~0u, // no _oneof_case_
@@ -107,12 +151,16 @@ const uint32_t TableStruct_greptime_2fv1_2ffrontend_2fserver_2eproto::offsets[]
static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
{ 0, -1, -1, sizeof(::greptime::v1::frontend::ListProcessRequest)}, { 0, -1, -1, sizeof(::greptime::v1::frontend::ListProcessRequest)},
{ 7, -1, -1, sizeof(::greptime::v1::frontend::ListProcessResponse)}, { 7, -1, -1, sizeof(::greptime::v1::frontend::ListProcessResponse)},
{ 14, -1, -1, sizeof(::greptime::v1::frontend::ProcessInfo)}, { 14, -1, -1, sizeof(::greptime::v1::frontend::KillProcessRequest)},
{ 23, -1, -1, sizeof(::greptime::v1::frontend::KillProcessResponse)},
{ 30, -1, -1, sizeof(::greptime::v1::frontend::ProcessInfo)},
}; };
static const ::_pb::Message* const file_default_instances[] = { static const ::_pb::Message* const file_default_instances[] = {
&::greptime::v1::frontend::_ListProcessRequest_default_instance_._instance, &::greptime::v1::frontend::_ListProcessRequest_default_instance_._instance,
&::greptime::v1::frontend::_ListProcessResponse_default_instance_._instance, &::greptime::v1::frontend::_ListProcessResponse_default_instance_._instance,
&::greptime::v1::frontend::_KillProcessRequest_default_instance_._instance,
&::greptime::v1::frontend::_KillProcessResponse_default_instance_._instance,
&::greptime::v1::frontend::_ProcessInfo_default_instance_._instance, &::greptime::v1::frontend::_ProcessInfo_default_instance_._instance,
}; };
@@ -121,22 +169,27 @@ const char descriptor_table_protodef_greptime_2fv1_2ffrontend_2fserver_2eproto[]
"ptime.v1.frontend\"%\n\022ListProcessRequest\022" "ptime.v1.frontend\"%\n\022ListProcessRequest\022"
"\017\n\007catalog\030\001 \001(\t\"K\n\023ListProcessResponse\022" "\017\n\007catalog\030\001 \001(\t\"K\n\023ListProcessResponse\022"
"4\n\tprocesses\030\001 \003(\0132!.greptime.v1.fronten" "4\n\tprocesses\030\001 \003(\0132!.greptime.v1.fronten"
"d.ProcessInfo\"\205\001\n\013ProcessInfo\022\n\n\002id\030\001 \001(" "d.ProcessInfo\"N\n\022KillProcessRequest\022\023\n\013s"
"erver_addr\030\001 \001(\t\022\017\n\007catalog\030\002 \001(\t\022\022\n\npro"
"cess_id\030\003 \001(\004\"&\n\023KillProcessResponse\022\017\n\007"
"success\030\001 \001(\010\"\205\001\n\013ProcessInfo\022\n\n\002id\030\001 \001("
"\004\022\017\n\007catalog\030\002 \001(\t\022\017\n\007schemas\030\003 \003(\t\022\r\n\005q" "\004\022\017\n\007catalog\030\002 \001(\t\022\017\n\007schemas\030\003 \003(\t\022\r\n\005q"
"uery\030\004 \001(\t\022\027\n\017start_timestamp\030\005 \001(\003\022\016\n\006c" "uery\030\004 \001(\t\022\027\n\017start_timestamp\030\005 \001(\003\022\016\n\006c"
"lient\030\006 \001(\t\022\020\n\010frontend\030\007 \001(\t2n\n\010Fronten" "lient\030\006 \001(\t\022\020\n\010frontend\030\007 \001(\t2\322\001\n\010Fronte"
"d\022b\n\013ListProcess\022(.greptime.v1.frontend." "nd\022b\n\013ListProcess\022(.greptime.v1.frontend"
"ListProcessRequest\032).greptime.v1.fronten" ".ListProcessRequest\032).greptime.v1.fronte"
"d.ListProcessResponseBa\n\027io.greptime.v1." "nd.ListProcessResponse\022b\n\013KillProcess\022(."
"frontendB\006ServerZ>github.com/GreptimeTea" "greptime.v1.frontend.KillProcessRequest\032"
"m/greptime-proto/go/greptime/v1/frontend" ").greptime.v1.frontend.KillProcessRespon"
"b\006proto3" "seBa\n\027io.greptime.v1.frontendB\006ServerZ>g"
"ithub.com/GreptimeTeam/greptime-proto/go"
"/greptime/v1/frontendb\006proto3"
; ;
static ::_pbi::once_flag descriptor_table_greptime_2fv1_2ffrontend_2fserver_2eproto_once; static ::_pbi::once_flag descriptor_table_greptime_2fv1_2ffrontend_2fserver_2eproto_once;
const ::_pbi::DescriptorTable descriptor_table_greptime_2fv1_2ffrontend_2fserver_2eproto = { const ::_pbi::DescriptorTable descriptor_table_greptime_2fv1_2ffrontend_2fserver_2eproto = {
false, false, 528, descriptor_table_protodef_greptime_2fv1_2ffrontend_2fserver_2eproto, false, false, 749, descriptor_table_protodef_greptime_2fv1_2ffrontend_2fserver_2eproto,
"greptime/v1/frontend/server.proto", "greptime/v1/frontend/server.proto",
&descriptor_table_greptime_2fv1_2ffrontend_2fserver_2eproto_once, nullptr, 0, 3, &descriptor_table_greptime_2fv1_2ffrontend_2fserver_2eproto_once, nullptr, 0, 5,
schemas, file_default_instances, TableStruct_greptime_2fv1_2ffrontend_2fserver_2eproto::offsets, schemas, file_default_instances, TableStruct_greptime_2fv1_2ffrontend_2fserver_2eproto::offsets,
file_level_metadata_greptime_2fv1_2ffrontend_2fserver_2eproto, file_level_enum_descriptors_greptime_2fv1_2ffrontend_2fserver_2eproto, file_level_metadata_greptime_2fv1_2ffrontend_2fserver_2eproto, file_level_enum_descriptors_greptime_2fv1_2ffrontend_2fserver_2eproto,
file_level_service_descriptors_greptime_2fv1_2ffrontend_2fserver_2eproto, file_level_service_descriptors_greptime_2fv1_2ffrontend_2fserver_2eproto,
@@ -541,6 +594,464 @@ void ListProcessResponse::InternalSwap(ListProcessResponse* other) {
// =================================================================== // ===================================================================
class KillProcessRequest::_Internal {
public:
};
KillProcessRequest::KillProcessRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena,
bool is_message_owned)
: ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
SharedCtor(arena, is_message_owned);
// @@protoc_insertion_point(arena_constructor:greptime.v1.frontend.KillProcessRequest)
}
KillProcessRequest::KillProcessRequest(const KillProcessRequest& from)
: ::PROTOBUF_NAMESPACE_ID::Message() {
KillProcessRequest* const _this = this; (void)_this;
new (&_impl_) Impl_{
decltype(_impl_.server_addr_){}
, decltype(_impl_.catalog_){}
, decltype(_impl_.process_id_){}
, /*decltype(_impl_._cached_size_)*/{}};
_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
_impl_.server_addr_.InitDefault();
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
_impl_.server_addr_.Set("", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
if (!from._internal_server_addr().empty()) {
_this->_impl_.server_addr_.Set(from._internal_server_addr(),
_this->GetArenaForAllocation());
}
_impl_.catalog_.InitDefault();
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
_impl_.catalog_.Set("", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
if (!from._internal_catalog().empty()) {
_this->_impl_.catalog_.Set(from._internal_catalog(),
_this->GetArenaForAllocation());
}
_this->_impl_.process_id_ = from._impl_.process_id_;
// @@protoc_insertion_point(copy_constructor:greptime.v1.frontend.KillProcessRequest)
}
inline void KillProcessRequest::SharedCtor(
::_pb::Arena* arena, bool is_message_owned) {
(void)arena;
(void)is_message_owned;
new (&_impl_) Impl_{
decltype(_impl_.server_addr_){}
, decltype(_impl_.catalog_){}
, decltype(_impl_.process_id_){uint64_t{0u}}
, /*decltype(_impl_._cached_size_)*/{}
};
_impl_.server_addr_.InitDefault();
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
_impl_.server_addr_.Set("", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
_impl_.catalog_.InitDefault();
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
_impl_.catalog_.Set("", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
}
KillProcessRequest::~KillProcessRequest() {
// @@protoc_insertion_point(destructor:greptime.v1.frontend.KillProcessRequest)
if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) {
(void)arena;
return;
}
SharedDtor();
}
inline void KillProcessRequest::SharedDtor() {
GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
_impl_.server_addr_.Destroy();
_impl_.catalog_.Destroy();
}
void KillProcessRequest::SetCachedSize(int size) const {
_impl_._cached_size_.Set(size);
}
void KillProcessRequest::Clear() {
// @@protoc_insertion_point(message_clear_start:greptime.v1.frontend.KillProcessRequest)
uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
_impl_.server_addr_.ClearToEmpty();
_impl_.catalog_.ClearToEmpty();
_impl_.process_id_ = uint64_t{0u};
_internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}
const char* KillProcessRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
uint32_t tag;
ptr = ::_pbi::ReadTag(ptr, &tag);
switch (tag >> 3) {
// string server_addr = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
auto str = _internal_mutable_server_addr();
ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
CHK_(ptr);
CHK_(::_pbi::VerifyUTF8(str, "greptime.v1.frontend.KillProcessRequest.server_addr"));
} else
goto handle_unusual;
continue;
// string catalog = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
auto str = _internal_mutable_catalog();
ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
CHK_(ptr);
CHK_(::_pbi::VerifyUTF8(str, "greptime.v1.frontend.KillProcessRequest.catalog"));
} else
goto handle_unusual;
continue;
// uint64 process_id = 3;
case 3:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
_impl_.process_id_ = ::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_
}
uint8_t* KillProcessRequest::_InternalSerialize(
uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:greptime.v1.frontend.KillProcessRequest)
uint32_t cached_has_bits = 0;
(void) cached_has_bits;
// string server_addr = 1;
if (!this->_internal_server_addr().empty()) {
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
this->_internal_server_addr().data(), static_cast<int>(this->_internal_server_addr().length()),
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
"greptime.v1.frontend.KillProcessRequest.server_addr");
target = stream->WriteStringMaybeAliased(
1, this->_internal_server_addr(), target);
}
// string catalog = 2;
if (!this->_internal_catalog().empty()) {
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
this->_internal_catalog().data(), static_cast<int>(this->_internal_catalog().length()),
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
"greptime.v1.frontend.KillProcessRequest.catalog");
target = stream->WriteStringMaybeAliased(
2, this->_internal_catalog(), target);
}
// uint64 process_id = 3;
if (this->_internal_process_id() != 0) {
target = stream->EnsureSpace(target);
target = ::_pbi::WireFormatLite::WriteUInt64ToArray(3, this->_internal_process_id(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::_pbi::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:greptime.v1.frontend.KillProcessRequest)
return target;
}
size_t KillProcessRequest::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:greptime.v1.frontend.KillProcessRequest)
size_t total_size = 0;
uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// string server_addr = 1;
if (!this->_internal_server_addr().empty()) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
this->_internal_server_addr());
}
// string catalog = 2;
if (!this->_internal_catalog().empty()) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
this->_internal_catalog());
}
// uint64 process_id = 3;
if (this->_internal_process_id() != 0) {
total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_process_id());
}
return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
}
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData KillProcessRequest::_class_data_ = {
::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck,
KillProcessRequest::MergeImpl
};
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*KillProcessRequest::GetClassData() const { return &_class_data_; }
void KillProcessRequest::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) {
auto* const _this = static_cast<KillProcessRequest*>(&to_msg);
auto& from = static_cast<const KillProcessRequest&>(from_msg);
// @@protoc_insertion_point(class_specific_merge_from_start:greptime.v1.frontend.KillProcessRequest)
GOOGLE_DCHECK_NE(&from, _this);
uint32_t cached_has_bits = 0;
(void) cached_has_bits;
if (!from._internal_server_addr().empty()) {
_this->_internal_set_server_addr(from._internal_server_addr());
}
if (!from._internal_catalog().empty()) {
_this->_internal_set_catalog(from._internal_catalog());
}
if (from._internal_process_id() != 0) {
_this->_internal_set_process_id(from._internal_process_id());
}
_this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}
void KillProcessRequest::CopyFrom(const KillProcessRequest& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:greptime.v1.frontend.KillProcessRequest)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool KillProcessRequest::IsInitialized() const {
return true;
}
void KillProcessRequest::InternalSwap(KillProcessRequest* other) {
using std::swap;
auto* lhs_arena = GetArenaForAllocation();
auto* rhs_arena = other->GetArenaForAllocation();
_internal_metadata_.InternalSwap(&other->_internal_metadata_);
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
&_impl_.server_addr_, lhs_arena,
&other->_impl_.server_addr_, rhs_arena
);
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
&_impl_.catalog_, lhs_arena,
&other->_impl_.catalog_, rhs_arena
);
swap(_impl_.process_id_, other->_impl_.process_id_);
}
::PROTOBUF_NAMESPACE_ID::Metadata KillProcessRequest::GetMetadata() const {
return ::_pbi::AssignDescriptors(
&descriptor_table_greptime_2fv1_2ffrontend_2fserver_2eproto_getter, &descriptor_table_greptime_2fv1_2ffrontend_2fserver_2eproto_once,
file_level_metadata_greptime_2fv1_2ffrontend_2fserver_2eproto[2]);
}
// ===================================================================
class KillProcessResponse::_Internal {
public:
};
KillProcessResponse::KillProcessResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena,
bool is_message_owned)
: ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
SharedCtor(arena, is_message_owned);
// @@protoc_insertion_point(arena_constructor:greptime.v1.frontend.KillProcessResponse)
}
KillProcessResponse::KillProcessResponse(const KillProcessResponse& from)
: ::PROTOBUF_NAMESPACE_ID::Message() {
KillProcessResponse* const _this = this; (void)_this;
new (&_impl_) Impl_{
decltype(_impl_.success_){}
, /*decltype(_impl_._cached_size_)*/{}};
_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
_this->_impl_.success_ = from._impl_.success_;
// @@protoc_insertion_point(copy_constructor:greptime.v1.frontend.KillProcessResponse)
}
inline void KillProcessResponse::SharedCtor(
::_pb::Arena* arena, bool is_message_owned) {
(void)arena;
(void)is_message_owned;
new (&_impl_) Impl_{
decltype(_impl_.success_){false}
, /*decltype(_impl_._cached_size_)*/{}
};
}
KillProcessResponse::~KillProcessResponse() {
// @@protoc_insertion_point(destructor:greptime.v1.frontend.KillProcessResponse)
if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) {
(void)arena;
return;
}
SharedDtor();
}
inline void KillProcessResponse::SharedDtor() {
GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
}
void KillProcessResponse::SetCachedSize(int size) const {
_impl_._cached_size_.Set(size);
}
void KillProcessResponse::Clear() {
// @@protoc_insertion_point(message_clear_start:greptime.v1.frontend.KillProcessResponse)
uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
_impl_.success_ = false;
_internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}
const char* KillProcessResponse::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
uint32_t tag;
ptr = ::_pbi::ReadTag(ptr, &tag);
switch (tag >> 3) {
// bool success = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
_impl_.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_
}
uint8_t* KillProcessResponse::_InternalSerialize(
uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:greptime.v1.frontend.KillProcessResponse)
uint32_t cached_has_bits = 0;
(void) cached_has_bits;
// bool success = 1;
if (this->_internal_success() != 0) {
target = stream->EnsureSpace(target);
target = ::_pbi::WireFormatLite::WriteBoolToArray(1, this->_internal_success(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::_pbi::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:greptime.v1.frontend.KillProcessResponse)
return target;
}
size_t KillProcessResponse::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:greptime.v1.frontend.KillProcessResponse)
size_t total_size = 0;
uint32_t 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, &_impl_._cached_size_);
}
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData KillProcessResponse::_class_data_ = {
::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck,
KillProcessResponse::MergeImpl
};
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*KillProcessResponse::GetClassData() const { return &_class_data_; }
void KillProcessResponse::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) {
auto* const _this = static_cast<KillProcessResponse*>(&to_msg);
auto& from = static_cast<const KillProcessResponse&>(from_msg);
// @@protoc_insertion_point(class_specific_merge_from_start:greptime.v1.frontend.KillProcessResponse)
GOOGLE_DCHECK_NE(&from, _this);
uint32_t cached_has_bits = 0;
(void) cached_has_bits;
if (from._internal_success() != 0) {
_this->_internal_set_success(from._internal_success());
}
_this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}
void KillProcessResponse::CopyFrom(const KillProcessResponse& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:greptime.v1.frontend.KillProcessResponse)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool KillProcessResponse::IsInitialized() const {
return true;
}
void KillProcessResponse::InternalSwap(KillProcessResponse* other) {
using std::swap;
_internal_metadata_.InternalSwap(&other->_internal_metadata_);
swap(_impl_.success_, other->_impl_.success_);
}
::PROTOBUF_NAMESPACE_ID::Metadata KillProcessResponse::GetMetadata() const {
return ::_pbi::AssignDescriptors(
&descriptor_table_greptime_2fv1_2ffrontend_2fserver_2eproto_getter, &descriptor_table_greptime_2fv1_2ffrontend_2fserver_2eproto_once,
file_level_metadata_greptime_2fv1_2ffrontend_2fserver_2eproto[3]);
}
// ===================================================================
class ProcessInfo::_Internal { class ProcessInfo::_Internal {
public: public:
}; };
@@ -988,7 +1499,7 @@ void ProcessInfo::InternalSwap(ProcessInfo* other) {
::PROTOBUF_NAMESPACE_ID::Metadata ProcessInfo::GetMetadata() const { ::PROTOBUF_NAMESPACE_ID::Metadata ProcessInfo::GetMetadata() const {
return ::_pbi::AssignDescriptors( return ::_pbi::AssignDescriptors(
&descriptor_table_greptime_2fv1_2ffrontend_2fserver_2eproto_getter, &descriptor_table_greptime_2fv1_2ffrontend_2fserver_2eproto_once, &descriptor_table_greptime_2fv1_2ffrontend_2fserver_2eproto_getter, &descriptor_table_greptime_2fv1_2ffrontend_2fserver_2eproto_once,
file_level_metadata_greptime_2fv1_2ffrontend_2fserver_2eproto[2]); file_level_metadata_greptime_2fv1_2ffrontend_2fserver_2eproto[4]);
} }
// @@protoc_insertion_point(namespace_scope) // @@protoc_insertion_point(namespace_scope)
@@ -1004,6 +1515,14 @@ template<> PROTOBUF_NOINLINE ::greptime::v1::frontend::ListProcessResponse*
Arena::CreateMaybeMessage< ::greptime::v1::frontend::ListProcessResponse >(Arena* arena) { Arena::CreateMaybeMessage< ::greptime::v1::frontend::ListProcessResponse >(Arena* arena) {
return Arena::CreateMessageInternal< ::greptime::v1::frontend::ListProcessResponse >(arena); return Arena::CreateMessageInternal< ::greptime::v1::frontend::ListProcessResponse >(arena);
} }
template<> PROTOBUF_NOINLINE ::greptime::v1::frontend::KillProcessRequest*
Arena::CreateMaybeMessage< ::greptime::v1::frontend::KillProcessRequest >(Arena* arena) {
return Arena::CreateMessageInternal< ::greptime::v1::frontend::KillProcessRequest >(arena);
}
template<> PROTOBUF_NOINLINE ::greptime::v1::frontend::KillProcessResponse*
Arena::CreateMaybeMessage< ::greptime::v1::frontend::KillProcessResponse >(Arena* arena) {
return Arena::CreateMessageInternal< ::greptime::v1::frontend::KillProcessResponse >(arena);
}
template<> PROTOBUF_NOINLINE ::greptime::v1::frontend::ProcessInfo* template<> PROTOBUF_NOINLINE ::greptime::v1::frontend::ProcessInfo*
Arena::CreateMaybeMessage< ::greptime::v1::frontend::ProcessInfo >(Arena* arena) { Arena::CreateMaybeMessage< ::greptime::v1::frontend::ProcessInfo >(Arena* arena) {
return Arena::CreateMessageInternal< ::greptime::v1::frontend::ProcessInfo >(arena); return Arena::CreateMessageInternal< ::greptime::v1::frontend::ProcessInfo >(arena);
+489 -1
View File
@@ -47,6 +47,12 @@ extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table
namespace greptime { namespace greptime {
namespace v1 { namespace v1 {
namespace frontend { namespace frontend {
class KillProcessRequest;
struct KillProcessRequestDefaultTypeInternal;
extern KillProcessRequestDefaultTypeInternal _KillProcessRequest_default_instance_;
class KillProcessResponse;
struct KillProcessResponseDefaultTypeInternal;
extern KillProcessResponseDefaultTypeInternal _KillProcessResponse_default_instance_;
class ListProcessRequest; class ListProcessRequest;
struct ListProcessRequestDefaultTypeInternal; struct ListProcessRequestDefaultTypeInternal;
extern ListProcessRequestDefaultTypeInternal _ListProcessRequest_default_instance_; extern ListProcessRequestDefaultTypeInternal _ListProcessRequest_default_instance_;
@@ -60,6 +66,8 @@ extern ProcessInfoDefaultTypeInternal _ProcessInfo_default_instance_;
} // namespace v1 } // namespace v1
} // namespace greptime } // namespace greptime
PROTOBUF_NAMESPACE_OPEN PROTOBUF_NAMESPACE_OPEN
template<> ::greptime::v1::frontend::KillProcessRequest* Arena::CreateMaybeMessage<::greptime::v1::frontend::KillProcessRequest>(Arena*);
template<> ::greptime::v1::frontend::KillProcessResponse* Arena::CreateMaybeMessage<::greptime::v1::frontend::KillProcessResponse>(Arena*);
template<> ::greptime::v1::frontend::ListProcessRequest* Arena::CreateMaybeMessage<::greptime::v1::frontend::ListProcessRequest>(Arena*); template<> ::greptime::v1::frontend::ListProcessRequest* Arena::CreateMaybeMessage<::greptime::v1::frontend::ListProcessRequest>(Arena*);
template<> ::greptime::v1::frontend::ListProcessResponse* Arena::CreateMaybeMessage<::greptime::v1::frontend::ListProcessResponse>(Arena*); template<> ::greptime::v1::frontend::ListProcessResponse* Arena::CreateMaybeMessage<::greptime::v1::frontend::ListProcessResponse>(Arena*);
template<> ::greptime::v1::frontend::ProcessInfo* Arena::CreateMaybeMessage<::greptime::v1::frontend::ProcessInfo>(Arena*); template<> ::greptime::v1::frontend::ProcessInfo* Arena::CreateMaybeMessage<::greptime::v1::frontend::ProcessInfo>(Arena*);
@@ -380,6 +388,334 @@ class ListProcessResponse final :
}; };
// ------------------------------------------------------------------- // -------------------------------------------------------------------
class KillProcessRequest final :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:greptime.v1.frontend.KillProcessRequest) */ {
public:
inline KillProcessRequest() : KillProcessRequest(nullptr) {}
~KillProcessRequest() override;
explicit PROTOBUF_CONSTEXPR KillProcessRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
KillProcessRequest(const KillProcessRequest& from);
KillProcessRequest(KillProcessRequest&& from) noexcept
: KillProcessRequest() {
*this = ::std::move(from);
}
inline KillProcessRequest& operator=(const KillProcessRequest& from) {
CopyFrom(from);
return *this;
}
inline KillProcessRequest& operator=(KillProcessRequest&& 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 KillProcessRequest& default_instance() {
return *internal_default_instance();
}
static inline const KillProcessRequest* internal_default_instance() {
return reinterpret_cast<const KillProcessRequest*>(
&_KillProcessRequest_default_instance_);
}
static constexpr int kIndexInFileMessages =
2;
friend void swap(KillProcessRequest& a, KillProcessRequest& b) {
a.Swap(&b);
}
inline void Swap(KillProcessRequest* other) {
if (other == this) return;
#ifdef PROTOBUF_FORCE_COPY_IN_SWAP
if (GetOwningArena() != nullptr &&
GetOwningArena() == other->GetOwningArena()) {
#else // PROTOBUF_FORCE_COPY_IN_SWAP
if (GetOwningArena() == other->GetOwningArena()) {
#endif // !PROTOBUF_FORCE_COPY_IN_SWAP
InternalSwap(other);
} else {
::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
}
}
void UnsafeArenaSwap(KillProcessRequest* other) {
if (other == this) return;
GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
InternalSwap(other);
}
// implements Message ----------------------------------------------
KillProcessRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
return CreateMaybeMessage<KillProcessRequest>(arena);
}
using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
void CopyFrom(const KillProcessRequest& from);
using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
void MergeFrom( const KillProcessRequest& from) {
KillProcessRequest::MergeImpl(*this, from);
}
private:
static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg);
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;
uint8_t* _InternalSerialize(
uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
int GetCachedSize() const final { return _impl_._cached_size_.Get(); }
private:
void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned);
void SharedDtor();
void SetCachedSize(int size) const final;
void InternalSwap(KillProcessRequest* other);
private:
friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
return "greptime.v1.frontend.KillProcessRequest";
}
protected:
explicit KillProcessRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena,
bool is_message_owned = false);
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 {
kServerAddrFieldNumber = 1,
kCatalogFieldNumber = 2,
kProcessIdFieldNumber = 3,
};
// string server_addr = 1;
void clear_server_addr();
const std::string& server_addr() const;
template <typename ArgT0 = const std::string&, typename... ArgT>
void set_server_addr(ArgT0&& arg0, ArgT... args);
std::string* mutable_server_addr();
PROTOBUF_NODISCARD std::string* release_server_addr();
void set_allocated_server_addr(std::string* server_addr);
private:
const std::string& _internal_server_addr() const;
inline PROTOBUF_ALWAYS_INLINE void _internal_set_server_addr(const std::string& value);
std::string* _internal_mutable_server_addr();
public:
// string catalog = 2;
void clear_catalog();
const std::string& catalog() const;
template <typename ArgT0 = const std::string&, typename... ArgT>
void set_catalog(ArgT0&& arg0, ArgT... args);
std::string* mutable_catalog();
PROTOBUF_NODISCARD std::string* release_catalog();
void set_allocated_catalog(std::string* catalog);
private:
const std::string& _internal_catalog() const;
inline PROTOBUF_ALWAYS_INLINE void _internal_set_catalog(const std::string& value);
std::string* _internal_mutable_catalog();
public:
// uint64 process_id = 3;
void clear_process_id();
uint64_t process_id() const;
void set_process_id(uint64_t value);
private:
uint64_t _internal_process_id() const;
void _internal_set_process_id(uint64_t value);
public:
// @@protoc_insertion_point(class_scope:greptime.v1.frontend.KillProcessRequest)
private:
class _Internal;
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
struct Impl_ {
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr server_addr_;
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr catalog_;
uint64_t process_id_;
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
};
union { Impl_ _impl_; };
friend struct ::TableStruct_greptime_2fv1_2ffrontend_2fserver_2eproto;
};
// -------------------------------------------------------------------
class KillProcessResponse final :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:greptime.v1.frontend.KillProcessResponse) */ {
public:
inline KillProcessResponse() : KillProcessResponse(nullptr) {}
~KillProcessResponse() override;
explicit PROTOBUF_CONSTEXPR KillProcessResponse(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
KillProcessResponse(const KillProcessResponse& from);
KillProcessResponse(KillProcessResponse&& from) noexcept
: KillProcessResponse() {
*this = ::std::move(from);
}
inline KillProcessResponse& operator=(const KillProcessResponse& from) {
CopyFrom(from);
return *this;
}
inline KillProcessResponse& operator=(KillProcessResponse&& 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 KillProcessResponse& default_instance() {
return *internal_default_instance();
}
static inline const KillProcessResponse* internal_default_instance() {
return reinterpret_cast<const KillProcessResponse*>(
&_KillProcessResponse_default_instance_);
}
static constexpr int kIndexInFileMessages =
3;
friend void swap(KillProcessResponse& a, KillProcessResponse& b) {
a.Swap(&b);
}
inline void Swap(KillProcessResponse* other) {
if (other == this) return;
#ifdef PROTOBUF_FORCE_COPY_IN_SWAP
if (GetOwningArena() != nullptr &&
GetOwningArena() == other->GetOwningArena()) {
#else // PROTOBUF_FORCE_COPY_IN_SWAP
if (GetOwningArena() == other->GetOwningArena()) {
#endif // !PROTOBUF_FORCE_COPY_IN_SWAP
InternalSwap(other);
} else {
::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
}
}
void UnsafeArenaSwap(KillProcessResponse* other) {
if (other == this) return;
GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
InternalSwap(other);
}
// implements Message ----------------------------------------------
KillProcessResponse* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
return CreateMaybeMessage<KillProcessResponse>(arena);
}
using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
void CopyFrom(const KillProcessResponse& from);
using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
void MergeFrom( const KillProcessResponse& from) {
KillProcessResponse::MergeImpl(*this, from);
}
private:
static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg);
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;
uint8_t* _InternalSerialize(
uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
int GetCachedSize() const final { return _impl_._cached_size_.Get(); }
private:
void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned);
void SharedDtor();
void SetCachedSize(int size) const final;
void InternalSwap(KillProcessResponse* other);
private:
friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
return "greptime.v1.frontend.KillProcessResponse";
}
protected:
explicit KillProcessResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena,
bool is_message_owned = false);
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:greptime.v1.frontend.KillProcessResponse)
private:
class _Internal;
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
struct Impl_ {
bool success_;
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
};
union { Impl_ _impl_; };
friend struct ::TableStruct_greptime_2fv1_2ffrontend_2fserver_2eproto;
};
// -------------------------------------------------------------------
class ProcessInfo final : class ProcessInfo final :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:greptime.v1.frontend.ProcessInfo) */ { public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:greptime.v1.frontend.ProcessInfo) */ {
public: public:
@@ -428,7 +764,7 @@ class ProcessInfo final :
&_ProcessInfo_default_instance_); &_ProcessInfo_default_instance_);
} }
static constexpr int kIndexInFileMessages = static constexpr int kIndexInFileMessages =
2; 4;
friend void swap(ProcessInfo& a, ProcessInfo& b) { friend void swap(ProcessInfo& a, ProcessInfo& b) {
a.Swap(&b); a.Swap(&b);
@@ -734,6 +1070,154 @@ ListProcessResponse::processes() const {
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// KillProcessRequest
// string server_addr = 1;
inline void KillProcessRequest::clear_server_addr() {
_impl_.server_addr_.ClearToEmpty();
}
inline const std::string& KillProcessRequest::server_addr() const {
// @@protoc_insertion_point(field_get:greptime.v1.frontend.KillProcessRequest.server_addr)
return _internal_server_addr();
}
template <typename ArgT0, typename... ArgT>
inline PROTOBUF_ALWAYS_INLINE
void KillProcessRequest::set_server_addr(ArgT0&& arg0, ArgT... args) {
_impl_.server_addr_.Set(static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
// @@protoc_insertion_point(field_set:greptime.v1.frontend.KillProcessRequest.server_addr)
}
inline std::string* KillProcessRequest::mutable_server_addr() {
std::string* _s = _internal_mutable_server_addr();
// @@protoc_insertion_point(field_mutable:greptime.v1.frontend.KillProcessRequest.server_addr)
return _s;
}
inline const std::string& KillProcessRequest::_internal_server_addr() const {
return _impl_.server_addr_.Get();
}
inline void KillProcessRequest::_internal_set_server_addr(const std::string& value) {
_impl_.server_addr_.Set(value, GetArenaForAllocation());
}
inline std::string* KillProcessRequest::_internal_mutable_server_addr() {
return _impl_.server_addr_.Mutable(GetArenaForAllocation());
}
inline std::string* KillProcessRequest::release_server_addr() {
// @@protoc_insertion_point(field_release:greptime.v1.frontend.KillProcessRequest.server_addr)
return _impl_.server_addr_.Release();
}
inline void KillProcessRequest::set_allocated_server_addr(std::string* server_addr) {
if (server_addr != nullptr) {
} else {
}
_impl_.server_addr_.SetAllocated(server_addr, GetArenaForAllocation());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
if (_impl_.server_addr_.IsDefault()) {
_impl_.server_addr_.Set("", GetArenaForAllocation());
}
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
// @@protoc_insertion_point(field_set_allocated:greptime.v1.frontend.KillProcessRequest.server_addr)
}
// string catalog = 2;
inline void KillProcessRequest::clear_catalog() {
_impl_.catalog_.ClearToEmpty();
}
inline const std::string& KillProcessRequest::catalog() const {
// @@protoc_insertion_point(field_get:greptime.v1.frontend.KillProcessRequest.catalog)
return _internal_catalog();
}
template <typename ArgT0, typename... ArgT>
inline PROTOBUF_ALWAYS_INLINE
void KillProcessRequest::set_catalog(ArgT0&& arg0, ArgT... args) {
_impl_.catalog_.Set(static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
// @@protoc_insertion_point(field_set:greptime.v1.frontend.KillProcessRequest.catalog)
}
inline std::string* KillProcessRequest::mutable_catalog() {
std::string* _s = _internal_mutable_catalog();
// @@protoc_insertion_point(field_mutable:greptime.v1.frontend.KillProcessRequest.catalog)
return _s;
}
inline const std::string& KillProcessRequest::_internal_catalog() const {
return _impl_.catalog_.Get();
}
inline void KillProcessRequest::_internal_set_catalog(const std::string& value) {
_impl_.catalog_.Set(value, GetArenaForAllocation());
}
inline std::string* KillProcessRequest::_internal_mutable_catalog() {
return _impl_.catalog_.Mutable(GetArenaForAllocation());
}
inline std::string* KillProcessRequest::release_catalog() {
// @@protoc_insertion_point(field_release:greptime.v1.frontend.KillProcessRequest.catalog)
return _impl_.catalog_.Release();
}
inline void KillProcessRequest::set_allocated_catalog(std::string* catalog) {
if (catalog != nullptr) {
} else {
}
_impl_.catalog_.SetAllocated(catalog, GetArenaForAllocation());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
if (_impl_.catalog_.IsDefault()) {
_impl_.catalog_.Set("", GetArenaForAllocation());
}
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
// @@protoc_insertion_point(field_set_allocated:greptime.v1.frontend.KillProcessRequest.catalog)
}
// uint64 process_id = 3;
inline void KillProcessRequest::clear_process_id() {
_impl_.process_id_ = uint64_t{0u};
}
inline uint64_t KillProcessRequest::_internal_process_id() const {
return _impl_.process_id_;
}
inline uint64_t KillProcessRequest::process_id() const {
// @@protoc_insertion_point(field_get:greptime.v1.frontend.KillProcessRequest.process_id)
return _internal_process_id();
}
inline void KillProcessRequest::_internal_set_process_id(uint64_t value) {
_impl_.process_id_ = value;
}
inline void KillProcessRequest::set_process_id(uint64_t value) {
_internal_set_process_id(value);
// @@protoc_insertion_point(field_set:greptime.v1.frontend.KillProcessRequest.process_id)
}
// -------------------------------------------------------------------
// KillProcessResponse
// bool success = 1;
inline void KillProcessResponse::clear_success() {
_impl_.success_ = false;
}
inline bool KillProcessResponse::_internal_success() const {
return _impl_.success_;
}
inline bool KillProcessResponse::success() const {
// @@protoc_insertion_point(field_get:greptime.v1.frontend.KillProcessResponse.success)
return _internal_success();
}
inline void KillProcessResponse::_internal_set_success(bool value) {
_impl_.success_ = value;
}
inline void KillProcessResponse::set_success(bool value) {
_internal_set_success(value);
// @@protoc_insertion_point(field_set:greptime.v1.frontend.KillProcessResponse.success)
}
// -------------------------------------------------------------------
// ProcessInfo // ProcessInfo
// uint64 id = 1; // uint64 id = 1;
@@ -1058,6 +1542,10 @@ inline void ProcessInfo::set_allocated_frontend(std::string* frontend) {
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// @@protoc_insertion_point(namespace_scope) // @@protoc_insertion_point(namespace_scope)
File diff suppressed because it is too large Load Diff
+16
View File
@@ -23,6 +23,8 @@ option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1/front
service Frontend { service Frontend {
// List all running processes on frontend. // List all running processes on frontend.
rpc ListProcess(ListProcessRequest) returns (ListProcessResponse); rpc ListProcess(ListProcessRequest) returns (ListProcessResponse);
// Kill a running process on frontend.
rpc KillProcess(KillProcessRequest) returns (KillProcessResponse);
} }
message ListProcessRequest { message ListProcessRequest {
@@ -33,6 +35,20 @@ message ListProcessResponse {
repeated ProcessInfo processes = 1; repeated ProcessInfo processes = 1;
} }
message KillProcessRequest {
// Frontend server address of process.
string server_addr = 1;
// Catalog of process to kill.
string catalog = 2;
// ID of process to kill.
uint64 process_id = 3;
}
message KillProcessResponse {
// Whether targeting process is successfully killed
bool success = 1;
}
message ProcessInfo { message ProcessInfo {
// ID. // ID.
uint64 id = 1; uint64 id = 1;