您的位置:首页 > 其它

protobuf的nested message嵌套消息。有时会出现序列话再反序列化后,嵌套消息的指却没有了

2016-04-02 04:47 417 查看
在使用protobuf的nested message嵌套消息时,有时会出现序列话再反序列化后,嵌套消息的指却没有了。我解决的方法是检查消息格式,把空行全去掉了,就可以了。但还是不确定是不是这个原因,至少没有找到别的原因。遇到类似的问题可以给我发邮件:zhangtiey@gmail.com

package peloton.networking;

message BaseTest {
required int32 test_base = 1;
}

message AbstractPlan {
// A plan node can have multiple children
repeated AbstractPlan children = 1;
// associated with children
optional bool include_children = 2;
// the parent node
optional AbstractPlan parent = 3;
// only for test
required int32 test_number = 4;
// base test
required BaseTest base = 5;
}

message SeqScanPlan {
// the base abstract plan
required AbstractPlan base = 1;
// only for test
required int32 test_number = 2;
}

message QueryPlanRequest {
required string type = 1;
optional SeqScanPlan seqscan_plan = 2;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: