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

Function foreachpair

src/slave/containerizer/fetcher.cpp:496–515  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

494 hashmap<CommandInfo::URI, Option<shared_ptr<Cache::Entry>>> result;
495
496 foreachpair (const CommandInfo::URI& uri,
497 const Option<Future<shared_ptr<Cache::Entry>>>& entry,
498 entries) {
499 if (entry.isSome()) {
500 if (entry->isReady()) {
501 result[uri] = entry->get();
502 } else {
503 LOG(WARNING)
504 << "Reverting to fetching directly into the sandbox for '"
505 << uri.value()
506 << "', due to failure to fetch through the cache, "
507 << "with error: " << entry->failure();
508
509 result[uri] = None();
510 }
511 } else {
512 // No entry means bypassing the cache.
513 result[uri] = None();
514 }
515 }
516
517 // NOTE: While we could inline '__fetch' we've explicitly kept
518 // it as a separate function to minimize complexity. Like with

Callers

nothing calls this directly

Calls 12

NoneClass · 0.85
upperFunction · 0.85
startsWithFunction · 0.85
isReadyMethod · 0.80
failureMethod · 0.80
CopyFromMethod · 0.80
completionMethod · 0.80
isSomeMethod · 0.45
getMethod · 0.45
valueMethod · 0.45
isPendingMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected