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

Function foreach

src/launcher/fetcher.cpp:486–515  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

484 }
485
486 foreach (const FetcherInfo::Item& item, fetcherInfo.items()) {
487 if (item.action() != FetcherInfo::Item::BYPASS_CACHE) {
488 // If this user has fetched anything into the cache before, their cache
489 // directory will already exist. Set `recursive = true` when calling
490 // `os::mkdir` to ensure no error is returned in this case.
491 Try<Nothing> mkdir = os::mkdir(fetcherInfo.cache_directory(), true);
492 if (mkdir.isError()) {
493 return mkdir;
494 }
495
496 if (fetcherInfo.has_user()) {
497 // Fetching is performed as the task's user,
498 // so chown the cache directory.
499
500 // TODO(coffler): Fix Windows chown handling, see MESOS-8063.
501#ifndef __WINDOWS__
502 Try<Nothing> chown = os::chown(
503 fetcherInfo.user(),
504 fetcherInfo.cache_directory(),
505 false);
506
507 if (chown.isError()) {
508 return chown;
509 }
510#endif // __WINDOWS__
511 }
512
513 break;
514 }
515 }
516
517 return Nothing();
518}

Callers

nothing calls this directly

Calls 9

chownFunction · 0.85
actionMethod · 0.80
userMethod · 0.80
fetchFunction · 0.70
errorMethod · 0.65
mkdirFunction · 0.50
isErrorMethod · 0.45
valueMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected