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

Method applyDelta

fdbclient/include/fdbclient/VersionVector.h:142–161  ·  view source on GitHub ↗

@note this method, together with method getDelta(), helps minimize the number of version vector entries that get sent from sequencer to grv proxy (and from grv proxy to client) on the read path.

Source from the content-addressed store, hash-verified

140 // the number of version vector entries that get sent from sequencer to
141 // grv proxy (and from grv proxy to client) on the read path.
142 void applyDelta(const VersionVector& delta) {
143 if (delta.maxVersion == invalidVersion) {
144 return;
145 }
146
147 if (maxVersion >= delta.maxVersion) {
148 return;
149 }
150
151 if (CLIENT_KNOBS->SEND_ENTIRE_VERSION_VECTOR) {
152 *this = delta;
153 } else {
154 for (const auto& [tag, version] : delta.versions) {
155 if (version > maxVersion) {
156 setVersionNoCheck(tag, version);
157 }
158 }
159 maxVersion = delta.maxVersion;
160 }
161 }
162
163 std::string toString() const {
164 std::stringstream vector;

Calls

no outgoing calls

Tested by

no test coverage detected