提交 85215df0 编写于 作者: T tangwei12

move checkpoint message to variable message

上级 527b86b7
...@@ -233,12 +233,20 @@ void GRPCClient::AsyncCheckpointNotify(const std::string& ep, ...@@ -233,12 +233,20 @@ void GRPCClient::AsyncCheckpointNotify(const std::string& ep,
const std::string& dir, const std::string& dir,
int64_t time_out) { int64_t time_out) {
const auto ch = GetChannel(ep); const auto ch = GetChannel(ep);
CheckpointNotifyProcessor* s = new CheckpointNotifyProcessor(ch); CheckpointNotifyProcessor* s = new CheckpointNotifyProcessor(ch);
s->Prepare(time_out); s->Prepare(time_out);
s->response_call_back_ = nullptr;
sendrecv::CheckpointMessage req; sendrecv::VariableMessage req;
req.set_notify_type(CHECKPOINT_SAVE_MESSAGE); req.set_varname(CHECKPOINT_SAVE_MESSAGE);
req.set_checkpoint_dir(dir); req.out_varname(dir);
auto call = s->stub_g_.PrepareUnaryCall(
s->context_.get(), "/sendrecv.SendRecvService/CheckpointNotify", req,
&cq_);
call->StartCall();
call->Finish(&s->reply_, &s->status_, reinterpret_cast<void*>(s));
auto rpc = s->stub_->AsyncCheckpointNotify(s->context_.get(), req, &cq_); auto rpc = s->stub_->AsyncCheckpointNotify(s->context_.get(), req, &cq_);
rpc->Finish(&s->reply_, &s->status_, reinterpret_cast<void*>(s)); rpc->Finish(&s->reply_, &s->status_, reinterpret_cast<void*>(s));
......
...@@ -26,7 +26,7 @@ service SendRecvService { ...@@ -26,7 +26,7 @@ service SendRecvService {
// pre-fetch variable by given variable name and Ids // pre-fetch variable by given variable name and Ids
rpc PrefetchVariable(VariableMessage) returns (VariableMessage) {} rpc PrefetchVariable(VariableMessage) returns (VariableMessage) {}
rpc CheckpointNotify(CheckpointMessage) returns (VoidMessage) {} rpc CheckpointNotify(VariableMessage) returns (VoidMessage) {}
} }
// VariableMessage is serialized paddle variable message. // VariableMessage is serialized paddle variable message.
...@@ -83,6 +83,7 @@ message VariableMessage { ...@@ -83,6 +83,7 @@ message VariableMessage {
message VoidMessage {} message VoidMessage {}
message CheckpointMessage { message CheckpointMessage {
string notify_type = 1; string varname = 1;
string checkpoint_dir = 2; string notify_type = 2;
string checkpoint_dir = 3;
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册