implement object reference serialization and debugging for object stores, some fixes

This commit is contained in:
Philipp Moritz
2016-03-15 13:06:51 -07:00
parent e46f500c91
commit bcc59e898d
6 changed files with 164 additions and 33 deletions
+7
View File
@@ -79,6 +79,13 @@ Status ObjStoreService::ObjStoreDebugInfo(ServerContext* context, const ObjStore
for (const auto& entry : memory_) {
reply->add_objref(entry.first);
}
for (int i = 0; i < request->objref_size(); ++i) {
ObjRef objref = request->objref(i);
Obj* obj = new Obj();
std::string data(memory_[objref].ptr.data, memory_[objref].ptr.len); // copies, but for debugging should be ok
obj->ParseFromString(data);
reply->mutable_obj()->AddAllocated(obj);
}
return Status::OK;
}