MCPcopy Create free account
hub / github.com/apache/mesos / patch

Method patch

src/state/log.cpp:166–184  ·  view source on GitHub ↗

Returns a snapshot after having applied the specified diff.

Source from the content-addressed store, hash-verified

164
165 // Returns a snapshot after having applied the specified diff.
166 Try<Snapshot> patch(const Operation::Diff& diff) const
167 {
168 if (diff.entry().name() != entry.name()) {
169 return Error("Attempted to patch the wrong snapshot");
170 }
171
172 Try<string> patch = svn::patch(
173 entry.value(),
174 svn::Diff(diff.entry().value()));
175
176 if (patch.isError()) {
177 return Error(patch.error());
178 }
179
180 Entry entry(diff.entry());
181 entry.set_value(patch.get());
182
183 return Snapshot(position, entry, diffs + 1);
184 }
185
186 // Position in the log where this snapshot is located. NOTE: if
187 // 'diffs' is greater than 0 this still represents the location of

Callers 2

mock_mesos_http_requestFunction · 0.80
foreachFunction · 0.80

Calls 9

patchFunction · 0.85
DiffClass · 0.85
SnapshotClass · 0.85
errorMethod · 0.65
ErrorFunction · 0.50
nameMethod · 0.45
valueMethod · 0.45
isErrorMethod · 0.45
getMethod · 0.45

Tested by 1

mock_mesos_http_requestFunction · 0.64