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

Function foreach

src/slave/gc.cpp:139–159  ·  view source on GitHub ↗

Locate the path.

Source from the content-addressed store, hash-verified

137
138 // Locate the path.
139 foreach (const Owned<PathInfo>& info, paths.get(timeout)) {
140 if (info->path == path) {
141 // If the path is currently undergoing removal, we cannot
142 // prevent path removal and wait for removal completion.
143 if (info->removing) {
144 // Return false to be consistent with the behavior when
145 // `unschedule` is called after the path is removed.
146 return info->promise.future()
147 .then([]() { return false; });
148 }
149
150 // Discard the promise.
151 info->promise.discard();
152
153 // Clean up the maps.
154 CHECK(paths.remove(timeout, info));
155 CHECK_EQ(timeouts.erase(info->path), 1u);
156
157 return true;
158 }
159 }
160
161 LOG(FATAL) << "Inconsistent state across 'paths' and 'timeouts'";
162 return false;

Callers

nothing calls this directly

Calls 15

startsWithFunction · 0.85
ErrnoErrorClass · 0.85
errorMethod · 0.65
joinFunction · 0.50
unmountFunction · 0.50
rmdirFunction · 0.50
dispatchFunction · 0.50
thenMethod · 0.45
futureMethod · 0.45
discardMethod · 0.45
removeMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected