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

move checkpoint message to variable message

上级 527b86b7
......@@ -233,12 +233,20 @@ void GRPCClient::AsyncCheckpointNotify(const std::string& ep,
const std::string& dir,
int64_t time_out) {
const auto ch = GetChannel(ep);
CheckpointNotifyProcessor* s = new CheckpointNotifyProcessor(ch);
s->Prepare(time_out);
s->response_call_back_ = nullptr;
sendrecv::CheckpointMessage req;
req.set_notify_type(CHECKPOINT_SAVE_MESSAGE);
req.set_checkpoint_dir(dir);
sendrecv::VariableMessage req;
req.set_varname(CHECKPOINT_SAVE_MESSAGE);
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_);
rpc->Finish(&s->reply_, &s->status_, reinterpret_cast<void*>(s));
......
......@@ -26,7 +26,7 @@ service SendRecvService {
// pre-fetch variable by given variable name and Ids
rpc PrefetchVariable(VariableMessage) returns (VariableMessage) {}
rpc CheckpointNotify(CheckpointMessage) returns (VoidMessage) {}
rpc CheckpointNotify(VariableMessage) returns (VoidMessage) {}
}
// VariableMessage is serialized paddle variable message.
......@@ -83,6 +83,7 @@ message VariableMessage {
message VoidMessage {}
message CheckpointMessage {
string notify_type = 1;
string checkpoint_dir = 2;
string varname = 1;
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.
先完成此消息的编辑!
想要评论请 注册