MCPcopy Create free account
hub / github.com/apple/foundationdb / deserialize

Method deserialize

flow/include/flow/ObjectSerializer.h:98–118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96
97 template <class... Items>
98 void deserialize(FileIdentifier file_identifier, Items&... items) {
99 LoadContext<ReaderImpl> context(static_cast<ReaderImpl*>(this));
100 const uint8_t* data = static_cast<ReaderImpl*>(this)->data();
101 if (read_file_identifier(data) != file_identifier) {
102 // Some file identifiers are changed in 7.0, so file identifier mismatches
103 // are expected during a downgrade from 7.0 to 6.3
104 bool expectMismatch = mProtocolVersion.get() >= ProtocolVersion(0x0FDB00B070000000LL) &&
105 currentProtocolVersion() < ProtocolVersion(0x0FDB00B070000000LL);
106 {
107 TraceEvent te(expectMismatch ? SevInfo : SevError, "MismatchedFileIdentifier");
108 if (expectMismatch) {
109 te.suppressFor(1.0);
110 }
111 te.detail("Expected", file_identifier).detail("Read", read_file_identifier(data));
112 }
113 if (!expectMismatch) {
114 ASSERT(false);
115 }
116 }
117 load_members(data, context, items...);
118 }
119
120 template <class Item>
121 void deserialize(Item& item) {

Callers 1

fromStringRefMethod · 0.45

Calls 7

read_file_identifierFunction · 0.85
currentProtocolVersionFunction · 0.85
load_membersFunction · 0.85
deserializeFunction · 0.85
detailMethod · 0.80
getMethod · 0.65
dataMethod · 0.45

Tested by

no test coverage detected