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

Method get

src/slave/containerizer/fetcher.cpp:1021–1052  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1019
1020
1021Option<shared_ptr<FetcherProcess::Cache::Entry>>
1022FetcherProcess::Cache::get(
1023 const Option<string>& user,
1024 const string& uri)
1025{
1026 const string key = cacheKey(user, uri);
1027
1028 Option<shared_ptr<Entry>> entry = table.get(key);
1029 if (entry.isSome()) {
1030 // The FetcherProcess will always remove a failed download
1031 // synchronously after marking this future as failed.
1032 CHECK(!entry.get()->completion().isFailed());
1033
1034 // Validate the cache file, if it has been downloaded.
1035 if (entry.get()->completion().isReady()) {
1036 Try<Nothing> validation = validate(entry.get());
1037 if (validation.isError()) {
1038 LOG(WARNING) << "Validation failed: '" + validation.error() +
1039 "'. Removing cache entry...";
1040
1041 remove(entry.get());
1042 return None();
1043 }
1044 }
1045
1046 // Refresh the cache entry by moving it to the back of lruSortedEntries.
1047 lruSortedEntries.remove(entry.get());
1048 lruSortedEntries.push_back(entry.get());
1049 }
1050
1051 return entry;
1052}
1053
1054
1055bool FetcherProcess::Cache::contains(

Callers 15

recoverFunction · 0.45
recoverMethod · 0.45
foreachFunction · 0.45
FlagsMethod · 0.45
foreachFunction · 0.45
~MetricsMethod · 0.45
setRecoveryTimeMethod · 0.45
initializePluginMethod · 0.45
foreachFunction · 0.45
foreachpairFunction · 0.45
startMethod · 0.45
CSIServerMethod · 0.45

Calls 11

cacheKeyFunction · 0.85
NoneClass · 0.85
isFailedMethod · 0.80
completionMethod · 0.80
isReadyMethod · 0.80
errorMethod · 0.65
validateFunction · 0.50
removeFunction · 0.50
isSomeMethod · 0.45
isErrorMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected